PR binutils/13278
authorAlan Modra <amodra@gmail.com>
Tue, 11 Oct 2011 06:44:13 +0000 (06:44 +0000)
committerAlan Modra <amodra@gmail.com>
Tue, 11 Oct 2011 06:44:13 +0000 (06:44 +0000)
* 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.

bfd/ChangeLog
bfd/archive.c

index 5a919fb289129eeb9db1c2e0321f9fa234485cbb..e81f23985f108a775d9517d242af66015020a73f 100644 (file)
@@ -1,3 +1,11 @@
+2011-10-11  Alan Modra  <amodra@gmail.com>
+
+       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.
+
 2011-10-11  Alan Modra  <amodra@gmail.com>
 
        PR binutils/13257
index 44ac712388d5a65b176271021df3c63f3be13b86..3e333c7e8949870614233df0ab310760caff1c2f 100644 (file)
@@ -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 *abfd,
                                    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_name_table (bfd *abfd,
                                                   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;