https://sourceware.org/bugzilla/show_bug.cgi?id=28387
--- Comment #2 from Sourceware Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by H.J. Lu <h...@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d5faa503bbd97015f7c9685322ace81211f5eb04 commit d5faa503bbd97015f7c9685322ace81211f5eb04 Author: H.J. Lu <hjl.to...@gmail.com> Date: Sun Aug 24 14:43:44 2025 -0700 x86: Don't put R_386_TLS_DESC/R_X86_64_TLSDESC in .rel.plt/.rela.plt Since lazy tlsdesc relocation has data races: https://sourceware.org/bugzilla/show_bug.cgi?id=27137 put R_386_TLS_DESC and R_X86_64_TLSDESC relocation in .rela.tls/.rel.tls section, instead of .rel.plt/.rela.plt section. Tested with glibc/i686 and glibc/x86-64 compiled with -mtls-dialect=gnu2 as well as GCC 16 configured with --with-tls=gnu2. bfd/ PR ld/28387 * elf32-i386.c (elf_i386_relocate_section): Put R_386_TLS_DESC in rel_tls_desc instead of elf.srelplt. * elf64-x86-64.c (elf_x86_64_relocate_section): Put R_X86_64_TLSDESC in rel_tls_desc instead of elf.srelplt. * elfxx-x86.c (elf_x86_allocate_dynrelocs): Use rel_tls_desc, instead of elf.srelplt, for GOT_TLS_GDESC_P. (_bfd_elf_x86_get_reloc_section): New function. (_bfd_x86_elf_late_size_sections): Use rel_tls_desc, instead of elf.srelplt, for GOT_TLS_GDESC_P. Remove next_tls_desc_index. (_bfd_x86_elf_link_setup_gnu_properties): Allocate .rela.tls/.rel.tls section for rel_tls_desc. * elfxx-x86.h (elf_x86_link_hash_table): Add rel_tls_desc. Remove next_tls_desc_index. (_bfd_elf_x86_get_reloc_section): New. (elf_backend_get_reloc_section): Likewise. ld/ PR ld/28387 * emulparams/elf32_x86_64.sh (OTHER_GOT_RELOC_SECTIONS): New. * emulparams/elf_i386.sh (OTHER_GOT_RELOC_SECTIONS): Likewise. * emulparams/elf_x86_64.sh (OTHER_GOT_RELOC_SECTIONS): Likewise. * testsuite/ld-i386/i386.exp: Run pr28387. * testsuite/ld-i386/pr17057.d: Adjusted * testsuite/ld-i386/tlsdesc.rd: Likewise. * testsuite/ld-i386/tlsdesc2.d: Likewise. * testsuite/ld-i386/tlsgdesc.rd: Likewise. * testsuite/ld-x86-64/tlsdesc.pd: Likewise. * testsuite/ld-x86-64/tlsdesc.rd: Likewise. * testsuite/ld-x86-64/tlsdesc2.d: Likewise. * testsuite/ld-x86-64/tlsgdesc.rd: Likewise. * testsuite/ld-i386/pr28387.d: New file. * testsuite/ld-i386/pr28387.s: Likewise. * testsuite/ld-x86-64/pr28387-x32.d: Likewise. * testsuite/ld-x86-64/pr28387.d: Likewise. * testsuite/ld-x86-64/pr28387.s: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run pr28387 and pr28387-x32. Signed-off-by: H.J. Lu <hjl.to...@gmail.com> -- You are receiving this mail because: You are on the CC list for the bug.