binutils Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
bfd/dwarf2

bfd/dwarf2: break equal-range function ties by DIE offset

Improves addr2line's accuracy by using DIE offset to break ties in function ranges.

This commit modifies how addr2line breaks ties when multiple functions have the same source code range. Previously, it used the memory address of the function’s struct funcinfo, which could vary due to allocator behavior. Now, it uses the DIE offset, which is stable and deterministically indicates the innermost function, resolving inconsistencies in addr2line output for inlined subroutines.

In Details

Modifies lookup_address_in_function_table in bfd/dwarf2.c to break ties between functions with identical source ranges by comparing DIE offsets instead of struct funcinfo pointers. This resolves non-deterministic reporting of inlined functions by addr2line -f -i by using a stable tie-breaker that reflects source-level nesting (innermost first) rather than heap allocation order.

For Context
addr2line
A command-line utility that translates object code addresses into line numbers and function names, useful for debugging.
DIE
Debug Information Entry. A fundamental unit within DWARF debugging information, representing a specific entity like a function, variable, or type.
DW_TAG_inlined_subroutine
A DWARF tag indicating that a debugging information entry represents an inlined function call within another function.
DW_TAG_subprogram
A DWARF tag indicating that a debugging information entry represents a function or subroutine.
DWARF
A standardized debugging data format used by many compilers and debuggers, providing information about program structure, types, and variables.
funcinfo
A structure, likely internal to BFD, that holds information about a function, possibly including its address range and name, used for symbol lookup.
Filed Under: binutilsdwarfaddr2linedebugging