diff options
author | Nick Clifton <nickc@redhat.com> | 2002-09-19 14:59:51 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2002-09-19 14:59:51 +0000 |
commit | 9d7404b7626b9638168fd3c75bbca361ec4fd6ae (patch) | |
tree | 1b6d01620f77ef4589dea37aeb5a8cd57f76ca2c /bfd/elf32-arm.h | |
parent | 4f2a7c9e31ca14296ae02476d5361e2b4946c8df (diff) | |
download | gdb-9d7404b7626b9638168fd3c75bbca361ec4fd6ae.zip gdb-9d7404b7626b9638168fd3c75bbca361ec4fd6ae.tar.gz gdb-9d7404b7626b9638168fd3c75bbca361ec4fd6ae.tar.bz2 |
(elf32_arm_adjust_dynamic_symbol): Update ELF_LINK_HASH_NEEDS_PLT logic.
Diffstat (limited to 'bfd/elf32-arm.h')
-rw-r--r-- | bfd/elf32-arm.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h index e8538ac..2d59601 100644 --- a/bfd/elf32-arm.h +++ b/bfd/elf32-arm.h @@ -2966,16 +2966,22 @@ elf32_arm_adjust_dynamic_symbol (info, h) if (h->type == STT_FUNC || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) { + /* If we link a program (not a DSO), we'll get rid of unnecessary + PLT entries; we point to the actual symbols -- even for pic + relocs, because a program built with -fpic should have the same + result as one built without -fpic, specifically considering weak + symbols. + FIXME: m68k and i386 differ here, for unclear reasons. */ if (! info->shared - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0) { /* This case can occur if we saw a PLT32 reloc in an input - file, but the symbol was never referred to by a dynamic - object. In such a case, we don't actually need to build - a procedure linkage table, and we can just do a PC32 - reloc instead. */ + file, but the symbol was not defined by a dynamic object. + In such a case, we don't actually need to build a + procedure linkage table, and we can just do a PC32 reloc + instead. */ BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0); + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; return true; } |