summaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r--bfd/elf32-i386.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index b034154fb9..3bc710096a 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -1778,7 +1778,13 @@ elf_i386_scan_relocs (bfd *abfd,
if (r_type == R_386_32
&& (sec->flags & SEC_READONLY) == 0)
func_pointer_ref = true;
- else
+
+ /* IFUNC symbol needs pointer equality in PDE so that
+ function pointer reference will be resolved to its
+ PLT entry directly. */
+ if (!func_pointer_ref
+ || (bfd_link_pde (info)
+ && h->type == STT_GNU_IFUNC))
h->pointer_equality_needed = 1;
}