diff options
author | Nick Clifton <nickc@redhat.com> | 2003-07-04 10:42:26 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2003-07-04 10:42:26 +0000 |
commit | 96c223ce90d6bbaed5faac223eb8c494dc43b5a3 (patch) | |
tree | b41b5e4402a1fc627983a4638b3b59034f05fddb /binutils/readelf.c | |
parent | 8c17da6e594c61837ef20620791a2e55d323d3d2 (diff) | |
download | gdb-96c223ce90d6bbaed5faac223eb8c494dc43b5a3.zip gdb-96c223ce90d6bbaed5faac223eb8c494dc43b5a3.tar.gz gdb-96c223ce90d6bbaed5faac223eb8c494dc43b5a3.tar.bz2 |
* 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.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r-- | binutils/readelf.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c index f032cbe..5780bfa 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -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; } |