aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
Diffstat (limited to 'bfd')
-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 cfb0085..52b1db4 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -2460,6 +2460,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;