2011-06-09 Tristan Gingold <gingold@adacore.com>
authorTristan Gingold <gingold@adacore.com>
Thu, 9 Jun 2011 15:29:05 +0000 (15:29 +0000)
committerTristan Gingold <gingold@adacore.com>
Thu, 9 Jun 2011 15:29:05 +0000 (15:29 +0000)
* od-xcoff.c (xcoff32_read_symbols): Allow missing string table
length.

binutils/ChangeLog
binutils/od-xcoff.c

index 0de33e513b7b74ae786fdb68377d45f5a06262fe..918c7e1def26d7a152e09523d7df823aa53890d7 100644 (file)
@@ -1,3 +1,8 @@
+2011-06-09  Tristan Gingold  <gingold@adacore.com>
+
+       * od-xcoff.c (xcoff32_read_symbols): Allow missing string table
+       length.
+
 2011-06-08  Nick Clifton  <nickc@redhat.com>
 
        PR binutils/12855
index 47d0248847b2edd5635c932dacd4839cdff23a3b..5b8b5896eb59ae0daf5c65683e5391cffea22ed3 100644 (file)
@@ -639,17 +639,14 @@ xcoff32_read_symbols (bfd *abfd, struct xcoff_dump *data)
     + data->nsyms * (unsigned)sizeof (struct external_syment);
 
   /* Read string table.  */
-  if (bfd_seek (abfd, stptr, SEEK_SET) != 0)
+  if (bfd_seek (abfd, stptr, SEEK_SET) != 0
+      || bfd_bread (&stsz_arr, sizeof (stsz_arr), abfd) != sizeof (stsz_arr))
     {
+      non_fatal (_("cannot read strings table length"));
       data->strings_size = 0;
     }
   else
     {
-      if (bfd_bread (&stsz_arr, sizeof (stsz_arr), abfd) != sizeof (stsz_arr))
-        {
-          non_fatal (_("cannot read strings table len"));
-          return;
-        }
       data->strings_size = bfd_h_get_32 (abfd, stsz_arr);
       if (data->strings_size > sizeof (stsz_arr))
         {