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


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 ?

Cheers
  Nick


Index: bfd/elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.204
diff -c -3 -p -r1.204 elflink.c
*** bfd/elflink.c	25 Feb 2006 09:23:30 -0000	1.204
--- bfd/elflink.c	15 Mar 2006 17:46:27 -0000
*************** _bfd_elf_fix_symbol_flags (struct elf_li
*** 2330,2336 ****
    /* If this is a weak defined symbol in a dynamic object, and we know
       the real definition in the dynamic object, copy interesting flags
       over to the real definition.  */
!   if (h->u.weakdef != NULL)
      {
        struct elf_link_hash_entry *weakdef;
  
--- 2330,2336 ----
    /* If this is a weak defined symbol in a dynamic object, and we know
       the real definition in the dynamic object, copy interesting flags
       over to the real definition.  */
!   if (h->u.weakdef != NULL && h->u.weakdef->root.type != bfd_link_hash_new)
      {
        struct elf_link_hash_entry *weakdef;
  

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