
Dear Albert,
On 2010-11-19 13:38:00, Albert ARIBAUD wrote:
Le 19/11/2010 13:33, Sebastien Carlier a écrit :
Is it not possible to tell the linker to place a made-up 32 kB symbol within the text section at address 0x40008000? I am not familiar enough with ld to tell whether there are restrictions for setting the absolute address of a symbol that would disallow it in this case.
You can force a symbol to reside at a given offset, but that will not make the linker "skip" that symbol when filling the output section, if that's what you meant.
Yes, I was hoping the linker would first allocate space for absolute-address symbols and then fill the gaps with the remaining symbols in whatever order.
If you read up the binutils doc, you'll see that ld fills output sections based on a "location pointer" (the "dot") that simply moves on with each input section added -- no skipping, and no jumping from one region to another either.
I see, thank you for pointing this out. This specific behavior actually seems quite essential to the interpretation of linker scripts, so there is probably no hope for any change there.
I very much like your idea of splitting the binary when flashing and recomposing it into RAM during copying just before relocation, it looks very flexible and elegant. A separate solution is still needed for running from flash... apart from switching back to archive libraries and using --whole-archive, I am out of ideas at the moment.
Regards,