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.

Compiler: Linker Command File Reference



Tool/software: TI C/C++ Compiler

I am looking for a detailed explanation of linker command file syntax - but no luck yet.

Actually I want to use a linker command file to place a constant into memory, such as put $55AA to address $FF00 (just as an example). Does anybody know whether linker command files allow for that ?

I am using a C2000 (TMS320C28069).

Thanks, Martin

  • For an introduction to the linker command file, please see the article Linker Command File Primer.  For a reference, see the linker chapter in the C28x assembly tools manual.  

    Martin Schleemann said:
    want to use a linker command file to place a constant into memory, such as put $55AA to address $FF00 (just as an example). Does anybody know whether linker command files allow for that ?

    There is a way to do it.  But it is not straightforward.  Here is one way to consider ...

    #define ADDRESS   0xff00
    #define VALUE     0x55aa
    
    SECTIONS
    {
       for_assignment
       {
          . += 1;
       } > ADDRESS, fill = VALUE
    }

    Using the #define names like that is not strictly necessary, but it makes the code easier to understand.  This creates an output section named for_assignment.  Line 8 creates a 1 word hole.  This line is C28x specific.  It presumes the linker command file counts address increments as 16-bit words, and not 8-bit bytes (which is the case for all the other TI CPU families).  This output section is allocated to the hard-coded address 0xff00.  It is filled with the value 0x55aa.

    Thanks and regards,

    -George