aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-ppc.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-ppc.c')
-rw-r--r--bfd/elf32-ppc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index ca9fbd9..212e5b3 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -2799,7 +2799,13 @@ allocate_dynrelocs (h, inf)
if (info->shared)
{
- if (SYMBOL_REFERENCES_LOCAL (info, h))
+ /* 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. */
+ if (SYMBOL_CALLS_LOCAL (info, h))
{
struct ppc_elf_dyn_relocs **pp;
@@ -4991,7 +4997,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|| h->root.type != bfd_link_hash_undefweak)
&& (MUST_BE_DYN_RELOC (r_type)
|| (h != NULL
- && !SYMBOL_REFERENCES_LOCAL (info, h))))
+ && !SYMBOL_CALLS_LOCAL (info, h))))
|| (ELIMINATE_COPY_RELOCS
&& !info->shared
&& (input_section->flags & SEC_ALLOC) != 0