How to link .lib file generated by other project to specific memory location.
-- Rahul
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.
Thanks Michael,
I did compile .lib with specific rules in linker so that nothing will get messed up at main project. But I'm not getting how to mention .lib generated by other project in .cmd(linker command file) file of the main project.
I'm sing CCSv5.5
any help?
-Rahul
Look at section 8.5.4.5 Specifying Library or Archive Members as Input to Output Sections in the MSP430 Assembly Language Tools User's Guide. It shows how sections from a specific library file can be placed in their own sections.Rahul Udagatti said:But I'm not getting how to mention .lib generated by other project in .cmd(linker command file) file of the main project.
E.g. I took an example project which linked the standard run time library rts430x_lc_rd_eabi.lib and added a custom memory region in the linker command file:
CUSTOM_FLASH : origin = 0xA400, length = 0x2000
In the sections entry in the linker command file the .text from the rts430x_lc_rd_eabi.lib library was forced to the CUSTOM_FLASH memory, while .text from other objects was left in the FLASH or FLASH2 memory regions:
    .text       : {}>> FLASH2 | FLASH       /* CODE                              */
    .text:_isr  : {} > FLASH                /* ISR CODE SPACE                    */
    .text       : {-l=rts430x_lc_rd_eabi.lib(.text)} > CUSTOM_FLASH
Inspecting the linker map file confirmed that the .text from the rts430x_lc_rd_eabi.lib library had been placed in it's own memory region, and only by having to modify the linker command file (i.e. didn't have to modify how the library was built).
**Attention** This is a public forum