This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to force a static library at a specific memory address

I am building some applications that use a static library and I would want to force linker to put .text and .data sections of the static library (.a file) at specific addresses using GNU linker (arm-none-eabi-gcc) but I couldn't find a way how the linker script can be modified to force/put the libx.a at a specific address considering that this library has .text and .data sections.

Is there any way to do it?

I tried the below but linker does nothing:

    .text_libx :
        . = ALIGN(4);
        KEEP(libx.a(.text .text.*))
     } >FLASH_libx

where FLASH_libx is defined to a desired address.