This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: [PATCH] Fix differing debug-range blocks with/out --dwarf-check
- From: "Henderson, Stuart" <Stuart dot Henderson at analog dot com>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Wed, 14 Jan 2015 16:42:29 +0000
- Subject: RE: [PATCH] Fix differing debug-range blocks with/out --dwarf-check
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=pass (sender IP is 137.71.25.55) smtp dot mailfrom=Stuart dot Henderson at analog dot com;
- References: <4A389CBDCB95794CA3A0A09E456CC0052F792E19 at NWD2MBX7 dot ad dot analog dot com>
Ping.
https://sourceware.org/ml/binutils/2015-01/msg00019.html
Cheers,
Stu
-----Original Message-----
From: binutils-owner@sourceware.org [mailto:binutils-owner@sourceware.org] On Behalf Of Henderson, Stuart
Sent: Monday, January 05, 2015 12:40 PM
To: binutils@sourceware.org
Subject: [PATCH] Fix differing debug-range blocks with/out --dwarf-check
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;