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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 94a23bf30a..6666871c40 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -2461,6 +2461,11 @@ elf_i386_relocate_section (bfd *output_bfd,
goto do_relocation;
case R_386_GOTOFF:
+ /* NB: We can't use the PLT entry as the function address
+ for PIC since the PIC register may not be set up
+ properly for indirect call. */
+ if (bfd_link_pic (info))
+ goto bad_ifunc_reloc;
relocation -= (gotplt->output_section->vma
+ gotplt->output_offset);
goto do_relocation;