Another fix for PR815

Alan Modra amodra@bigpond.net.au
Fri Apr 15 03:37:00 GMT 2005


This is another fix for bugs noted in PR815.  If you read the comments
in the PR, you'll see that I haven't worked out exactly how the problem
is occurring, so there is a good chance that further patches are
needed.  However, I'm sure that this patch is correct even if it might
not be a complete fix.

	PR ld/815
	* elflink.c (elf_smash_syms): Clear undef.next if it's not being
	used as a list pointer.

Index: bfd/elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.145
diff -u -p -r1.145 elflink.c
--- bfd/elflink.c	13 Apr 2005 16:44:08 -0000	1.145
+++ bfd/elflink.c	14 Apr 2005 23:15:51 -0000
@@ -2935,8 +2935,11 @@ elf_smash_syms (struct elf_link_hash_ent
   if (h->ref_regular)
     abort ();
 
-  /* Set sym back to newly created state, but keep undefs list pointer.  */
+  /* Set sym back to newly created state, but keep undef.next if it is
+     being used as a list pointer.  */
   bh = h->root.u.undef.next;
+  if (bh == &h->root)
+    bh = NULL;
   if (bh != NULL || inf->htab->root.undefs_tail == &h->root)
     inf->twiddled = TRUE;
   (*inf->htab->root.table.newfunc) (&h->root.root,

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list