This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Debug information checking


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.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]