This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFC: Add dynamic list to version script
On Wed, Aug 09, 2006 at 04:45:42PM +0200, Michael Matz wrote:
> Hi,
>
> On Wed, 9 Aug 2006, Alan Modra wrote:
>
> > On Tue, Aug 08, 2006 at 09:59:50AM -0700, H. J. Lu wrote:
> > > + binding_stays_local_p = (info->executable
> > > + || info->symbolic
> > > + || (info->dynamic && !h->dynamic));
> >
> > > +@kindex --dynamic-list=@var{dynamic-list-file}
> > > +@item --dynamic-list=@var{dynamic-list-file}
> > > +Specify the name of a dynamic list file to the linker. This is
> > > +typically used when creating shared libraries to specify a list of
> > > +global symbols whose references shouldn't be bound to the definition
> > > +within the shared library, or creating dynamically linked executables
> > > +to specify a list of symbols which should be added to the symbol table
> > > +in the executable. This option is only meaningful on ELF platforms
> > > +which support shared libraries.
> >
> > Your documentation doesn't agree with what the patch does. In a
> > previous email you said
> >
> > > It will bind all symbols locally except for those on the dynamic list.
> >
> > which is quite different to the description in ld.texinfo. Please fix.
> > Also, if you really mean that if --dynamic-list is specified then all
> > symbols not on the dynamic list will be local, please rewrite the patch
> > to use forced_local rather than adding a new field to
> > elf_link_hash_entry.
>
> I don't know what forced_local semantics are exactly, so forgive me if I'm
> spelling out the obvious: the symbols not specified as dynamic symbols
> should be bound locally, but they should still be exported, for others to
> link against. If that is what forced_local does, nice, but from what I
It should be:
The symbols not specified as dynamic symbols should be bound locally,
But the symbols specified as dynamic symbols, exported for others to
link against, can be bound locally or dynamically.
> read in elflink.c it seems that it's doing something more?
We have 2 things going on here:
1. If a symbol should be visible to outside. That affects
dynamic symbol table.
2. If a symbol should be bound locally. That affects dynamic
relocation.
--verion-script will decide #1 for shared library.
--dynamic-list will decide #1 for executable and #2 for
shared library.
H.J.