]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* readelf.c (get_data): Print (unsigned) hex values for size and offset in
authorNick Clifton <nickc@redhat.com>
Fri, 4 Jul 2003 10:42:26 +0000 (10:42 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 4 Jul 2003 10:42:26 +0000 (10:42 +0000)
  error messages.
  (process_section_headers): If the string table could not be allocated, do
  not continue.

binutils/ChangeLog
binutils/readelf.c

index 4e8d9280950cdc04edc6349dadb59aa288bdb266..897cc66b4ca13f31263259285789d93f267602b0 100644 (file)
@@ -1,3 +1,10 @@
+2003-07-04  Nick Clifton  <nickc@redhat.com>
+
+       * readelf.c (get_data): Print (unsigned) hex values for size and
+       offset in error messages.
+       (process_section_headers): If the string table could not be
+       allocated, do not continue.
+
 2003-07-01  Jakub Jelinek  <jakub@redhat.com>
 
        * readelf.c (dynamic_segment_ia64_val): Print address and newline
index f032cbe118945ae6b1a3e05310ac17fc21183a57..5780bfae1f705ba07c55e08fe18ef21082960b14 100644 (file)
@@ -485,7 +485,7 @@ get_data (var, file, offset, size, reason)
 
   if (fseek (file, offset, SEEK_SET))
     {
-      error (_("Unable to seek to %x for %s\n"), offset, reason);
+      error (_("Unable to seek to 0x%x for %s\n"), offset, reason);
       return NULL;
     }
 
@@ -496,7 +496,7 @@ get_data (var, file, offset, size, reason)
 
       if (mvar == NULL)
        {
-         error (_("Out of memory allocating %d bytes for %s\n"),
+         error (_("Out of memory allocating 0x%x bytes for %s\n"),
                 size, reason);
          return NULL;
        }
@@ -504,7 +504,7 @@ get_data (var, file, offset, size, reason)
 
   if (fread (mvar, size, 1, file) != 1)
     {
-      error (_("Unable to read in %d bytes of %s\n"), size, reason);
+      error (_("Unable to read in 0x%x bytes of %s\n"), size, reason);
       if (mvar != var)
        free (mvar);
       return NULL;
@@ -3767,6 +3767,9 @@ process_section_headers (file)
       string_table = (char *) get_data (NULL, file, section->sh_offset,
                                        section->sh_size, _("string table"));
 
+      if (string_table == NULL)
+       return 0;
+      
       string_table_length = section->sh_size;
     }