2001-08-10 H.J. Lu <hjl@gnu.org>
[deliverable/binutils-gdb.git] / bfd / archive.c
index c1a6f81222a1859eaf2afa7f7c257b908fc5f1b7..0a6f0236eeb94f04df7818acfd52c9462bd7a12e 100644 (file)
@@ -1,5 +1,6 @@
 /* BFD back-end for archive files (libraries).
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
+   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+   2000
    Free Software Foundation, Inc.
    Written by Cygnus Support.  Mostly Gumby Henkel-Wallace's fault.
 
@@ -162,7 +163,7 @@ struct ar_cache {
 #define ar_padchar(abfd) ((abfd)->xvec->ar_pad_char)
 #define ar_maxnamelen(abfd) ((abfd)->xvec->ar_max_namelen)
 
-#define arch_eltdata(bfd) ((struct areltdata *)((bfd)->arelt_data))
+#define arch_eltdata(bfd) ((struct areltdata *) ((bfd)->arelt_data))
 #define arch_hdr(bfd) ((struct ar_hdr *)arch_eltdata(bfd)->arch_header)
 
 static char *get_extended_arelt_filename PARAMS ((bfd *arch,
@@ -895,7 +896,7 @@ do_slurp_coff_armap (abfd)
            && tmp->arch_header[1] == ' ')
          {
            ardata->first_file_filepos +=
-             (tmp->parsed_size + sizeof(struct ar_hdr) + 1) & ~1;
+             (tmp->parsed_size + sizeof (struct ar_hdr) + 1) & ~1;
          }
        bfd_release (abfd, tmp);
       }
@@ -2198,7 +2199,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++;
This page took 0.023219 seconds and 4 git commands to generate.