aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@geoffk.org>2000-10-16 18:08:29 +0000
committerGeoffrey Keating <geoffk@geoffk.org>2000-10-16 18:08:29 +0000
commitfde13960b97c664d754cdef04f4de63c14240c05 (patch)
treee66f17912daf8785310c41677c6d207d5043c39a
parent8f33925de3039f880e949280b6f26bf2855d44e3 (diff)
downloadgdb-fde13960b97c664d754cdef04f4de63c14240c05.zip
gdb-fde13960b97c664d754cdef04f4de63c14240c05.tar.gz
gdb-fde13960b97c664d754cdef04f4de63c14240c05.tar.bz2
From 2000-10-14 Geoffrey Keating <geoffk@cygnus.com>
* elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Don't make PLT entries that could serve as a definition for a weak symbol.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf32-ppc.c7
2 files changed, 13 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 7659ec6..e510060 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2000-10-16 Geoffrey Keating <geoffk@cygnus.com>
+
+ From 2000-10-14 Geoffrey Keating <geoffk@cygnus.com>
+ * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Don't make PLT
+ entries that could serve as a definition for a weak symbol.
+
2000-10-15 Philip Blundell <philb@gnu.org>
From 2000-09-08 Nick Clifton <nickc@redhat.com>
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 242cfb7..e648f02 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -2687,6 +2687,13 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
/* Mark the symbol as undefined, rather than as defined in
the .plt section. Leave the value alone. */
sym->st_shndx = SHN_UNDEF;
+ /* If the symbol is weak, we do need to clear the value.
+ Otherwise, the PLT entry would provide a definition for
+ the symbol even if the symbol wasn't defined anywhere,
+ and so the symbol would never be NULL. */
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK)
+ == 0)
+ sym->st_value = 0;
}
}