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;
 
 #as: --32
-#ld: -shared -melf_i386
+#ld: -e bar -melf_i386
 #readelf: -r --wide
 
 Relocation section '.rel.plt' at offset 0x[0-9a-f]+ contains 1 entry:
 
 #as: --32
 #ld: -shared -melf_i386
-#readelf: -r --wide
-
-Relocation section '.rel.plt' at offset 0x[0-9a-f]+ contains 1 entry:
- Offset     Info    Type                Sym. Value  Symbol's Name
-[0-9a-f]+ +[0-9a-f]+ +R_386_IRELATIVE +
+#error: relocation R_386_GOTOFF against STT_GNU_IFUNC symbol `foo' isn't supported
 
  +[a-f0-9]+:   5b                      pop    %ebx
  +[a-f0-9]+:   81 c3 9e 10 00 00       add    \$0x109e,%ebx
  +[a-f0-9]+:   e8 de ff ff ff          call   100 <\*ABS\*@plt>
- +[a-f0-9]+:   8d 83 4c ef ff ff       lea    -0x10b4\(%ebx\),%eax
+ +[a-f0-9]+:   8b 83 0c 00 00 00       mov    0xc\(%ebx\),%eax
  +[a-f0-9]+:   c3                      ret
 #pass
 
        popl    %ebx
        addl    $_GLOBAL_OFFSET_TABLE_+[.-.L6], %ebx
        call    __GI_foo@PLT
-       leal    __GI_foo@GOTOFF(%ebx), %eax
+       movl    __GI_foo@GOT(%ebx), %eax
        ret
        .size   bar, .-bar
 
  +[a-f0-9]+:   5b                      pop    %ebx
  +[a-f0-9]+:   81 c3 9e 10 00 00       add    \$0x109e,%ebx
  +[a-f0-9]+:   e8 de ff ff ff          call   f0 <\*ABS\*@plt>
- +[a-f0-9]+:   8d 83 4c ef ff ff       lea    -0x10b4\(%ebx\),%eax
+ +[a-f0-9]+:   8b 83 0c 00 00 00       mov    0xc\(%ebx\),%eax
  +[a-f0-9]+:   c3                      ret
 #pass
 
        popl    %ebx
        addl    $_GLOBAL_OFFSET_TABLE_+[.-.L6], %ebx
        call    __GI_foo@PLT
-       leal    __GI_foo@GOTOFF(%ebx), %eax
+       movl    __GI_foo@GOT(%ebx), %eax
        ret
        .size   bar, .-bar