2001-03-20 Michael Chastain <chastain@redhat.com>
[deliverable/binutils-gdb.git] / bfd / coff-rs6000.c
index 86986a504b71fb9dd3d360709d8a6984ed61953b..ed47000e18442bd709be15e4ef3fba05f1368f2a 100644 (file)
@@ -1,5 +1,6 @@
 /* BFD back-end for IBM RS/6000 "XCOFF" files.
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+   2000, 2001
    Free Software Foundation, Inc.
    FIXME: Can someone provide a transliteration of this name into ASCII?
    Using the following chars caused a compiler warning on HIUX (so I replaced
@@ -130,7 +131,6 @@ _bfd_xcoff_is_local_label_name (abfd, name)
   return false;
 }
 \f
-
 void
 _bfd_xcoff_swap_sym_in (abfd, ext1, in1)
      bfd            *abfd;
@@ -140,7 +140,7 @@ _bfd_xcoff_swap_sym_in (abfd, ext1, in1)
   SYMENT *ext = (SYMENT *)ext1;
   struct internal_syment      *in = (struct internal_syment *)in1;
 
-  if(ext->e.e_name[0] != 0)
+  if (ext->e.e_name[0] != 0)
     {
       memcpy(in->_n._n_name, ext->e.e_name, SYMNMLEN);
     }
@@ -167,7 +167,7 @@ _bfd_xcoff_swap_sym_out (abfd, inp, extp)
   struct internal_syment *in = (struct internal_syment *)inp;
   SYMENT *ext =(SYMENT *)extp;
 
-  if(in->_n._n_name[0] != 0)
+  if (in->_n._n_name[0] != 0)
     {
       memcpy(ext->e.e_name, in->_n._n_name, SYMNMLEN);
     }
@@ -402,7 +402,6 @@ _bfd_xcoff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
 end:
   return bfd_coff_auxesz (abfd);
 }
-
 \f
 /* The XCOFF reloc table.  Actually, XCOFF relocations specify the
    bitsize and whether they are signed or not, along with a
@@ -872,7 +871,6 @@ _bfd_xcoff_reloc_type_lookup (abfd, code)
       return NULL;
     }
 }
-
 \f
 /* XCOFF archive support.  The original version of this code was by
    Damon A. Permezel.  It was enhanced to permit cross support, and
@@ -1542,7 +1540,6 @@ normalize_filename (abfd)
 
 /* Write out an XCOFF armap.  */
 
-/*ARGSUSED*/
 static boolean
 xcoff_write_armap_old (abfd, elength, map, orl_count, stridx)
      bfd *abfd;
@@ -1644,9 +1641,9 @@ xcoff_write_one_armap_big (abfd, map, orl_count, orl_ccount, stridx, bits64,
   struct xcoff_ar_hdr_big hdr;
   char *p;
   unsigned char buf[4];
+  const bfd_arch_info_type *arch_info = NULL;
   bfd *sub;
   file_ptr fileoff;
-  const bfd_arch_info_type *arch_info;
   bfd *object_bfd;
   unsigned int i;
 
@@ -1658,7 +1655,7 @@ xcoff_write_one_armap_big (abfd, map, orl_count, orl_ccount, stridx, bits64,
   if (bits64)
     sprintf (hdr.nextoff, "%d", 0);
   else
-    sprintf (hdr.nextoff, "%d", (strtol (prevoff, (char **) NULL, 10)
+    sprintf (hdr.nextoff, "%ld", (strtol (prevoff, (char **) NULL, 10)
                                 + 4 + orl_ccount * 4 + stridx));
   memcpy (hdr.prevoff, prevoff, sizeof (hdr.prevoff));
   sprintf (hdr.date, "%d", 0);
@@ -1720,7 +1717,8 @@ xcoff_write_one_armap_big (abfd, map, orl_count, orl_ccount, stridx, bits64,
 
       if (ob != object_bfd)
        arch_info = bfd_get_arch_info (ob);
-      if ((arch_info->bits_per_address == 64) != bits64)
+
+      if (arch_info && (arch_info->bits_per_address == 64) != bits64)
        continue;
 
       name = *map[i].name;
@@ -1741,7 +1739,6 @@ xcoff_write_one_armap_big (abfd, map, orl_count, orl_ccount, stridx, bits64,
   return true;
 }
 
-/*ARGSUSED*/
 static boolean
 xcoff_write_armap_big (abfd, elength, map, orl_count, stridx)
      bfd *abfd;
@@ -1753,7 +1750,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx)
   unsigned int i;
   unsigned int orl_count_32, orl_count_64;
   unsigned int stridx_32, stridx_64;
-  const bfd_arch_info_type *arch_info;
+  const bfd_arch_info_type *arch_info = NULL;
   bfd *object_bfd;
 
   /* First, we look through the symbols and work out which are
@@ -1770,7 +1767,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx)
       if (ob != object_bfd)
        arch_info = bfd_get_arch_info (ob);
       len = strlen (*map[i].name) + 1;
-      if (arch_info->bits_per_address == 64)
+      if (arch_info && arch_info->bits_per_address == 64)
        {
          orl_count_64++;
          stridx_64 += len;
@@ -1801,7 +1798,6 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx)
   return true;
 }
 
-/*ARGSUSED*/
 boolean
 _bfd_xcoff_write_armap (abfd, elength, map, orl_count, stridx)
      bfd *abfd;
@@ -2345,7 +2341,6 @@ _bfd_xcoff_write_archive_contents (abfd)
 /* We can't use the usual coff_sizeof_headers routine, because AIX
    always uses an a.out header.  */
 
-/*ARGSUSED*/
 int
 _bfd_xcoff_sizeof_headers (abfd, reloc)
      bfd *abfd;
@@ -2361,5 +2356,3 @@ _bfd_xcoff_sizeof_headers (abfd, reloc)
   size += abfd->section_count * SCNHSZ;
   return size;
 }
-\f
-
This page took 0.026029 seconds and 4 git commands to generate.