aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-05-24 04:07:38 +0000
committerAlan Modra <amodra@gmail.com>2002-05-24 04:07:38 +0000
commitea1e4b0d544568f83197cb4eccb7ec9f86543e73 (patch)
treed97db4f9f8641bc83e34c6696d2730b7c0269377 /bfd/elf64-ppc.c
parent7f7432881e1b8199850d77b69dffa4f2ac1fad91 (diff)
downloadgdb-ea1e4b0d544568f83197cb4eccb7ec9f86543e73.zip
gdb-ea1e4b0d544568f83197cb4eccb7ec9f86543e73.tar.gz
gdb-ea1e4b0d544568f83197cb4eccb7ec9f86543e73.tar.bz2
* elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy is_func
and is_func_descriptor. (func_desc_adjust): Hide function code sym in shared libs unless there is a matching exported function descriptor sym.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r--bfd/elf64-ppc.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index d027d81..3775482 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -2583,8 +2583,11 @@ ppc64_elf_copy_indirect_symbol (dir, ind)
eind->dyn_relocs = NULL;
}
- edir->is_func |= eind->is_func;
- edir->is_func_descriptor |= eind->is_func_descriptor;
+ /* We don't need to copy is_func and is_func_descriptor; They're
+ never set when copy_indirect_symbol is called for indirect
+ symbols at the add_symbols stage of linking, and they're not
+ relevant when copy_indirect_symbol is called for weakdefs.
+ weakdefs are only held for non-function syms. */
_bfd_elf_link_hash_copy_indirect (dir, ind);
}
@@ -3236,8 +3239,14 @@ func_desc_adjust (h, inf)
been imported from another library. Function code syms that
are really in the library we must leave global to prevent the
linker dragging in a definition from a static library. */
- force_local = ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
- && info->shared);
+ force_local = (info->shared
+ && ((h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR) == 0
+ || fdh == NULL
+ || (fdh->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR) == 0
+ || (fdh->elf_link_hash_flags
+ & ELF_LINK_FORCED_LOCAL) != 0));
_bfd_elf_link_hash_hide_symbol (info, h, force_local);
}