* archive64.c (bfd_elf64_archive_write_armap): Fix calculation of
authorNick Clifton <nickc@redhat.com>
Mon, 4 Mar 2013 09:21:43 +0000 (09:21 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 4 Mar 2013 09:21:43 +0000 (09:21 +0000)
file pointer offsets for thin archives.

bfd/ChangeLog
bfd/archive64.c

index 93ad3cc789317e7383826d7b07fdcfe76b9c2992..8b949e4de36594cada2c9ae81f0fc4b68ca1c67f 100644 (file)
@@ -1,3 +1,8 @@
+2013-03-04  Nick Clifton  <nickc@redhat.com>
+
+       * archive64.c (bfd_elf64_archive_write_armap): Fix calculation of
+       file pointer offsets for thin archives.
+
 2013-02-28  Nathan Sidwell  <nathan@codesourcery.com>
 
        * elf32-arm.c (elf32_arm_size_dynamic_sections): Don't call
index db4ce2c1257216de3dcdedf5d659e5c6e9041c4c..be64e0d373d82fe351d57c4b4d96dda1940448d3 100644 (file)
@@ -1,6 +1,5 @@
-/* MIPS-specific support for 64-bit ELF
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007,
-   2010, 2012  Free Software Foundation, Inc.
+/* Support for 64-bit ELF archives.
+   Copyright 1996-2013 Free Software Foundation, Inc.
    Ian Lance Taylor, Cygnus Support
    Linker support added by Mark Mitchell, CodeSourcery, LLC.
    <mark@codesourcery.com>
@@ -200,7 +199,7 @@ bfd_elf64_archive_write_armap (bfd *arch,
        current = current->archive_next)
     {
       /* For each symbol which is used defined in this object, write out
-        the object file's address in the archive */
+        the object file's address in the archive */
 
       for (;
           count < symbol_count && map[count].u.abfd == current;
@@ -210,9 +209,11 @@ bfd_elf64_archive_write_armap (bfd *arch,
          if (bfd_bwrite (buf, 8, arch) != 8)
            return FALSE;
        }
+
       /* Add size of this archive entry */
-      archive_member_file_ptr += (arelt_size (current)
-                                 + sizeof (struct ar_hdr));
+      archive_member_file_ptr += sizeof (struct ar_hdr);
+      if (! bfd_is_thin_archive (arch))
+       archive_member_file_ptr += arelt_size (current);
       /* remember about the even alignment */
       archive_member_file_ptr += archive_member_file_ptr % 2;
     }