This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Debug information checking
- From: Andrew Stubbs <ams at codesourcery dot com>
- To: binutils at sourceware dot org
- Date: Thu, 12 Mar 2009 10:30:05 +0000
- Subject: Re: [PATCH] Debug information checking
- References: <49B8E2B7.4090306@codesourcery.com>
On 12/03/09 10:23, Andrew Stubbs wrote:
The attached patch ensures that it never misses a broken offset.
>
Anyway, is this patch OK?
It might help to see the diff with white-space changes ignored:
diff -u -p -w -r1.118 dwarf2.c
--- dwarf2.c 30 Jan 2009 01:04:47 -0000 1.118
+++ dwarf2.c 12 Mar 2009 10:28:06 -0000
@@ -417,9 +417,8 @@ read_section (bfd * abfd,
bfd_boolean section_is_compressed = FALSE;
/* read_section is a noop if the section has already been read. */
- if (*section_buffer)
- return TRUE;
-
+ if (!*section_buffer)
+ {
msec = bfd_get_section_by_name (abfd, section_name);
if (! msec && compressed_section_name)
{
@@ -461,6 +460,7 @@ read_section (bfd * abfd,
return FALSE;
}
}
+ }
/* It is possible to get a bad value for the offset into the section
that the client wants. Validate it here to avoid trouble later. */