[PATCH 1/2] x86: Error out if the TLS relocation section can't be created
Pietro Monteiro
pietro@sociotechnical.xyz
Wed Nov 25 00:17:53 GMT 2026
In _bfd_x86_elf_link_setup_gnu_properties, failing to create or align
the .rel.tls/.rela.tls section returned false (i.e. NULL). A null
return means no relocatable ELF input with GNU properties was found,
so the link carried on with no diagnostic, htab->rel_tls_desc left
NULL, and the PLT .eh_frame and .sframe setup skipped.
Call info->callbacks->fatal instead, as the other section-creation
failures in this function already do.
This was found during testing of the autoconf 2.73 upgrade, which uses
C23 by default if the compiler supports it, and building with GCC 14.2,
which is affected by
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112556.
Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
---
bfd/elfxx-x86.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
index 792fc1655d9..ac0ec77e96a 100644
--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -4833,7 +4833,7 @@ _bfd_x86_elf_link_setup_gnu_properties
bed->dynamic_sec_flags | SEC_READONLY);
if (sec == NULL
|| !bfd_set_section_alignment (sec, bed->s->log_file_align))
- return false;
+ info->callbacks->fatal (_("%P: failed to create TLS relocation section\n"));
htab->rel_tls_desc = sec;
if (!info->no_ld_generated_unwind_info)
--
2.56.1
More information about the Binutils
mailing list