binutils Newspaper
NOVEMBER 30, 2026
bfd — Proposed

bfd: Fix addr2line for skipped DW_FORM_ref_addr CUs and DWARF5 one-file line tables

Patch fixes addr2line to correctly handle DWARF debugging information from clang LTO objects and DWARF5 line tables.

This patch addresses two issues in binutils’ addr2line tool when processing DWARF debugging information. First, it fixes an issue where addr2line might miss compilation units in clang LTO objects due to DW_FORM_ref_addr causing premature parsing. The fix queues these units for later searching. Second, it corrects handling of DWARF5 one-file line tables, ensuring correct file index reporting when the table only contains file 0. The proposed changes improve accuracy for clang LTO and DWARF5 outputs.

In the Thread 1 participant
  1. Kumar N, Bhuvanendra <Bhuvanendra.KumarN@amd.com> proposer

    Submits a patch to addr2line to fix issues with DWARF debugging information from clang LTO objects and DWARF5 line tables.

In Details

The addr2line utility in binutils is failing to correctly map addresses to source code lines for certain DWARF debugging information. The first issue involves compilation units (CUs) in clang LTO (Link Time Optimization) objects where DW_FORM_ref_addr entries cause stash_comp_unit to parse ahead. This can lead to subsequent CUs being skipped by the sequential reader. The fix queues these skipped CUs in unsearched_units for later processing. The second issue relates to DWARF5 one-file line tables where the line number state machine incorrectly starts at file index 1, causing a 'bad fil…

For Context
addr2line
A command-line utility that translates object code addresses into line number and function name information.
bfd
The Binary File Descriptor library, used by binutils to handle various object file formats.
DWARF
A debugging data format used by many compilers and debuggers to represent information about source code, variables, and types.
DW_FORM_ref_addr
A DWARF attribute form indicating a reference to a debugging information entry using an address.
CU
Compilation Unit. A single translation unit (source file) compiled into an object file, described by a distinct DWARF debugging information entry.
LTO
Link Time Optimization. A compiler optimization technique where optimization is performed across multiple translation units during the linking phase.
DWARF5
The fifth version of the DWARF debugging data format specification.
line tables
A part of DWARF debugging information that maps addresses within the executable code back to source file names and line numbers.
Filed Under: binutilsdebuggerDWARFLTOclang