Fixing load address to eliminate local dynamic relocs

Ian Lance Taylor iant@google.com
Thu Oct 23 20:04:00 GMT 2008


""Doug Kwan (關振德)"" <dougkwan@google.com> writes:

>     I would like to do fix the loading address of shared libraries and
> thus eliminate dynamic relocs to local symbol to save space.  Is there
> any way to do it with command line options or a script?  I have looked
> at the ld manual and it appeared there was not a way to do it.

There isn't any support for that in GNU ld, no.  The GNU/Linux prelink
program (not part of the GNU binutils) will give a shared library a
default address, but it won't remove the dynamic relocs; they remain,
and are used if the default address was not available.  So perhaps you
could modify prelink to also discard dynamic relocs.  Then of course
your shared library would fail at load time if the required address
space were not available.

Ian



More information about the Binutils mailing list