This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Fixing load address to eliminate local dynamic relocs
- From: Ian Lance Taylor <iant at google dot com>
- To: ""Doug Kwan (éæå)"" <dougkwan at google dot com>
- Cc: binutils at sourceware dot org
- Date: Thu, 23 Oct 2008 13:03:47 -0700
- Subject: Re: Fixing load address to eliminate local dynamic relocs
- References: <498552560810231109j2b55b1a0vfa599a4160b77efa@mail.gmail.com>
""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