aboutsummaryrefslogtreecommitdiff
path: root/binutils/readelf.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2012-07-17 16:29:36 +0000
committerNick Clifton <nickc@redhat.com>2012-07-17 16:29:36 +0000
commitc2a7d3f57d9b69909262d5c36fd500b94c84542f (patch)
tree7f2fef1bb415096821123c111905209b703fe9ca /binutils/readelf.c
parent2e84b6bfc2f02b1f7f9274d897d62d93faffd483 (diff)
downloadgdb-c2a7d3f57d9b69909262d5c36fd500b94c84542f.zip
gdb-c2a7d3f57d9b69909262d5c36fd500b94c84542f.tar.gz
gdb-c2a7d3f57d9b69909262d5c36fd500b94c84542f.tar.bz2
* elfcomm.c (setup_archive): Extract index table and symbol table
scanning code into... (process_archive_index_and_symbols): ... this function and add support for 64-bit index tables. * elfcomm.h (struct archive_info): Change type of index_num and index_array to elf_vma. Add 'uses_64bit_indicies' field. * readelf.c (process_archive): Fix support for 64-bit indicies.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r--binutils/readelf.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 2fcd582..e6f2be6 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -13442,7 +13442,7 @@ process_archive (char * file_name, FILE * file, bfd_boolean is_thin_archive)
unsigned long current_pos;
printf (_("Index of archive %s: (%ld entries, 0x%lx bytes in the symbol table)\n"),
- file_name, arch.index_num, arch.sym_size);
+ file_name, (long) arch.index_num, arch.sym_size);
current_pos = ftell (file);
for (i = l = 0; i < arch.index_num; i++)
@@ -13459,8 +13459,9 @@ process_archive (char * file_name, FILE * file, bfd_boolean is_thin_archive)
if (qualified_name != NULL)
{
- printf (_("Binary %s at offset 0x%lx contains:\n"),
- qualified_name, arch.index_array[i]);
+ printf (_("Contents of binary %s at offset "), qualified_name);
+ (void) print_vma (arch.index_array[i], PREFIX_HEX);
+ putchar ('\n');
free (qualified_name);
}
}
@@ -13476,11 +13477,14 @@ process_archive (char * file_name, FILE * file, bfd_boolean is_thin_archive)
l += strlen (arch.sym_table + l) + 1;
}
- if (l & 01)
- ++l;
+ if (arch.uses_64bit_indicies)
+ l = (l + 7) & ~ 7;
+ else
+ l += l & 1;
+
if (l < arch.sym_size)
- error (_("%s: symbols remain in the index symbol table, but without corresponding entries in the index table\n"),
- file_name);
+ error (_("%s: %ld bytes remain in the symbol table, but without corresponding entries in the index table\n"),
+ file_name, arch.sym_size - l);
if (fseek (file, current_pos, SEEK_SET) != 0)
{