summaryrefslogtreecommitdiff
path: root/binutils/readelf.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2012-07-17 16:29:35 +0000
committerNick Clifton <nickc@redhat.com>2012-07-17 16:29:35 +0000
commit35331973229e9efa4c14245eab3e71e268c4a210 (patch)
tree58e0f8287d7213c4112aabd99b539026989574e6 /binutils/readelf.c
parentf7adb8cc5255c75a39a48a3986048f4fae9aeb15 (diff)
downloadbinutils-redhat-35331973229e9efa4c14245eab3e71e268c4a210.tar.gz
* 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 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)
{