This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] AM6411:A53重定位错误

Guru**** 2394305 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1477824/am6411-a53-relocation-error

器件型号:AM6411
主题中讨论的其他器件:SysConfig

工具与软件:

您好!

我正在尝试在运行 FreeRTOS 的 A53内核上集成 Open62541 v1.3。

当我使用 UA_namespace_zero=reduced 编译 Open62541时成功运行服务器时、当我使用 UA_namespace_zero=full 编译完整节点集时、会遇到重定位问题。

以下是链接器发出的重定位错误以及使用的编译标志列表:


"C pie:/ti/gcc-arm-9.2-2019.12-mingw-w64-i686-aarch64-none-elf/bin/aarch64-none-elf-gcc-9.2.1.exe /ti/mcu_plus_sdk_am64x_10_01_00_32/source/drivers/lib /ti/mcu_plus_sdk_am64x_10_01_00_32/source/board/lib -Dua_architecture_FREERTOSLWIP -C:/ti/mcu_plus_sdk_am64x_10_01_00_32/source/kernel/freertos/lib /ti/mcu_plus_sdk_am64x_10_01_00_32/source/networking/enet/lib -C:dosc_AM64X -D_debug_=1 -O0 -ffuncections-fdata-sections-g /ti/mcu_plus_sdk_am64x_10_01_00_32/source/networking/lwip/lib -o -gdwarf-dwarf -wall -mcmodel=large -fno-dstrict-align -mfix-cortex-A53-cortex-835769 /syscfg/ti_dpl_config.o /syscfg/ti_drivers_config.o /syscfg/ti_drivers_open_close.o /syscfg/ti_pinmux_config.o /syscfg/ti_power_clock_config.o /syscfg/ti_board_config.o /syscfg/ti_board_open_close.o /syscfg/ti_enet_config.o /syscfg/ti_enet_open_close.o /syscfg/ti_enet_soc.o /syscfg/ti_enet_lwipif.o /driver/adin1300/adin1300.o /driver/ascii_conv src /driver/corcomm src /driver/coremon src /driver/eth_cdd/eth_cdd.o /driver/osal src /driver/sw_support src src /Users/quant/Documents/Projects/lemac/atacama-opc/tool/projectConfig/a53ss0-0_freertos/linker.cmd freertos.am64x.a53.gcc-aarch64.debug.lib drivers.am64x.a53.gcc-aarch64.debug.lib board.am64x.a53.gcc-aarch64.debug.lib enet-cpsw.am64x.a53.gcc-aarch64.debug.lib lwipif-cpsw-freertos.am64x.a53.gcc-aarch64.debug.lib lwip-freertos.am64x.a53.gcc-aarch64.debug.lib lwip-contrib-freertos.am64x.a53.gcc-aarch64.debug.lib
Makefile:186:目标"application__main_cortex_a53_0.out"的配方失败
c:/ti/mcu_plus_sdk_am64x_10_01_00_32/source/kernel/freertos/lib freertos.am64x.a53.gcc-aarch64.debug.lib(portASM.obj): in function `vPortRestoreTaskContext':
C:\ti\mcu_plus_sdk_am64x_10_01_00_32\source\kernel\freertos/portable/GCC/GCC/ARM_CA53/portasm.S:382:(.vecs+0x80c):重定位截断以拟合:R_AArch64_LD_default_LO19对比`.text.HwiP_pretHandler'
C:\ti\mcu_plus_sdk_am64x_10_01_00_32\source\kernel\freertos/portable/GCC/GCC/ARM_CA53/portASM.S:382:(.vecs+0x820):重定位截断以拟合:R_AArch64_LD_prel_LO19对应的` text.Hwip_defaultHandler'
C:\ti\mcu_plus_sdk_am64x_10_01_00_32\source\kernel\freertos/portable/GCC/GCC/ARM_CA53/portasm.S:382:(.vecs+0x840):重定位截断以拟合:R_AArch64_LD_prel_LO19对应的`.text.Hwip_exceptHandler'
C:/ti/mcu_plus_sdk_am64x_10_01_00_32/source/kernel/freertos/lib 在函数`HwiP_SVC_Handler'中的 freertos.am64x.a53.gcc-aarch64.debug.lib(portASM.obj)::
C:\ti\mcu_plus_sdk_am64x_10_01_00_32\source\kernel\freertos/portable/GCC/GCC/ARM_CA53/portasm.S:391:(.vecs+0x950):重定位截断以拟合:R_AArch64_LD_prel_LO19对比`.text.Hwip_exceptHandler'
C:\ti\mcu_plus_sdk_am64x_10_01_00_32\source\kernel\freertos/portable/GCC/GCC/ARM_CA53/portasm.S:391:(.vecs+0x958):重定位截断以拟合:R_AArch64_LD_default_LO19对比`.text.HwiP_pretHandler'
C:\ti\mcu_plus_sdk_am64x_10_01_00_32\source\kernel\freertos/portable/GCC/GCC/ARM_CA53/portasm.S:391:(.vecs+0x9ac):重定位截断以拟合:R_AArch64_LD_default_LO19对比`.text.HwiP_pretHandler'
C:\ti\mcu_plus_sdk_am64x_10_01_00_32\source\kernel\freertos/portable/GCC/GCC/ARM_CA53/portasm.S:397:(.vecs+0x9d8):重定位截断以拟合:R_AArch64_LD_Excel_LO19对比`.text.HwiP_pretHandler'
C:\ti\mcu_plus_sdk_am64x_10_01_00_32\source\kernel\freertos/portable/GCC/GCC/ARM_CA53/portasm.S:397:(.vecs+0x9ec):重定位截断以拟合:R_AArch64_LD_default_LO19对比`.text.Hwip_pretHandler'
C:\ti\mcu_plus_sdk_am64x_10_01_00_32\source\kernel\freertos/portable/GCC/GCC/ARM_CA53/portasm.S:397:(.vecs+0xa0c):重定位截断以拟合:R_AArch64_LD_Excel_LO19对比`.text.HwiP_pretHandler'
函数`HwiP_IRQ_Handler'中的 c:/ti/mcu_plus_sdk_am64x_10_01_00_32/source/kernel/freertos/lib:freertos.am64x.a53.gcc-aarch64.debug.lib(portASM.obj)::
C:\ti\mcu_plus_sdk_am64x_10_01_00_32\source\kernel\freertos/portable/GCC/GCC/arm_CA53/portasm.S:(.vecs+0xb38):重定位截断以拟合:R_AArch64_LD_prel_LO19对比`.text.Hwip_defaultHandler'
C:\ti\mcu_plus_sdk_am64x_10_01_00_32\source\kernel\freertos/portable/GCC/gcc/arm_CA53/portasm.s:442:(.vecs+0xb6c):输出中省略的其他重定位溢出
collect2.exe:错误:LD 返回1退出状态
gmake[1]:***[application__MAIN_Cortex_A53_0.out]错误1.
gmake:***[All]错误2.
Makefile:182:目标"全部"的配方失败

我还想指出的是、当我使用 TI-clang 4.0.1工具链为 R5F 内核编译相同的软件时、一切都运行顺利、不会发生此类重定位错误。

请告知如何解决此问题。


此致、

保罗·马蒂尼

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Paolo:

    对于延迟、很抱歉、我已听取您的意见并调查了该问题。 我会在获得更新后立即回复您。 同时、您可以在此处共享您的链接器文件。

    此致、

    开会。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    ENTRY(_c_int00)
    
    __TI_STACK_SIZE = 0x1400000;
    __TI_HEAP_SIZE = 0x6400000;
    
    MEMORY
    {
        DDR : ORIGIN =  0x80000000, LENGTH = 0x400000000
    
        /* shared memory segments */
        /* On A53,
         * - make sure there is a MMU entry which maps below regions as non-cache
         */
        USER_SHM_MEM            : ORIGIN = 0x701D0000, LENGTH = 0x80
        LOG_SHM_MEM             : ORIGIN = 0x701D0000 + 0x80, LENGTH = 0x00004000 - 0x80
        RTOS_NORTOS_IPC_SHM_MEM : ORIGIN = 0x701D4000, LENGTH = 0x0000C000
    }
    
    SECTIONS {
    
        .vecs : {} > DDR
        .text : {} > DDR
        .rodata : {} > DDR
    
        .data : ALIGN (8) {
            __data_load__ = LOADADDR (.data);
            __data_start__ = .;
            *(.data)
            *(.data*)
            . = ALIGN (8);
            __data_end__ = .;
        } > DDR
    
        /* General purpose user shared memory, used in some examples */
        .bss.user_shared_mem (NOLOAD) : { KEEP(*(.bss.user_shared_mem)) } > USER_SHM_MEM
        /* this is used when Debug log's to shared memory are enabled, else this is not used */
        .bss.log_shared_mem  (NOLOAD) : { KEEP(*(.bss.log_shared_mem)) } > LOG_SHM_MEM
        /* this is used only when IPC RPMessage is enabled, else this is not used */
        .bss.ipc_vring_mem   (NOLOAD) : { KEEP(*(.bss.ipc_vring_mem)) } > RTOS_NORTOS_IPC_SHM_MEM
    
        .bss : {
            __bss_start__ = .;
            *(.bss)
            *(.bss.*)
            . = ALIGN (8);
            *(COMMON)
            __bss_end__ = .;
            . = ALIGN (8);
        } > DDR
    
        .heap (NOLOAD) : {
            __heap_start__ = .;
            KEEP(*(.heap))
            . = . + __TI_HEAP_SIZE;
            __heap_end__ = .;
        } > DDR
    
        .stack (NOLOAD) : ALIGN(16) {
            __TI_STACK_BASE = .;
            KEEP(*(.stack))
            . = . + __TI_STACK_SIZE;
        } > DDR
    
    }

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    是否有关于以下问题的新闻? 请告知、因为我的客户被阻止。

    此致、
    保罗

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Paolo:

    如果您使用 CCS、请在属性中启用以下选项后尝试重新编译示例:

    我怀疑、一旦您更改为  UA_namespace_zero=full、程序就会变得足够大、以至于某些函数调用可能会超出 64兆字节寻址范围、从而导致此重定位问题。 启用标志-mlong-calls 将使编译器能够调用间接调用这样的指令: ARM 选项(使用 GNU Compiler Collection (GCC))

    此致、

    开会。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    看起来 AArch64上不支持-mlong-calls。 代码模型已设置为 -mcmmodel=large。
    请提供建议

    此致、
    保罗

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Paolo:

    此设计的预期应用大小是多少? 从链接器可以看到、您已在 DDR (length=0x400000000)中为此保留了一些14GB 的空间、这太大了、最终会导致此问题。 我假设您错误地设置了此长度、请根据您的应用程序大小/要求修改长度、然后查看这是否可以解决问题。

    此致、

    开会。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    该大小是几次测试的结果、在这些测试中、我一直在从65KB 增加 DDR 中的空间、对于 UA_namespace_zero=reduced、这是可以接受的。

    当我为 R5内核和 UA_namespace_zero=full 编译应用程序时、.out 文件大小为19MB、DDR 大小为128MB、但此设置不适用于 A53内核。

    回答您的问题:我希望某些东西与 R5内核类似、但相同的设置在 A53上不起作用、并且我不断得到重定位错误。

    一些要点:

    • GCC libc 是否应使用-mcmodel=large 编译? 我认为现在不是这样
    • 重定位错误似乎与 portasm.S 相关、因此问题只出在 FreeRTOS 的编译方式上吗?
    • 在 A53 + Linux (使用相同的编译器)上编译并运行 UA_namespace_zero=full 的 Open62541、但现在使用 FreeRTOS、这是为什么?
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Paolo:

    让我在内部检查一下、然后再给您答复。

    此致、

    开会。