RFC: sections that explicitly have no VMA
Simon Richter
Simon.Richter@hogyros.de
Tue Aug 29 12:45:00 GMT 2006
Hello,
I had a small thought today: Would it make sense to have a statement in
the linker script language to specify that an output section explicitly
does not have a VMA?
When this flag is applied to an output section, then there may not be
any relocations in the output object that depend on the position of that
section (the difficulty here will be size calculations, obviously), nor
may any relaxations be performed that assume that a section is at a
certain VMA.
There are two additional flags that would be useful here:
- "this section may contain relocations to sections without a VMA".
Obviously that would be the PLT/GOT and possibly a few others.
- "this section is relocatable". This would mean that absolute
relocations are okay for this section, and that they should be emitted
into the output file for the runtime linker.
In one of my current projects, I have the case that a few output
sections are "trampolines" that can be loaded at different addresses,
I'd like the linker to enforce that there are no relocations inside that
section. Also, the fact that Windows and uClinux binaries are relocated
after loading would be made explicit in the linker script, so there may
be a possibility of moving code from target specific routines to generic
ones.
Questions? Comments?
Simon
More information about the Binutils
mailing list