aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2003-05-17 06:16:03 +0000
committerAlan Modra <amodra@gmail.com>2003-05-17 06:16:03 +0000
commit9c7a29a32e738b51793f7f2bcaa4b403373b478c (patch)
treea925e4ef543194e6e886f4cb4ba54819d59cb067 /bfd/elf64-ppc.c
parentb8b527c5a96aec839f5c8122ffd08556f7fe0d9f (diff)
downloadgdb-9c7a29a32e738b51793f7f2bcaa4b403373b478c.zip
gdb-9c7a29a32e738b51793f7f2bcaa4b403373b478c.tar.gz
gdb-9c7a29a32e738b51793f7f2bcaa4b403373b478c.tar.bz2
* elf32-i386.c (elf_i386_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL
to trim plt entries. Move undefweak non-default visibility test.. (allocate_dynrelocs): ..from here. * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't test dynamic_sections_created here. Update comment. Move undefweak non-default visibility test.. (allocate_dynrelocs): ..from here. Fix comment. * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL to trim plt entries. Move undefweak non-default visibility test.. (allocate_dynrelocs): ..from here. Fix comment. * elflink.h (elf_link_output_extsym): Compare ELF_ST_VISIBILITY with STV_DEFAULT rather than comparing with zero. * elflink.c (_bfd_elf_merge_symbol): Likewise. (_bfd_elf_fix_symbol_flags): Likewise. Format comment.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r--bfd/elf64-ppc.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 2887d9b..f32d261 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -4505,10 +4505,9 @@ ppc64_elf_adjust_dynamic_symbol (info, h)
break;
if (!((struct ppc_link_hash_entry *) h)->is_func_descriptor
|| ent == NULL
- || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0
- || (! info->shared
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
- && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0))
+ || SYMBOL_CALLS_LOCAL (info, h)
+ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
+ && h->root.type == bfd_link_hash_undefweak))
{
h->plt.plist = NULL;
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
@@ -5496,9 +5495,7 @@ allocate_dynrelocs (h, inf)
if (htab->elf.dynamic_sections_created
&& h->dynindx != -1
- && WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h)
- && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak))
+ && WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h))
{
struct plt_entry *pent;
bfd_boolean doneone = FALSE;
@@ -5621,12 +5618,12 @@ allocate_dynrelocs (h, inf)
if (info->shared)
{
- /* Relocs that use pc_count are those that appear on a call
- insn, or certain REL relocs (see MUST_BE_DYN_RELOC) that can
- generated via assembly. We want calls to protected symbols
- to resolve directly to the function rather than going via the
- plt. If people want function pointer comparisons to work as
- expected then they should avoid writing weird assembly. */
+ /* Relocs that use pc_count are those that appear on a call insn,
+ or certain REL relocs (see MUST_BE_DYN_RELOC) that can be
+ generated via assembly. We want calls to protected symbols to
+ resolve directly to the function rather than going via the plt.
+ If people want function pointer comparisons to work as expected
+ then they should avoid writing weird assembly. */
if (SYMBOL_CALLS_LOCAL (info, h))
{
struct ppc_dyn_relocs **pp;