summaryrefslogtreecommitdiff
path: root/bfd/elf64-alpha.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-07-18 21:09:28 +0000
committerRichard Henderson <rth@redhat.com>2003-07-18 21:09:28 +0000
commit36a768763847b3970a7bb68083d36a78fb6412eb (patch)
treea5bdf4863a41ad7e14ecd6fb2df9fa56342019c3 /bfd/elf64-alpha.c
parentdf85b002a5effa284710367ceacae9e0253e9797 (diff)
downloadgdb-36a768763847b3970a7bb68083d36a78fb6412eb.tar.gz
* elflink.c (_bfd_elf_dynamic_symbol_p): New.
* elf-bfd.h (_bfd_elf_dynamic_symbol_p): Declare it. (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Use it. * elf32-xtensa.c (xtensa_elf_dynamic_symbol_p): Likewise. * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise. * elf64-hppa.c (elf64_hppa_dynamic_symbol_p): Likewise. * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Likewise. Update all callers to provide the relocation being resolved.
Diffstat (limited to 'bfd/elf64-alpha.c')
-rw-r--r--bfd/elf64-alpha.c46
1 files changed, 7 insertions, 39 deletions
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index ca3aa194bf7..625b24398a6 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -47,7 +47,7 @@
#define ECOFF_64
#include "ecoffswap.h"
-static int alpha_elf_dynamic_symbol_p
+static bfd_boolean alpha_elf_dynamic_symbol_p
PARAMS ((struct elf_link_hash_entry *, struct bfd_link_info *));
static struct bfd_hash_entry * elf64_alpha_link_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
@@ -269,49 +269,17 @@ struct alpha_elf_link_hash_table
#define alpha_elf_sym_hashes(abfd) \
((struct alpha_elf_link_hash_entry **)elf_sym_hashes(abfd))
-/* Should we do dynamic things to this symbol? */
+/* Should we do dynamic things to this symbol? This differs from the
+ generic version in that we never need to consider function pointer
+ equality wrt PLT entries -- we don't create a PLT entry if a symbol's
+ address is ever taken. */
-static int
+static inline bfd_boolean
alpha_elf_dynamic_symbol_p (h, info)
struct elf_link_hash_entry *h;
struct bfd_link_info *info;
{
- if (h == NULL)
- return FALSE;
-
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- if (h->dynindx == -1)
- return FALSE;
-
- if (h->root.type == bfd_link_hash_undefweak
- || h->root.type == bfd_link_hash_defweak)
- return TRUE;
-
- switch (ELF_ST_VISIBILITY (h->other))
- {
- case STV_DEFAULT:
- break;
- case STV_HIDDEN:
- case STV_INTERNAL:
- return FALSE;
- case STV_PROTECTED:
- if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
- return FALSE;
- break;
- }
-
- if ((info->shared && !info->symbolic)
- || ((h->elf_link_hash_flags
- & (ELF_LINK_HASH_DEF_DYNAMIC
- | ELF_LINK_HASH_DEF_REGULAR
- | ELF_LINK_HASH_REF_REGULAR))
- == (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)))
- return TRUE;
-
- return FALSE;
+ return _bfd_elf_dynamic_symbol_p (h, info, 0);
}
/* Create an entry in a Alpha ELF linker hash table. */