From 09695f5689bb7745efb295ccc0b49919d8cf5a6c Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 15 May 2003 06:35:43 +0000 Subject: * elf32-i386.c (allocate_dynrelocs): Use SYMBOL_CALLS_LOCAL. (elf_i386_relocate_section): Likewise. * elf32-ppc.c (allocate_dynrelocs): Likewise. (ppc_elf_relocate_section): Likewise. * elf64-ppc.c (allocate_dynrelocs): Likewise. (ppc64_elf_relocate_section): Likewise. --- bfd/elf32-i386.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'bfd/elf32-i386.c') diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 8fbe8a1..b1a441a 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -1679,7 +1679,13 @@ allocate_dynrelocs (h, inf) if (info->shared) { - if (SYMBOL_REFERENCES_LOCAL (info, h)) + /* The only reloc that uses pc_count is R_386_PC32, which will + appear on a call or on something like ".long foo - .". 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 assembly like ".long foo - .". */ + if (SYMBOL_CALLS_LOCAL (info, h)) { struct elf_i386_dyn_relocs **pp; @@ -2434,7 +2440,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, || h->root.type != bfd_link_hash_undefweak) && (r_type != R_386_PC32 || (h != NULL - && !SYMBOL_REFERENCES_LOCAL (info, h)))) + && !SYMBOL_CALLS_LOCAL (info, h)))) || (ELIMINATE_COPY_RELOCS && !info->shared && h != NULL -- cgit v1.1