PATCH for i386: --no-copy-relocs

Alan Modra amodra@bigpond.net.au
Tue Jun 19 17:01:00 GMT 2001


On Tue, Jun 19, 2001 at 01:50:21PM -0700, Ian Lance Taylor wrote:
> Alan Modra <amodra@bigpond.net.au> writes:
> 
> > Here's what I think the dynamic linker should do with a COPY reloc:
> > a) copy the initialised value of the associated variable from the
> >    shared library into space allocated in the executable.
> > b) set the shared lib's .got entry for the variable to point at the
> >    space in the executable.
[snip]
> However, based on the earlier mail, I wonder if point (b) is not
> happening because the shared library was linked using -Bsymbolic.

You're right, of course.  It's nothing to do with the dynamic linker as
-Bsymbolic removes dynamic relocations for local symbols.

As a side note, doing this does not provide any benefit at run-time for
data accesses, besides reducing dynamic loader time;  Data accesses still
go through the .got.  Contrast this with function calls, which do gain
some run-time benefit as local function calls don't got through the .plt
for -Bsymbolic libs.  It might be neat to have a variant of -Bsymbolic
that only affected functions calls.

Alan



More information about the Binutils mailing list