From 35331973229e9efa4c14245eab3e71e268c4a210 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 17 Jul 2012 16:29:35 +0000 Subject: * 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. --- binutils/readelf.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'binutils/readelf.c') diff --git a/binutils/readelf.c b/binutils/readelf.c index 2fcd5827d6..e6f2be6b0d 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) { -- cgit v1.2.1