diff options
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r-- | bfd/elf64-x86-64.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 7cf7959cdb1..16229b39dca 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -2221,7 +2221,13 @@ elf_x86_64_scan_relocs (bfd *abfd, struct bfd_link_info *info, && (r_type == R_X86_64_32 || r_type == R_X86_64_32S)))) 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; } |