From: Alan Modra Date: Sun, 17 Oct 2021 07:04:46 +0000 (+1030) Subject: PR28459, readelf issues bogus warning X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e7f024765a48fba4452535a5fc006a7e858730fd;p=binutils-gdb.git PR28459, readelf issues bogus warning I'd missed the fact that the .debug_rnglists dump doesn't exactly display the contents of the section. Instead readelf rummages through .debug_info looking for DW_AT_ranges entries, then displays the entries in .debug_rnglists pointed at, sorted. A simpler dump of the actual section contents might be more useful and robust, but it was likely done that way to detect overlap and holes. Anyway, the headers in .debug_rnglists besides the first are ignored, and limiting to the unit length of the first header fails if there is more than one unit. PR 28459 * dwarf.c (display_debug_ranges): Don't constrain data to length in header. --- diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 6e10281a6ed..d42dc64b397 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -7730,7 +7730,6 @@ display_debug_ranges (struct dwarf_section *section, return 0; } } - finish = start + initial_length; /* Get and check the version number. */ SAFE_BYTE_GET_AND_INC (version, start, 2, finish);