aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2003-05-15 06:35:43 +0000
committerAlan Modra <amodra@gmail.com>2003-05-15 06:35:43 +0000
commit09695f5689bb7745efb295ccc0b49919d8cf5a6c (patch)
treee8d0abbcec0f7bfd7e98005cc70e0c1147504bd6 /bfd/elf32-i386.c
parent40f62fa0b5b463171f747094b0c471e8c12b3950 (diff)
downloadgdb-09695f5689bb7745efb295ccc0b49919d8cf5a6c.zip
gdb-09695f5689bb7745efb295ccc0b49919d8cf5a6c.tar.gz
gdb-09695f5689bb7745efb295ccc0b49919d8cf5a6c.tar.bz2
* 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.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r--bfd/elf32-i386.c10
1 files changed, 8 insertions, 2 deletions
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