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.

TI ARM Compiler insert data into section



Hi,

I am using the TI ARM Compiler and have two separate linker command files. One linker command files contains just symbols, the other contains several sections. I want to add the symbols from the first linker command file to the sections in the other linker command file. This works with the GCC Compiler when I use someting like...

SECTIONS

{
    .test :
   {      __STORESYMBOL = .;
        LONG(SYMOBL_FROM_LINKER_CMD_FILE)
     }  > rom
 }

Is there a way to this with the TI ARM Compiler? I have looked in the ARM Assembly Language Tools User Guide, but haven't found any documentation about that.

Tor

  • Tor Bo said:
    I have looked in the ARM Assembly Language Tools User Guide

    Take a close look at the section titled Assigning Symbols at Link Time.  That section shows you all the methods the TI linker supports for creating symbols in the linker command file.

    Thanks and regards,

    -George

  • Thank you for the reply.


    I took a look at the section you mentioned, but could not find any solution working for me. The section will be created, but it is alway empty and has a length of zero bytes. I don't know how I can insert the symbol from the other linker command file into the corresponding section (like with GNU GCC).

  • I suspect I don't understand what you trying to do. Part of the reason I don't understand is that I have little knowledge of GCC linker scripts.

    Please describe the overarching problem you want to solve, without getting into any details of how you do it with either the TI or GCC tools.

    Thanks and regards,

    -George

  • I have two linker scripts, exampleA.cmd and exampleB.cmd . In the linker script exampleA.cmd is just one symobl defined. After compiling and before linking, a value to the symbol is assigned via a shell script. So the value of the symbol is only known on link time. This symbol should then be added into a section defined in the linker script exampleB.cmd during linking.

    I don't know how to add the symbol from exampleA.cmd into the section defined in exampleB.cmd. I didn't find any solution / command to add / store  the symbol in the section.

  • Please forgive me, but I still don't get it.  This quote is from your first post, part of a GCC linker script ...

    Tor Bo said:

    SECTIONS

    {
        .test :
       {      __STORESYMBOL = .;
            LONG(SYMOBL_FROM_LINKER_CMD_FILE)
         }  > rom
     }

    I will describe what I think this code does.  This description is probably wrong.  Your corrections to my description will (hopefully) help me understand what you want to do.

    This code creates an output section named .test.  The input sections are any section from an object file that is also named .test.  The symbol __STORESYMBOL is assigned the address at the beginning of .test.  SYMOBL_FROM_LINKER_CMD_FILE is defined in another linker command file.  But that definition is completely overwitten by this code.  SYMOBL_FROM_LINKER_CMD_FILE is also assigned the address at the beginning of .test.

    Please tell me where I am incorrect.

    Thanks and regards,

    -George

  • That's no problem.

    With the keyword "LONG" you can include explicit bytes of data in an output section. "LONG" is followed by an expression in parentheses providing the value to store. The value of the expression is stored at the current value of the location counter (must be the section program counter for TI ARM Compiler). 

    This code creates an output section named .test, thats correct. The symbol __STORESYMBOL is assigned the address at the beginning of .test. The current location counter has now an address value from rom. At this address, the symbol SYMOBL_FROM_LINKER_CMD_FILE is stored. SYMOBL_FROM_LINKER_CMD_FILE is defined in another linker command file. There is no input section from an object file and no overwriting is taking place.

  • Thank you for your patience.  I understand now.  I should have looked up the keyword LONG in the GCC linker manual.  Sorry about that.

    And to further your disappointment ... Sorry, but there is no operator like LONG available in TI linker command files.

    Thanks and regards,

    -George

  • That's sad, but ok. Then I have to change a bit of my software code.


    Thank's for the support! As always, perfect : )