--as-needed handling of shared libraries that fail -Wl,-z,defs

Alan Modra amodra@bigpond.net.au
Fri May 20 13:52:00 GMT 2005


On Fri, May 20, 2005 at 12:02:25PM +0200, Jakub Jelinek wrote:
> On Fri, May 20, 2005 at 07:23:49PM +0930, Alan Modra wrote:
> > On Thu, May 19, 2005 at 06:37:16PM +0200, Jakub Jelinek wrote:
> > > --as-needed doesn't seem to try satisfy undefined references in shared
> > > libraries:
> > 
> > No, as the ld doc says it "causes DT_NEEDED tags to only be emitted
> > for libraries that satisfy some symbol reference from regular objects
> > which is undefined at the point that the library was linked."
> 
> Ok, fine, no problem with that.  But in that case we should issue
> an error about unsatisfied references.

Yes.  The code needs rewriting to do that.  The trouble is that the
symbol table state isn't restored back to what is was before loading the
as-needed lib.  See the comment above elflink.c:elf_smash_syms.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list