[PATCH v4] dwarf: Dump .debug_loclists only for DWARF-5

H.J. Lu hjl.tools@gmail.com
Mon Apr 28 21:11:30 GMT 2025


I regenerated assembly tests by passing -dA to GCC for DWARF debug info.

.debug_loclists section is loaded into debug_information as DWARF-5 debug
info and .debug_loc section is loaded into debug_information as pre-DWARF-5
debug info.  When dumping .debug_loc section, we should only process
pre-DWARF-5 debug info in debug_information.  When dumping .debug_loclists
section, we should only process DWARF-5 info in debug_information.

binutils/

PR binutils/32809
* dwarf.c (display_debug_loc): Dump .debug_loclists only for
DWARF-5.

ld/

PR binutils/32809
* testsuite/ld-x86-64/dwarf4.s: New file.
* testsuite/ld-x86-64/dwarf5a.s: Likewise.
* testsuite/ld-x86-64/dwarf5b.s: Likewise.
* testsuite/ld-x86-64/pr32809.d: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run pr32809.


-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v4-0001-dwarf-Dump-.debug_loclists-only-for-DWARF-5.patch
Type: text/x-patch
Size: 40819 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20250429/9e9a5f93/attachment-0001.bin>


More information about the Binutils mailing list