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.

ARM-CGT: Linker optimazation with relocatable code

Part Number: ARM-CGT

Hello,

we have some very difficult problem to self and need help of a linker compiler expert. I will try to explain the problem here abstractly:

We are developing a firmware for a AM243 processor with ARM clang compiler (newest version 3.2.0 LTS).

Two parts of the FW are build as relocatable binaries.

We are then building the final executable with those two relocatable binaries. Those relocatable binaries share the same memory region (via UNION in linker file).

During startup the FW will decide which part to copy into the memory region.

Now the problem occures. It seems to be that the linker sees both relocatable binaries during linking and is trying to optimize die final executable. 

While optimizing he also uses the code from the other relocatable part.

This brings us to the problem:

The Linker should be told that he is not allowed to use the other relocatable code for optimization. He should treat the relocatable parts as singularity and should not be able to optimize the code in a way that when one part is loaded he tries to call parts of the other relocatable part.

Is this even achievable? Loading and running the firmware is already working we are only getting hardware-aborts now because he tries to call the code from the other relocatable section then it is currently loaded

Thanks

Fabian