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.

How to make the GCC linker equivalent to existing TI compiler linker file

Other Parts Discussed in Thread: MSP430F2410

I can see MEMORY and SECTIONS exist in both the linker files.

Apart from that i can see lot more in GCC msp430f2410.ld file.

Especially for the application specific segments apart from adding MEMORY and sections do i need to do something in the GCC linker file.

How do i route a section to the particular memory in GCC?

I am attaching existing reference TI Linker file and GCC linker file for reference.

7002.Linker.rar

  • I don't have enough expertise on the GCC linker to answer.  I'm getting some help on that.  In the meantime, you can try to use the GCC linker documentation.  You are interested in the chapter on Linker Scripts.

    Thanks and regards,

    -George

  • Hi Vinoth,

    if you have, for example, the following MEMORYallocation defined:

    MEMORY {
    
    ....
    
    MY_FLASH   : ORIGIN = 0xFBE0, LENGTH = 0x0002
    
    ...
    
    }
    

    define a section to be placed in this memory:

      .my_section  :{
       *(.my_section)
      } > MY_FLASH

    and, in your code, define data to be placed in this section:

    unsigned int __attribute__((section(".my_section"))) myData = 0x4242;

    This would lead to the value 0x4242 be placed at the memory location 0xFBE0.

    Best Regards,

    Bob