1 |
From 61b08178e4cafca911bf909f54f8c373f16f0a70 Mon Sep 17 00:00:00 2001 |
2 |
From: Alan Modra <amodra@gmail.com> |
3 |
Date: Sun, 17 Oct 2021 17:34:46 +1030 |
4 |
Subject: [PATCH] PR28459, readelf issues bogus warning |
5 |
|
6 |
I'd missed the fact that the .debug_rnglists dump doesn't exactly |
7 |
display the contents of the section. Instead readelf rummages through |
8 |
.debug_info looking for DW_AT_ranges entries, then displays the |
9 |
entries in .debug_rnglists pointed at, sorted. A simpler dump of the |
10 |
actual section contents might be more useful and robust, but it was |
11 |
likely done that way to detect overlap and holes. |
12 |
|
13 |
Anyway, the headers in .debug_rnglists besides the first are ignored, |
14 |
and limiting to the unit length of the first header fails if there is |
15 |
more than one unit. |
16 |
|
17 |
PR 28459 |
18 |
* dwarf.c (display_debug_ranges): Don't constrain data to length |
19 |
in header. |
20 |
|
21 |
(cherry picked from commit e7f024765a48fba4452535a5fc006a7e858730fd) |
22 |
--- |
23 |
binutils/dwarf.c | 1 - |
24 |
1 file changed, 1 deletion(-) |
25 |
|
26 |
diff --git a/binutils/dwarf.c b/binutils/dwarf.c |
27 |
index 1e7f4db7b7c..e73078f496f 100644 |
28 |
--- a/binutils/dwarf.c |
29 |
+++ b/binutils/dwarf.c |
30 |
@@ -7727,7 +7727,6 @@ display_debug_ranges (struct dwarf_section *section, |
31 |
return 0; |
32 |
} |
33 |
} |
34 |
- finish = start + initial_length; |
35 |
|
36 |
/* Get and check the version number. */ |
37 |
SAFE_BYTE_GET_AND_INC (version, start, 2, finish); |
38 |
-- |
39 |
2.33.1 |
40 |
|