diff options
author | Andreas Jaeger <aj@suse.de> | 2001-02-20 08:01:32 +0000 |
---|---|---|
committer | Andreas Jaeger <aj@suse.de> | 2001-02-20 08:01:32 +0000 |
commit | 05aa1441bb42bdddacd51c2d959be57308de3c07 (patch) | |
tree | eed88185ba49d1b465f758037ce08fae7d7a50c4 /bfd | |
parent | d02ee68167d49f249ad7bc187ad94db2d5a1bc8a (diff) | |
download | gdb-05aa1441bb42bdddacd51c2d959be57308de3c07.zip gdb-05aa1441bb42bdddacd51c2d959be57308de3c07.tar.gz gdb-05aa1441bb42bdddacd51c2d959be57308de3c07.tar.bz2 |
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')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf64-x86-64.c | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1b74b5c..9740fd0 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +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. + 2001-02-19 Jakub Jelinek <jakub@redhat.com> * elf32-sparc.c (elf32_sparc_finish_dynamic_symbol): Don't make PLT diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 9e10c91..3845cc1 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; } } |