binutils: improve holes detection in .debug_loclists.
authorClément Chigot <chigot@adacore.com>
Thu, 1 Dec 2022 08:57:09 +0000 (09:57 +0100)
committerClément Chigot <chigot@adacore.com>
Thu, 1 Dec 2022 14:49:03 +0000 (15:49 +0100)
commitde3b40320c35e2336b68c1e534790c77914b3a99
tree79aed0efa9f44a36d5ac597603fde1b1e2caeb3d
parent6ef35c04dffe685ece08212201c4c032baf8aa86
binutils: improve holes detection in .debug_loclists.

The previous warnings about holes in .debug_loclists sections don't
take into account the headers of each CU and could include the locviews
if they precede the loclist.

The following warning can be triggered between two CU.
    ... <previous CU views> ...
    0000001d <End of list>

    0000002a v000000000000000 v000000000000000 location view pair
    0000002c v000000000000000 v000000000000000 location view pair

readelf: Warning: There is a hole [0x1e - 0x2e] in .debug_loclists section.
    0000002e v000000000000000 v000000000000000 views at 0000002a for:
    ...

But [0x1e - 0x2a] corresponds to the CU header and  [0x2a - 0x2e] are
the locviews.  Thus there is no hole here.

binutils/ChangeLog:

* dwarf.c (display_debug_loc): Adjust holes detections for
headers and locviews.
binutils/dwarf.c