* archive.c (coff_write_armap): Don't write more than symbol_count
authorAlexandre Oliva <aoliva@redhat.com>
Mon, 25 Dec 2000 21:41:20 +0000 (21:41 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Mon, 25 Dec 2000 21:41:20 +0000 (21:41 +0000)
`archive_member_file_ptr's.

bfd/ChangeLog
bfd/archive.c

index bc44020f47cdf5483eda865101f7a3e55f5a3f70..9c1f097cc1ac11ea1e45e5b4324b5113165f55f7 100644 (file)
@@ -1,3 +1,8 @@
+2000-12-25  Alexandre Oliva  <aoliva@redhat.com>
+
+       * archive.c (coff_write_armap): Don't write more than symbol_count
+       `archive_member_file_ptr's.
+
 2000-12-25  Kazu Hirata  <kazu@hxi.com>
 
        * vms-tir.c: Fix formatting.
index 1321073f4827fc45a75657b260d8bebb9cd4d55d..14dc77007291cd29507c20e865e42eadf841fe11 100644 (file)
@@ -2198,7 +2198,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx)
       /* For each symbol which is used defined in this object, write
         out the object file's address in the archive.  */
 
-      while (((bfd *) (map[count]).pos) == current)
+      while (count < symbol_count && ((bfd *) (map[count]).pos) == current)
        {
          bfd_write_bigendian_4byte_int (arch, archive_member_file_ptr);
          count++;