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.

Relocation issue with rand and error

Other Parts Discussed in Thread: TMS320C6678

I am porting some code to test on a TMS320C6678 EVM board, and having trouble with the linker.

The messages I am getting are:

warning #10247-D: creating output section ".TI.tls" without a SECTIONS specification
warning #10247-D: creating output section ".TI.tls_init" without a SECTIONS specification
"rand.c", line 54 (approximate): warning #17003-D: relocation from function "rand" to symbol "next" overflowed; the 22-bit relocated address 0x20c797 is too large to encode in the 15-bit unsigned field (type = 'R_C6000_TPR_U15_W' (40), file = "C:\ti\ccsv5\tools\compiler\c6000_7.4.11\lib\rts6600_elf_mt.lib<rand.obj>", offset = 0x00000008, section = ".text:rand")
"rand.c", line 54 (approximate): warning #17003-D: relocation from function "rand" to symbol "next" overflowed; the 22-bit relocated address 0x20c797 is too large to encode in the 15-bit unsigned field (type = 'R_C6000_TPR_U15_W' (40), file = "C:\ti\ccsv5\tools\compiler\c6000_7.4.11\lib\rts6600_elf_mt.lib<rand.obj>", offset = 0x0000002c, section = ".text:rand")
"errno.c", line 86 (approximate): warning #17003-D: relocation from function "__c6xabi_errno_addr" to symbol "__errno" overflowed; the 24-bit relocated address 0x831e2c is too large to encode in the 15-bit unsigned field (type = 'R_C6000_TPR_U15_B' (38), file = "C:\ti\ccsv5\tools\compiler\c6000_7.4.11\lib\rts6600_elf_mt.lib<errno.obj>", offset = 0x0000000c, section = ".text:__c6xabi_errno_addr")
warning #10015-D: output file "benchmark.out" cannot be loaded and run on a target system

I have looked at several articles, and so far tried the following:

  • --mem_model:data to far
  • Various changes to the .cfg file
  • Checked that the issue in doesn't apply ( I am using compiler 7.4.11, the header is already modified as expected)

I understand what relocation does, but I'm not clear how I can fix the way these library functions are relocated.  I presume this should be an easy fix, but I'm stuck, what should I do?

  • Hi Relingor,
    Please provide more information to support you. Do you see this error with example project provided by TI? What you have modified from it?

    Thank you.
  • I have built the examples in SYS/BIOS getting started guide etc, and several simple 'hello world' projects since. Now I am porting an existing project from another platform (originally built using MSVC using IPP library) to CCS for the TI DSP, and working through the various cross-platform problems.

    I have got past the compile errors, so I am now trying to link.

    The project was originally based on the openmp example matvec_openmp_evm6678, but I have had to move away from OpenMP for this stage as the code being ported is C++ which is not completely supported by CCS.

    Can you explain what the errors mean more clearly than http://processors.wiki.ti.com/index.php/Compiler/diagnostic_messages/17003 ? Or can you give me the link that is missing from that page "For more information, see [[..]]"?

    For now, I will try to remove the rand and errno parts of the code so I can continue with the porting.
  • There was a left over '--openmp' in the Project settings which I guess was pulling in an incorrect library, removing that has taken away the linker error, I have replaced the rand code and it still builds correctly.
  • Hi Relingor,
    This would help other community memebers. Thank you for the update.