summaryrefslogtreecommitdiff
path: root/bfd/elf64-x86-64.c
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2001-02-20 08:01:32 +0000
committerAndreas Jaeger <aj@suse.de>2001-02-20 08:01:32 +0000
commit7bdc39c8e61d68d06bea5da80a596885cb6beed2 (patch)
tree68f5f03a54fa1cf5f2d9587e50d3e45190b6c3f4 /bfd/elf64-x86-64.c
parentff0fb96a30527a408df8b8c0178c3e4903995d28 (diff)
downloadgdb-7bdc39c8e61d68d06bea5da80a596885cb6beed2.tar.gz
2001-02-20 Andreas Jaeger <aj@suse.de>
* elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Don't make PLT entries that could serve as a definition for a weak symbol.
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r--bfd/elf64-x86-64.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 9e10c917f0d..3845cc183ab 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -1656,6 +1656,13 @@ elf64_x86_64_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;
}
}