https://sourceware.org/bugzilla/show_bug.cgi?id=34444
--- Comment #3 from Sourceware Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by H.J. Lu <[email protected]>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=471130b39c03623ec6d78ece377ff4da3f6bfe7b commit 471130b39c03623ec6d78ece377ff4da3f6bfe7b Author: H.J. Lu <[email protected]> Date: Thu Jul 30 13:43:56 2026 +0800 x86: Check invalid GOT/PLT/TLS relocations 1. Since non-alloc sections aren't checked for TLS, GOT and PLT usages, relocate_section should issue error for TLS, GOT and PLT relocations in non-alloc and non-debugging sections. 2. Since TLS relocations must be against thread local symbols, scan_relocs should issue an error for TLS relocation against non-thread local symbol. PR ld/34444 PR ld/34448 * elf32-i386.c (elf_i386_tls_transition): Replace _bfd_x86_elf_link_report_tls_invalid_section_error with _bfd_x86_elf_link_report_error. (elf_i386_scan_relocs): Issue an error for TLS relocation against non-thread local symbol. (elf_i386_relocate_section): Issue error for TLS, GOT and PLT relocations in non-alloc and non-debugging sections. * elf64-x86-64.c (elf_x86_64_tls_transition): Replace _bfd_x86_elf_link_report_tls_invalid_section_error with _bfd_x86_elf_link_report_error. (elf_x86_64_scan_relocs): Issue an error for TLS relocation against non-thread local symbol. * elfxx-x86.c (_bfd_x86_elf_link_report_tls_invalid_section_error): Renamed to ... (_bfd_x86_elf_link_report_error): This. Add an argument for link error type and handle it. * elfxx-x86.h (elf_x86_error_type): New enum. (_bfd_x86_elf_link_report_tls_invalid_section_error): Renamed to ... (_bfd_x86_elf_link_report_error): This. Add an argument of enum elf_x86_error_type. Signed-off-by: H.J. Lu <[email protected]> -- You are receiving this mail because: You are on the CC list for the bug.
