]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
dwarf: Properly check holes in .debug_ranges/debug_rnglists
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 30 Apr 2025 00:37:08 +0000 (08:37 +0800)
committerAlan Modra <amodra@gmail.com>
Thu, 1 May 2025 04:22:15 +0000 (13:52 +0930)
commitf72c4fa3d53b06992259293377ce17dad05c8701
tree218b3c199a520eaff32f90c0d8eeb20ac63d7d57
parent4aa66c7645e4d6fba129f44e85d1036344b365e0
dwarf: Properly check holes in .debug_ranges/debug_rnglists

Don't warn if the offset of the first entry in .debug_rnglists starts
right after the header.  Warn holes in .debug_ranges and debug_rnglists
sections only if the last end pointer isn't the same as the current
start pointer.

PR binutils/32927
* dwarf.c (display_debug_ranges_list): Return the pointer to the
end.
(display_debug_ranges): Don't warn if the offset of the first
entry in .debug_rnglists starts right after the header.  Warn a
hole only if the last end pointer is the same as the next pointer.
* testsuite/binutils-all/x86-64/dwarf4.s: New file.
* testsuite/binutils-all/x86-64/dwarf5.s: Likewise.
* testsuite/binutils-all/x86-64/pr32927-1.d: Likewise.
* testsuite/binutils-all/x86-64/pr32927-2.d: Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Co-Authored-By: Alan Modra <amodra@gmail.com>
binutils/dwarf.c
binutils/testsuite/binutils-all/x86-64/dwarf4.s [new file with mode: 0644]
binutils/testsuite/binutils-all/x86-64/dwarf5.s [new file with mode: 0644]
binutils/testsuite/binutils-all/x86-64/pr32927-1.d [new file with mode: 0644]
binutils/testsuite/binutils-all/x86-64/pr32927-2.d [new file with mode: 0644]