This is the mail archive of the binutils@sources.redhat.com 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: [cross-binutils-2.15.91.0.2] assertion fail linker.c:619


bfd/ChangeLog
	PR 338
	* elflink.c (bfd_elf_record_link_assignment): Add comment about
	changing bfd_link_hash_undefined to bfd_link_hash_new.
ld/ChangeLog
	PR 338
	* ldexp.c (fold_name): Don't call bfd_link_add_undef if the symbol
	was already on the undefs list.

Index: bfd/elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.96
diff -u -p -r1.96 elflink.c
--- bfd/elflink.c	17 Aug 2004 08:51:07 -0000	1.96
+++ bfd/elflink.c	18 Aug 2004 02:42:52 -0000
@@ -434,7 +434,12 @@ bfd_elf_record_link_assignment (bfd *out
 
   /* Since we're defining the symbol, don't let it seem to have not
      been defined.  record_dynamic_symbol and size_dynamic_sections
-     may depend on this.  */
+     may depend on this.
+     ??? Changing bfd_link_hash_undefined to bfd_link_hash_new (or
+     to bfd_link_hash_undefweak, see linker.c:link_action) runs the risk
+     of some later symbol manipulation setting the symbol back to
+     bfd_link_hash_undefined, and the linker trying to add the symbol to
+     the undefs list twice.  */
   if (h->root.type == bfd_link_hash_undefweak
       || h->root.type == bfd_link_hash_undefined)
     h->root.type = bfd_link_hash_new;
Index: ld/ldexp.c
===================================================================
RCS file: /cvs/src/src/ld/ldexp.c,v
retrieving revision 1.31
diff -u -p -r1.31 ldexp.c
--- ld/ldexp.c	24 Jun 2004 04:46:27 -0000	1.31
+++ ld/ldexp.c	18 Aug 2004 02:42:58 -0000
@@ -576,7 +576,8 @@ fold_name (etree_type *tree,
 	    {
 	      h->type = bfd_link_hash_undefined;
 	      h->u.undef.abfd = NULL;
-	      bfd_link_add_undef (link_info.hash, h);
+	      if (h->und_next == NULL)
+		bfd_link_add_undef (link_info.hash, h);
 	    }
 	}
       break;

-- 
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]