[PATCH v3] bfd/dwarf2: break equal-range function ties by DIE offset, not pointer

Project / Subsystem

binutils / bfd/dwarf2

Date

2026-09-16

Proposer

Sam Price <thesamprice@gmail.com>

Source type

public_inbox

Consensus

Proposed

Sentiment

—/10

Technical tradeoffs

  • • Improves consistency and determinism of `addr2line` output.
  • • Fixes a bug related to DWARF parsing and tie-breaking.
  • • The chosen tie-breaking mechanism (DIE offset) is stable and reflects the structure of the DWARF information.

All attributes

project
binutils
subsystem
bfd/dwarf2
patch_id
—
discussion_id
20260916035145.68086-1-thesamprice@gmail.com
source_type
public_inbox
title
[PATCH v3] bfd/dwarf2: break equal-range function ties by DIE offset, not pointer
headline
bfd/dwarf2: break equal-range function ties by DIE offset, not pointer
tldr
Fixes addr2line to use DIE offset for tie-breaking, improving consistency.
proposer
Sam Price <thesamprice@gmail.com>
consensus
Proposed
outcome
proposed
sentiment_score
—
technical_tradeoffs
  • • Improves consistency and determinism of `addr2line` output.
  • • Fixes a bug related to DWARF parsing and tie-breaking.
  • • The chosen tie-breaking mechanism (DIE offset) is stable and reflects the structure of the DWARF information.
series_id
—
series_role
standalone
series_parts
[]
tags
  • • binutils
  • • bfd
  • • dwarf2
  • • addr2line
  • • debugging
bugzilla_url
—
date
2026-09-16T00:00:00.000Z

[PATCH v3] bfd/dwarf2: break equal-range function ties by DIE offset, not pointer

This patch addresses an issue in binutils’ addr2line tool where tie-breaking between functions with identical source code ranges was based on pointer comparison of struct funcinfo. Since these pointers could vary due to memory allocation order, addr2line sometimes reported different inlined functions for the same address. The change proposes using the Debug Information Entry (DIE) offset instead, which is a stable identifier, ensuring consistent reporting of inlined functions.