This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, MIPS] readelf: deal with 64-bit armaps


For Irix 6-style armaps, the fake file name /SYM64/ is not recognized
in readelf as an archive symbol table and you get:

  readelf: Error: s.a: invalid archive string table offset 0

Right now we just skip symbol tables so the patch below adds this name
to the possible symbol table names.

I also added some more comments in bfd that would have helped me while
working on this.

OK to install?

binutils/

	* readelf.c (process_archive): Also skip Irix6-style archive symbol
	tables.

bfd/

	* archive.c (do_slurp_bsd_armap, do_slurp_coff_armap,
	bfd_slurp_armap): Improve function comment.


Index: binutils/readelf.c
===================================================================
RCS file: /cvs/src/src/binutils/readelf.c,v
retrieving revision 1.370
diff -F^\([(a-zA-Z0-9_]\|#define\) -u -p -r1.370 readelf.c
--- binutils/readelf.c	9 Jul 2007 21:19:51 -0000	1.370
+++ binutils/readelf.c	26 Jul 2007 19:47:40 -0000
@@ -9680,7 +9680,8 @@ process_archive (char *file_name, FILE *
       return 1;
     }
 
-  if (const_strneq (arhdr.ar_name, "/               "))
+  if (const_strneq (arhdr.ar_name, "/               ")
+      || const_strneq (arhdr.ar_name, "/SYM64/         "))
     {
       /* This is the archive symbol table.  Skip it.
 	 FIXME: We should have an option to dump it.  */
Index: bfd/archive.c
===================================================================
RCS file: /cvs/src/src/bfd/archive.c,v
retrieving revision 1.50
diff -F^\([(a-zA-Z0-9_]\|#define\) -u -p -r1.50 archive.c
--- bfd/archive.c	3 Jul 2007 14:26:39 -0000	1.50
+++ bfd/archive.c	26 Jul 2007 19:47:40 -0000
@@ -698,7 +698,8 @@ #define BSD_SYMDEF_COUNT_SIZE 4
 /* The size of the string count.  */
 #define BSD_STRING_COUNT_SIZE 4
 
-/* Returns FALSE on error, TRUE otherwise.  */
+/* Read a BSD-style archive symbol table.  Returns FALSE on error,
+   TRUE otherwise.  */
 
 static bfd_boolean
 do_slurp_bsd_armap (bfd *abfd)
@@ -768,7 +769,8 @@ do_slurp_bsd_armap (bfd *abfd)
   return TRUE;
 }
 
-/* Returns FALSE on error, TRUE otherwise.  */
+/* Read a COFF archive symbol table.  Returns FALSE on error, TRUE
+   otherwise.  */
 
 static bfd_boolean
 do_slurp_coff_armap (bfd *abfd)
@@ -895,8 +897,8 @@ release_symdefs:
   return FALSE;
 }
 
-/* This routine can handle either coff-style or bsd-style armaps.
-   Returns FALSE on error, TRUE otherwise */
+/* This routine can handle either coff-style or bsd-style armaps
+   (archive symbol table).  Returns FALSE on error, TRUE otherwise */
 
 bfd_boolean
 bfd_slurp_armap (bfd *abfd)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]