[PATCH] Fix differing debug-range blocks with/out --dwarf-check
Henderson, Stuart
Stuart.Henderson@analog.com
Mon Jan 5 12:41:00 GMT 2015
Hello,
A while back a change was made to not report .debug_ranges blocks, that are referenced twice in .debug_info, as overlaps when we're doing --dwarf-check. A side-effect of this is that we now show the doubly referenced block once with --dwarf-check and twice without.
e.g. objdump --dwarf=Ranges without --dwarf-check:
...
000000e8 c100c650 c100c652*
000000e8 c100c654 c100c658*
000000e8 <End of list>
00000100 c100c6a6 c100c748*
00000100 c100c750 c100c76a*
00000100 c100c772 c100c7fe*
00000100 c100c806 c100c80a*
00000100 c100c812 c100c8aa*
00000100 c100c8b2 c100c988*
00000100 <End of list>
00000100 c100c6a6 c100c748*
00000100 c100c750 c100c76a*
00000100 c100c772 c100c7fe*
00000100 c100c806 c100c80a*
00000100 c100c812 c100c8aa*
00000100 c100c8b2 c100c988*
00000100 <End of list>
00000138 c100c6d0 c100c748*
00000138 c100c942 c100c94a*
...
objdump --dwarf=Ranges with --dwarf-check:
...
000000e8 c100c650 c100c652*
000000e8 c100c654 c100c658*
000000e8 <End of list>
00000100 c100c6a6 c100c748*
00000100 c100c750 c100c76a*
00000100 c100c772 c100c7fe*
00000100 c100c806 c100c80a*
00000100 c100c812 c100c8aa*
00000100 c100c8b2 c100c988*
00000100 <End of list>
00000138 c100c6d0 c100c748*
00000138 c100c942 c100c94a*
00000138 <End of list>
...
For the sake of consistency, I suggest we always do the latter:
2015-01-05 Stuart Henderson <shenders@gcc.gnu.org>
* dwarf.c (display_debug_ranges): Don't report the same .debug_ranges
block twice.
Stu
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 3d3f4cc..ec4cd4b 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -5066,9 +5066,9 @@ display_debug_ranges (struct dwarf_section *section,
continue;
}
- if (dwarf_check != 0 && i > 0)
+ if (i > 0)
{
- if (start < next)
+ if (start < next && dwarf_check != 0)
warn (_("There is a hole [0x%lx - 0x%lx] in %s section.\n"),
(unsigned long) (start - section_begin),
(unsigned long) (next - section_begin), section->name);
@@ -5076,9 +5076,10 @@ display_debug_ranges (struct dwarf_section *section,
{
if (next == last_start)
continue;
- warn (_("There is an overlap [0x%lx - 0x%lx] in %s section.\n"),
- (unsigned long) (start - section_begin),
- (unsigned long) (next - section_begin), section->name);
+ if (dwarf_check != 0)
+ warn (_("There is an overlap [0x%lx - 0x%lx] in %s section.\n"),
+ (unsigned long) (start - section_begin),
+ (unsigned long) (next - section_begin), section->name);
}
}
start = next;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: upstream.patch
Type: application/octet-stream
Size: 1075 bytes
Desc: upstream.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20150105/58d2c8e8/attachment.obj>
More information about the Binutils
mailing list