[hjl@gnu-tgl-3 tmp]$ cat foo.s .text .globl _start _start: cmpl $0, _nl_current_LC_COLLATE_used@GOT(%ebx) _nl_current_LC_COLLATE_used = 2 [hjl@gnu-tgl-3 tmp]$ gcc -c foo.s -m32 [hjl@gnu-tgl-3 tmp]$ ld -pie foo.o -m elf_i386 ld: foo.o: relocation R_386_GOT32 against absolute symbol `_nl_current_LC_COLLATE_used' in section `.text' is disallowed [hjl@gnu-tgl-3 tmp]$
The master branch has been updated by H.J. Lu <hjl@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=30a954525f4e53a9cd50a1a8a6f201c7cf6595c7 commit 30a954525f4e53a9cd50a1a8a6f201c7cf6595c7 Author: H.J. Lu <hjl.tools@gmail.com> Date: Mon Feb 7 15:22:19 2022 -0800 i386: Allow GOT32 relocations against ABS symbols GOT32 relocations are allowed since absolute value + addend is stored in the GOT slot. Tested on glibc 2.35 build with GCC 11.2 and -Os. bfd/ PR ld/28870 * elfxx-x86.c (_bfd_elf_x86_valid_reloc_p): Also allow GOT32 relocations. ld/ PR ld/28870 * testsuite/ld-i386/i386.exp: Run pr28870. * testsuite/ld-i386/pr28870.d: New file. * testsuite/ld-i386/pr28870.s: Likewise.
The binutils-2_38-branch branch has been updated by H.J. Lu <hjl@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3cb97931a4728f652d1030edb9eada62d8ccc605 commit 3cb97931a4728f652d1030edb9eada62d8ccc605 Author: H.J. Lu <hjl.tools@gmail.com> Date: Mon Feb 7 15:22:19 2022 -0800 i386: Allow GOT32 relocations against ABS symbols GOT32 relocations are allowed since absolute value + addend is stored in the GOT slot. Tested on glibc 2.35 build with GCC 11.2 and -Os. bfd/ PR ld/28870 * elfxx-x86.c (_bfd_elf_x86_valid_reloc_p): Also allow GOT32 relocations. ld/ PR ld/28870 * testsuite/ld-i386/i386.exp: Run pr28870. * testsuite/ld-i386/pr28870.d: New file. * testsuite/ld-i386/pr28870.s: Likewise. (cherry picked from commit 30a954525f4e53a9cd50a1a8a6f201c7cf6595c7)
The binutils-2_37-branch branch has been updated by H.J. Lu <hjl@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7c4b20b9583d0d9c99e0793fd98ed0aaef2af729 commit 7c4b20b9583d0d9c99e0793fd98ed0aaef2af729 Author: H.J. Lu <hjl.tools@gmail.com> Date: Mon Feb 7 15:22:19 2022 -0800 i386: Allow GOT32 relocations against ABS symbols GOT32 relocations are allowed since absolute value + addend is stored in the GOT slot. Tested on glibc 2.35 build with GCC 11.2 and -Os. bfd/ PR ld/28870 * elfxx-x86.c (_bfd_elf_x86_valid_reloc_p): Also allow GOT32 relocations. ld/ PR ld/28870 * testsuite/ld-i386/i386.exp: Run pr28870. * testsuite/ld-i386/pr28870.d: New file. * testsuite/ld-i386/pr28870.s: Likewise. (cherry picked from commit 30a954525f4e53a9cd50a1a8a6f201c7cf6595c7)
Fixed for 2.38 and 2.37 branch.