summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2005-04-15 03:42:46 +0000
committerAlan Modra <amodra@bigpond.net.au>2005-04-15 03:42:46 +0000
commitacfb81b787aa4d3f5a421295fb911232fbd38567 (patch)
tree3ce0ded6f57bb2a161513a35660501f3bd498058 /bfd
parent899e4b16b420460f59747483ad8fc91d75bbcff2 (diff)
downloadgdb-acfb81b787aa4d3f5a421295fb911232fbd38567.tar.gz
PR ld/815
* elflink.c (elf_smash_syms): Clear undef.next if it's not being used as a list pointer.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elflink.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 6b3c567fb51..84405e1c396 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2005-04-15 Alan Modra <amodra@bigpond.net.au>
+
+ PR ld/815
+ * elflink.c (elf_smash_syms): Clear undef.next if it's not being
+ used as a list pointer.
+
2005-04-14 Alan Modra <amodra@bigpond.net.au>
* Makefile.am (NO_WERROR): Define.
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 09d06167fa5..017ebe436a9 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -2935,8 +2935,11 @@ elf_smash_syms (struct elf_link_hash_entry *h, void *data)
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,