]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR 34165 aarch64 assertion fail and segv
authorAlan Modra <amodra@gmail.com>
Wed, 1 Jul 2026 01:28:53 +0000 (10:58 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 2 Jul 2026 03:11:50 +0000 (12:41 +0930)
* elfnn-aarch64.c (dtpoff_base, tpoff_base): Don't assert that
tls_sec is non-NULL, return zero instead.

bfd/elfnn-aarch64.c

index ffca9048e65abfe339c629d5b485e656c625b0c3..cbd4abea122ea6606a8741a92233de8ffb4bc23e 100644 (file)
@@ -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);