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.

Linker file, insert data in section

Hi,


How do I add data values to a section in the linker file? In gcc based linker files this is solved by LONG and BYTE etc but I have not been able to get it work with TI toolchain. I hope to avoid having to put the static data in .c files in specific segment and then link the output to the target section.

I was hoping that a syntax like this would be possible:

SECTIONS
{
   .example_section: ALIGN(4), START(section_start), END(section_end), FILL=0x1234ABCD > FLASH
  {
    BYTE(0x23)
    LONG(section_start)
    LONG(section_end)
    . += EXAMPLE_SECTION_FILL_LEN;
  }
}

So how do I do this with TI toolchain? So far I have looked in TI_ARM_AssemblerManual.pdf, is there any better documentation please let me know.


BR,

/Johannes

  • Johannes S said:
    I hope to avoid having to put the static data in .c files in specific segment and then link the output to the target section

    Unfortunately, that is the best way to do it.  The TI linker has no feature that supports putting values directly in an output section.  One variation to consider ... You might be more comfortable defining the static data in assembly rather than C.

    Thanks and regards,

    -George