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]

Re: PATCH: PR binutils/13278: --plugin doesn't work on archive


On Tue, Oct 11, 2011 at 12:43:45PM +1030, Alan Modra wrote:
> This looks quite dodgy to me.  Better to fix the problem in
> bfd_generic_archive_p I think.

I guess you're asleep. :)  Like this.

	PR binutils/13278
	* archive.c (bfd_generic_archive_p): Only check first element
	when target_defaulted.
	(_bfd_construct_extended_name_table): Use ar_maxnamelen.
	(_bfd_archive_bsd44_construct_extended_name_table): Likewise.

Index: bfd/archive.c
===================================================================
RCS file: /cvs/src/src/bfd/archive.c,v
retrieving revision 1.78
diff -u -p -r1.78 archive.c
--- bfd/archive.c	11 Oct 2011 06:30:20 -0000	1.78
+++ bfd/archive.c	11 Oct 2011 06:38:12 -0000
@@ -793,7 +793,7 @@ bfd_generic_archive_p (bfd *abfd)
       return NULL;
     }
 
-  if (bfd_has_map (abfd))
+  if (abfd->target_defaulted && bfd_has_map (abfd))
     {
       bfd *first;
 
@@ -1512,7 +1512,7 @@ _bfd_construct_extended_name_table (bfd 
 				    char **tabloc,
 				    bfd_size_type *tablen)
 {
-  unsigned int maxname = abfd->xvec->ar_max_namelen;
+  unsigned int maxname = ar_maxnamelen (abfd);
   bfd_size_type total_namelen = 0;
   bfd *current;
   char *strptr;
@@ -1707,7 +1707,7 @@ _bfd_archive_bsd44_construct_extended_na
                                                   bfd_size_type *tablen,
                                                   const char **name)
 {
-  unsigned int maxname = abfd->xvec->ar_max_namelen;
+  unsigned int maxname = ar_maxnamelen (abfd);
   bfd *current;
 
   *tablen = 0;

-- 
Alan Modra
Australia Development Lab, IBM


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