public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH, MIPS] readelf: deal with 64-bit armaps
@ 2007-07-26 21:20 Adam Nemet
  2007-07-27  0:27 ` Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: Adam Nemet @ 2007-07-26 21:20 UTC (permalink / raw)
  To: binutils

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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH, MIPS] readelf: deal with 64-bit armaps
  2007-07-26 21:20 [PATCH, MIPS] readelf: deal with 64-bit armaps Adam Nemet
@ 2007-07-27  0:27 ` Alan Modra
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2007-07-27  0:27 UTC (permalink / raw)
  To: Adam Nemet; +Cc: binutils

On Thu, Jul 26, 2007 at 01:01:29PM -0700, Adam Nemet wrote:
> 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.

OK.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-07-27  0:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-26 21:20 [PATCH, MIPS] readelf: deal with 64-bit armaps Adam Nemet
2007-07-27  0:27 ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).