This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
overlap in .debug_ranges section?
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Thu, 17 May 2012 17:43:21 +0930
- Subject: overlap in .debug_ranges section?
It isn't really an overlap when .debug_info references the same
.debug_ranges block more than once.
* dwarf.c (display_debug_ranges): Don't report more than one use
of the same range set as an overlap.
Index: binutils/dwarf.c
===================================================================
RCS file: /cvs/src/src/binutils/dwarf.c,v
retrieving revision 1.113
diff -u -p -r1.113 dwarf.c
--- binutils/dwarf.c 14 May 2012 19:45:21 -0000 1.113
+++ binutils/dwarf.c 17 May 2012 03:11:04 -0000
@@ -4419,6 +4422,7 @@ display_debug_ranges (struct dwarf_secti
void *file ATTRIBUTE_UNUSED)
{
unsigned char *start = section->start;
+ unsigned char *last_start = start;
unsigned long bytes;
unsigned char *section_begin = start;
unsigned int num_range_list, i;
@@ -4502,11 +4506,16 @@ display_debug_ranges (struct dwarf_secti
(unsigned long) (start - section_begin),
(unsigned long) (next - section_begin), section->name);
else if (start > next)
- 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 (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);
+ }
}
start = next;
+ last_start = next;
while (1)
{
--
Alan Modra
Australia Development Lab, IBM