This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ld --as-needed assertion fail, BFD internal error and crash


On Wed, Mar 15, 2006 at 06:01:05PM +0000, Nick Clifton wrote:
> Hi Dmitry,
> 
> >While building random packages with ld --as-needed to evaluate this
> >extension, I found few cases where ld fails within BFD:
> >http://sources.redhat.com/bugzilla/show_bug.cgi?id=2434
> >Looks like --as-needed is not widely used and therefore not tested well.
> 
> The attached patch appears to fix this problem, but I am not sure that 
> it is the correct solution.
> 
> H.J. - would you care to comment ?  Should we be ignoring 
> bfd_link_hash_new type symbols in the way that the patch proposes or is 
> it wrong that such symbols reach this point in the code ?

The hash_new syms are no doubt the result of elf_smash_syms trying to
undo symbol table state after finding that a shared lib wasn't needed.
I haven't looked at the testcase under gdb, but I wouldn't be surprised
to find that the problem can't be fixed without a rewrite of the
as-needed code.  Trying to undo symbol table state is fragile, to say
the least.  We probably ought to be doing two passes over symbols from
an as-needed lib, first time to see if the library is needed, then do
the normal processing only if we find the library is in fact needed.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]