[Bug ld/27998] relocation R_386_GOTOFF against STT_GNU_IFUNC symbol `foo' isn't supported

2022-07-22 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=27998

--- Comment #5 from cvs-commit at gcc dot gnu.org  ---
The binutils-2_38-branch branch has been updated by H.J. Lu
:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5c0b4ee406035917d0e50aa138194fab57ae6bf8

commit 5c0b4ee406035917d0e50aa138194fab57ae6bf8
Author: H.J. Lu 
Date:   Thu Jul 21 10:35:58 2022 -0700

i386: Don't allow GOTOFF relocation against IFUNC symbol for PIC

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.

bfd/

PR ld/27998
* elf32-i386.c (elf_i386_relocate_section): Don't allow GOTOFF
relocation against IFUNC symbol for PIC.

ld/

PR ld/27998
* testsuite/ld-i386/pr27998a.d: Replace -shared with -e bar.
* testsuite/ld-i386/pr27998b.d: Expect a linker error.
* testsuite/ld-ifunc/ifunc-2-i386-now.d: Updated.
* testsuite/ld-ifunc/ifunc-2-local-i386-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-i386.s: Replace @GOTOFF with @GOT.
* testsuite/ld-ifunc/ifunc-2-local-i386.s: Likewise.

(cherry picked from commit 8f29211c3f0a6335c17e0a90396c146facf6dba4)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/27998] relocation R_386_GOTOFF against STT_GNU_IFUNC symbol `foo' isn't supported

2022-07-22 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=27998

--- Comment #4 from cvs-commit at gcc dot gnu.org  ---
The binutils-2_39-branch branch has been updated by H.J. Lu
:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=28067e797c50eaf33bf24619aea97d3350db69e5

commit 28067e797c50eaf33bf24619aea97d3350db69e5
Author: H.J. Lu 
Date:   Thu Jul 21 10:35:58 2022 -0700

i386: Don't allow GOTOFF relocation against IFUNC symbol for PIC

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.

bfd/

PR ld/27998
* elf32-i386.c (elf_i386_relocate_section): Don't allow GOTOFF
relocation against IFUNC symbol for PIC.

ld/

PR ld/27998
* testsuite/ld-i386/pr27998a.d: Replace -shared with -e bar.
* testsuite/ld-i386/pr27998b.d: Expect a linker error.
* testsuite/ld-ifunc/ifunc-2-i386-now.d: Updated.
* testsuite/ld-ifunc/ifunc-2-local-i386-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-i386.s: Replace @GOTOFF with @GOT.
* testsuite/ld-ifunc/ifunc-2-local-i386.s: Likewise.

(cherry picked from commit 8f29211c3f0a6335c17e0a90396c146facf6dba4)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/27998] relocation R_386_GOTOFF against STT_GNU_IFUNC symbol `foo' isn't supported

2022-07-21 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=27998

--- Comment #3 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8f29211c3f0a6335c17e0a90396c146facf6dba4

commit 8f29211c3f0a6335c17e0a90396c146facf6dba4
Author: H.J. Lu 
Date:   Thu Jul 21 10:35:58 2022 -0700

i386: Don't allow GOTOFF relocation against IFUNC symbol for PIC

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.

bfd/

PR ld/27998
* elf32-i386.c (elf_i386_relocate_section): Don't allow GOTOFF
relocation against IFUNC symbol for PIC.

ld/

PR ld/27998
* testsuite/ld-i386/pr27998a.d: Replace -shared with -e bar.
* testsuite/ld-i386/pr27998b.d: Expect a linker error.
* testsuite/ld-ifunc/ifunc-2-i386-now.d: Updated.
* testsuite/ld-ifunc/ifunc-2-local-i386-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-i386.s: Replace @GOTOFF with @GOT.
* testsuite/ld-ifunc/ifunc-2-local-i386.s: Likewise.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/27998] relocation R_386_GOTOFF against STT_GNU_IFUNC symbol `foo' isn't supported

2021-06-20 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27998

H.J. Lu  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
   Target Milestone|--- |2.37
 Resolution|--- |FIXED

--- Comment #2 from H.J. Lu  ---
Fixed for 2.37.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/27998] relocation R_386_GOTOFF against STT_GNU_IFUNC symbol `foo' isn't supported

2021-06-19 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=27998

--- Comment #1 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=406b4ada55b2957c10fedaeaada801e77912d976

commit 406b4ada55b2957c10fedaeaada801e77912d976
Author: H.J. Lu 
Date:   Sat Jun 19 20:20:52 2021 -0700

x86: Count PLT for GOTOFF relocation against IFUNC symbol

Since GOTOFF relocations against IFUNC symbols must go through PLT,
set PLT reference count to 1 for GOTOFF relocation.

bfd/

PR ld/27998
* elfxx-x86.c (elf_x86_allocate_dynrelocs): Count PLT for GOTOFF
relocation against IFUNC symbols.
(_bfd_x86_elf_adjust_dynamic_symbol): Likewise.

ld/

PR ld/27998
* testsuite/ld-i386/i386.exp: Run PR ld/27998 tests.
* testsuite/ld-i386/pr27998a.d: New file.
* testsuite/ld-i386/pr27998a.s: Likewise.
* testsuite/ld-i386/pr27998b.d: Likewise.
* testsuite/ld-i386/pr27998b.s: Likewise.

-- 
You are receiving this mail because:
You are on the CC list for the bug.