PR 34165 aarch64 assertion fail and segv

Project / Subsystem

binutils / binutils

Date

2026-07-01

Proposer

Alan Modra <amodra@gmail.com>

Source type

public_inbox

Consensus

Proposed

Sentiment

/10

Technical tradeoffs

  • Fixes a crash by relaxing an assertion, potentially masking underlying issues with weak undefined TLS symbol handling.
  • Aligns AArch64 behavior with x86 for specific TLS symbol scenarios.

All attributes

project
binutils
subsystem
binutils
patch_id
discussion_id
akTVYb32aOjEDV8W@squeak.grove.modra.org
source_type
public_inbox
title
PR 34165 aarch64 assertion fail and segv
headline
PR 34165 aarch64 assertion fail and segv
tldr
Fixes an assertion failure and segfault in aarch64 ELF linking related to weak undefined TLS symbols.
proposer
Alan Modra <amodra@gmail.com>
consensus
Proposed
outcome
proposed
sentiment_score
technical_tradeoffs
  • Fixes a crash by relaxing an assertion, potentially masking underlying issues with weak undefined TLS symbol handling.
  • Aligns AArch64 behavior with x86 for specific TLS symbol scenarios.
series_id
series_role
standalone
series_parts
[]
tags
  • aarch64
  • elf
  • linker
  • tls
  • bugfix
bugzilla_url
date
2026-07-01T00:00:00.000Z

PR 34165 aarch64 assertion fail and segv

This patch resolves an assertion failure and subsequent segmentation fault in binutils’ AArch64 ELF linker. The issue arises when weak undefined TLS symbols are used, as their addresses are tied to the thread pointer. The fix modifies the dtpoff_base and tpoff_base functions to return 0 instead of asserting that tls_sec is non-NULL, thus preventing the crash and resulting in a zero .got entry for these symbols, consistent with x86 behavior.