binutils Newspaper
JULY 29, 2026
firmware Proposed

readelf: attach location views to DW_LLE_startx_endx/startx_length loclists

Fixes readelf to correctly display location views for indexed bounded loclist entries.

This patch addresses an issue in readelf where location views associated with indexed bounded location list entries (DW_LLE_startx_endx and DW_LLE_startx_length) were not being displayed. The display_loclists_list function decodes the range for these entries but fails to consume the corresponding view pair, causing vstart to lag and resulting in a spurious ‘Hole and overlap detection’ warning. By including these two indexed forms in the processing logic, the patch ensures that their view pairs are consumed and printed, resolving the warning and improving debug information display.

In Details

The readelf utility's display_loclists_list function previously only processed GNU location-view pairs for simpler bounded location list entries (DW_LLE_offset_pair, DW_LLE_start_end, DW_LLE_start_length). This commit extends that processing to the indexed bounded forms (DW_LLE_startx_endx, DW_LLE_startx_length). Without this change, readelf would incorrectly report adjacency issues when debugging DWARF 5 objects that use these newer location list entry types, because the location view associated with the indexed range was not consumed, causing the internal vstart pointer to…

For Context
readelf
A utility that displays information about ELF files, including DWARF debugging information.
DWARF
A debugging data format used by many compilers to store information about variables, types, and code structure.
location list
A DWARF structure that specifies the memory address ranges where a variable or expression is valid.
DW_LLE_startx_endx
A DWARF location list entry type indicating a range defined by an index and an end offset.
DW_LLE_startx_length
A DWARF location list entry type indicating a range defined by an index and a length.
DW_AT_GNU_locviews
A GNU-specific DWARF attribute that provides a mapping between location list entries and their corresponding views.
loclists
Abbreviation for location lists, used in DWARF debugging information.
Filed Under: readelfdwarfdebuggingbugfixloclists