summaryrefslogtreecommitdiff
path: root/bfd/elf32-sparc.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2001-02-19 22:35:47 +0000
committerJakub Jelinek <jakub@redhat.com>2001-02-19 22:35:47 +0000
commit06243676f3c0a1dee1b7dce8544fb3af9e901970 (patch)
tree88bf4c79feff900e9859ce8ad55c9a1a943ed26f /bfd/elf32-sparc.c
parent2d4a49cf5884cecccac4f3430ec155d5ea8d641c (diff)
downloadgdb-06243676f3c0a1dee1b7dce8544fb3af9e901970.tar.gz
* elf32-sparc.c (elf32_sparc_finish_dynamic_symbol): Don't make PLT
entries that could serve as a definition for a weak symbol. * elf64-sparc.c (sparc64_elf_finish_dynamic_symbol): Likewise.
Diffstat (limited to 'bfd/elf32-sparc.c')
-rw-r--r--bfd/elf32-sparc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c
index e892e9d938d..8b64f199cde 100644
--- a/bfd/elf32-sparc.c
+++ b/bfd/elf32-sparc.c
@@ -1759,6 +1759,13 @@ elf32_sparc_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;
}
}