From: Alan Modra Date: Wed, 1 Jul 2026 01:28:53 +0000 (+0930) Subject: PR 34165 aarch64 assertion fail and segv X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=457c3b91dfc6bc0bf149229265ba1ddf5ac018a1;p=thirdparty%2Fbinutils-gdb.git PR 34165 aarch64 assertion fail and segv * elfnn-aarch64.c (dtpoff_base, tpoff_base): Don't assert that tls_sec is non-NULL, return zero instead. --- diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index ffca9048e65..cbd4abea122 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -5396,8 +5396,8 @@ aarch64_tls_transition (bfd *input_bfd, static bfd_vma dtpoff_base (struct bfd_link_info *info) { - /* If tls_sec is NULL, we should have signalled an error already. */ - BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL); + if (elf_hash_table (info)->tls_sec == NULL) + return 0; return elf_hash_table (info)->tls_sec->vma; } @@ -5409,8 +5409,8 @@ tpoff_base (struct bfd_link_info *info) { struct elf_link_hash_table *htab = elf_hash_table (info); - /* If tls_sec is NULL, we should have signalled an error already. */ - BFD_ASSERT (htab->tls_sec != NULL); + if (htab->tls_sec == NULL) + return 0; bfd_vma base = align_power ((bfd_vma) TCB_SIZE, htab->tls_sec->alignment_power);