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.

Link error when building ELF executable for EVM6457 platform

Other Parts Discussed in Thread: SYSBIOS

Greetings,

I am new to the TI DSP world and have been experiencing link errors trying to build a program with ELF output format for the evm6457 platform.  It builds fine with a COFF format and also builds fine in ELF when a dsk6455 plaform is selected.

I have been able to recreate the problem in a very simple example by creating a new project for the C6000 family with a "Generic C64+ Device" variant and using the Sys/BIOS "Typical" project template and selecting the evm6457 platform.  Then I set the following properties for the new project:

Device endianness = big

Compiler version = TI v7.3.1

Output format = eabi (ELF)

Runtime support library = rts64pluse_elf_eh.lib

Target = ti.targets.elf.C64P_big_endian

When I build it the linker throws a slew of warnings about symbol relocation overflow (e.g. "relocation to symbol __c6xabi_unwind_cpp_pr0 overflowed").  Also there are 9 unresolved symbol errors (e.g. _ti_sysbios_family_c62_TaskSupport_swap__E in file :sysbios.lib).

I then changed the plaform to dsk6455 and it builds with no errors.  Also, I changed the runtime support library to rts64pluse_elf.lib with plaform evm6457 and it built just fine. I have tried various things based on reading past forum posts and the C6000 EABI Migration wiki, but nothing seems to affect the errors.  Then to complete the test I changed the output format to COFF and kept the platform as evm6457 and changed the runtime support library to rts64pluse_eh.lib and it builds with no errors.

I am wondering if there is something specific to the evm6457 platform and rts64pluse_elf_eh.lib that doesn't support ELF, or is there some property I'm failing to set?

Here are the particulars of my installation:

CCS Version 5.1.0.09000

C6000 BIOS6 6.32.5.54

C6000 Compiler Tools 7.3.1

C6000 IPC 1.23.5.40

C6000 XDCTools 3.22.4.46

Thanks,

Jeff Vernon

 

 

  • Jeff Vernon said:

    When I build it the linker throws a slew of warnings about symbol relocation overflow (e.g. "relocation to symbol __c6xabi_unwind_cpp_pr0 overflowed").  Also there are 9 unresolved symbol errors (e.g. _ti_sysbios_family_c62_TaskSupport_swap__E in file :sysbios.lib).

    Both of those are serious problems.  __c6xabi_unwind_cpp_pr0 doesn't exist for COFF, which is why you don't see that error for COFF.  What is the complete text of the relocation warning?  It should mention the section that the relocation is in.

  • The complete text of a few of the warning messages is:

    warning #10247-D: creating output section ".c6xabi.exidx" without a SECTIONS specification

     warning #10247-D: creating output section ".c6xabi.extab" without a SECTIONS specification

     warning #17003-D: relocation to symbol "__TI_exidx_linkto_scn_start_92" overflowed; the 32-bit relocated address 0x6fbfffc2 is too large to encode in the 31-bit signed PC-Relative field (type = 'R_C6000_PREL31' (25), file = "(unknown file)", offset = 0x00000000, section =   ".c6xabi.exidx.text:xdc_runtime_System_doPrint__I:ti.targets.rts6000.ae64Pe<System.oe64Pe>")

    warning #17003-D: relocation to symbol "__TI_exidx_linkto_scn_start_149" overflowed; the 32-bit relocated address 0x6fc01a1a is too large to encode in the 31-bit signed PC-Relative field (type = 'R_C6000_PREL31' (25), file = "(unknown file)", offset = 0x00000000, section = ".c6xabi.exidx.text:ti_sysbios_knl_Semaphore_pend__E:sysbios.lib<BIOS.obj>")

    .

    .

    .

    warning #17003-D: relocation to symbol "__c6xabi_unwind_cpp_pr0" overflowed;  the 32-bit relocated address 0x6fc0788a is too large to encode in the 31-bit signed PC-Relative field (type = 'R_C6000_PREL31' (25), file =  "C:/ti/ccsv5/tools/compiler/c6000/lib/rts64pluse_elf_eh.lib<tdeh_pr_c6000.obj>", offset = 0x00000000, section =   ".c6xabi.exidx:.text:__c6xabi_unwind_cpp_pr0")

  • To get rid of warning 10247, you need to allocate .c6xabi.exidx and .c6xabi.extab in your SECTIONS directive in the linker command file, just as you would allocate .text or .data.  This is no doubt related to the second warning; when you add the explicit allocation, you might very well move exidx and extab to a place where the relocation overflow doesn't exist.

    SECTIONS {
         ...
         .const > MEM_CONST
         .c6xabi.exidx > MEM_CONST
         .c6xabi.extab > MEM_CONST
         ...
    }

    However, it should not be possible for PREL31 to overflow; it has a range of 32 bits, which should cover the entire memory range.  I'm going to have to see a test case for this.  I'll see if I can devise one myself, but it would help greatly to see your linker map file, if you could generate one with the --map_file linker option.

    [ Edit: This is now SDSCM00042923 --Archaeologist ]

    [ Edit: SDSCM00042923 refers only to the relocation overflow warning; it does not address the undefined symbol issue. --Archaeologist ]

  • This fixed the problem!  I allocated .exidx and .extab in lnk.cmd as you suggested and all the warnings and unresolved symbols went away.  I noticed that which section I placed them in matters.  First I put them in a different section from things like .far, .fardata, .data etc. and still got the errors.  Then I put them in the same section as everything else and it worked.  Not sure why ELF output under dsk6455 worked even without the lnk.cmd tweak.  The defaulted location of .exidx and .extab must have worked out better.

    Anyway, thanks.  Now its on to try my luck with real hardware!