Use __asm__ rather than asm in gold testsuite
[deliverable/binutils-gdb.git] / bfd / coffswap.h
index 5f23ecc07b301a0258691c9e57aebd8e91aa53b1..f75001e0d26b33820df4306f4f5921a62746abfc 100644 (file)
@@ -1,14 +1,12 @@
 /* Generic COFF swapping routines, for BFD.
 /* Generic COFF swapping routines, for BFD.
-   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000,
-   2001, 2002
-   Free Software Foundation, Inc.
+   Copyright (C) 1990-2020 Free Software Foundation, Inc.
    Written by Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    Written by Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -18,7 +16,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
 
 /* This file contains routines used to swap COFF data.  It is a header
    file because the details of swapping depend on the details of the
 
 /* This file contains routines used to swap COFF data.  It is a header
    file because the details of swapping depend on the details of the
 #define PUT_RELOC_VADDR H_PUT_32
 #endif
 
 #define PUT_RELOC_VADDR H_PUT_32
 #endif
 
-static void coff_swap_aouthdr_in PARAMS ((bfd *, PTR, PTR));
-static unsigned int coff_swap_aouthdr_out PARAMS ((bfd *, PTR, PTR));
-static void coff_swap_scnhdr_in PARAMS ((bfd *, PTR, PTR));
-static unsigned int coff_swap_scnhdr_out PARAMS ((bfd *, PTR, PTR));
-static void coff_swap_filehdr_in PARAMS ((bfd *, PTR, PTR));
-static unsigned int coff_swap_filehdr_out PARAMS ((bfd *, PTR, PTR));
-#ifndef NO_COFF_RELOCS
-static void coff_swap_reloc_in PARAMS ((bfd *, PTR, PTR));
-static unsigned int coff_swap_reloc_out PARAMS ((bfd *, PTR, PTR));
-#endif /* NO_COFF_RELOCS */
-#ifndef NO_COFF_SYMBOLS
-static void coff_swap_sym_in PARAMS ((bfd *, PTR, PTR));
-static unsigned int coff_swap_sym_out PARAMS ((bfd *, PTR, PTR));
-static void coff_swap_aux_in PARAMS ((bfd *, PTR, int, int, int, int, PTR));
-static unsigned int coff_swap_aux_out PARAMS ((bfd *, PTR, int, int, int, int, PTR));
-#endif /* NO_COFF_SYMBOLS */
-#ifndef NO_COFF_LINENOS
-static void coff_swap_lineno_in PARAMS ((bfd *, PTR, PTR));
-static unsigned int coff_swap_lineno_out PARAMS ((bfd *, PTR, PTR));
-#endif /* NO_COFF_LINENOS */
-
 #ifndef NO_COFF_RELOCS
 
 static void
 #ifndef NO_COFF_RELOCS
 
 static void
-coff_swap_reloc_in (abfd, src, dst)
-     bfd *abfd;
-     PTR src;
-     PTR dst;
+coff_swap_reloc_in (bfd * abfd, void * src, void * dst)
 {
   RELOC *reloc_src = (RELOC *) src;
   struct internal_reloc *reloc_dst = (struct internal_reloc *) dst;
 
 {
   RELOC *reloc_src = (RELOC *) src;
   struct internal_reloc *reloc_dst = (struct internal_reloc *) dst;
 
-  reloc_dst->r_vaddr = GET_RELOC_VADDR (abfd, reloc_src->r_vaddr);
+  reloc_dst->r_vaddr  = GET_RELOC_VADDR (abfd, reloc_src->r_vaddr);
   reloc_dst->r_symndx = H_GET_S32 (abfd, reloc_src->r_symndx);
   reloc_dst->r_symndx = H_GET_S32 (abfd, reloc_src->r_symndx);
-  reloc_dst->r_type = H_GET_16 (abfd, reloc_src->r_type);
+  reloc_dst->r_type   = H_GET_16 (abfd, reloc_src->r_type);
 
 #ifdef SWAP_IN_RELOC_OFFSET
   reloc_dst->r_offset = SWAP_IN_RELOC_OFFSET (abfd, reloc_src->r_offset);
 
 #ifdef SWAP_IN_RELOC_OFFSET
   reloc_dst->r_offset = SWAP_IN_RELOC_OFFSET (abfd, reloc_src->r_offset);
@@ -252,13 +227,11 @@ coff_swap_reloc_in (abfd, src, dst)
 }
 
 static unsigned int
 }
 
 static unsigned int
-coff_swap_reloc_out (abfd, src, dst)
-     bfd *abfd;
-     PTR src;
-     PTR dst;
+coff_swap_reloc_out (bfd * abfd, void * src, void * dst)
 {
   struct internal_reloc *reloc_src = (struct internal_reloc *) src;
   struct external_reloc *reloc_dst = (struct external_reloc *) dst;
 {
   struct internal_reloc *reloc_src = (struct internal_reloc *) src;
   struct external_reloc *reloc_dst = (struct external_reloc *) dst;
+
   PUT_RELOC_VADDR (abfd, reloc_src->r_vaddr, reloc_dst->r_vaddr);
   H_PUT_32 (abfd, reloc_src->r_symndx, reloc_dst->r_symndx);
   H_PUT_16 (abfd, reloc_src->r_type, reloc_dst->r_type);
   PUT_RELOC_VADDR (abfd, reloc_src->r_vaddr, reloc_dst->r_vaddr);
   H_PUT_32 (abfd, reloc_src->r_symndx, reloc_dst->r_symndx);
   H_PUT_16 (abfd, reloc_src->r_type, reloc_dst->r_type);
@@ -276,10 +249,7 @@ coff_swap_reloc_out (abfd, src, dst)
 #endif /* NO_COFF_RELOCS */
 
 static void
 #endif /* NO_COFF_RELOCS */
 
 static void
-coff_swap_filehdr_in (abfd, src, dst)
-     bfd *abfd;
-     PTR src;
-     PTR dst;
+coff_swap_filehdr_in (bfd * abfd, void * src, void * dst)
 {
   FILHDR *filehdr_src = (FILHDR *) src;
   struct internal_filehdr *filehdr_dst = (struct internal_filehdr *) dst;
 {
   FILHDR *filehdr_src = (FILHDR *) src;
   struct internal_filehdr *filehdr_dst = (struct internal_filehdr *) dst;
@@ -287,16 +257,13 @@ coff_swap_filehdr_in (abfd, src, dst)
 #ifdef COFF_ADJUST_FILEHDR_IN_PRE
   COFF_ADJUST_FILEHDR_IN_PRE (abfd, src, dst);
 #endif
 #ifdef COFF_ADJUST_FILEHDR_IN_PRE
   COFF_ADJUST_FILEHDR_IN_PRE (abfd, src, dst);
 #endif
-  filehdr_dst->f_magic = H_GET_16 (abfd, filehdr_src->f_magic);
-  filehdr_dst->f_nscns = H_GET_16 (abfd, filehdr_src->f_nscns);
+  filehdr_dst->f_magic  = H_GET_16 (abfd, filehdr_src->f_magic);
+  filehdr_dst->f_nscns  = H_GET_16 (abfd, filehdr_src->f_nscns);
   filehdr_dst->f_timdat = H_GET_32 (abfd, filehdr_src->f_timdat);
   filehdr_dst->f_symptr = GET_FILEHDR_SYMPTR (abfd, filehdr_src->f_symptr);
   filehdr_dst->f_timdat = H_GET_32 (abfd, filehdr_src->f_timdat);
   filehdr_dst->f_symptr = GET_FILEHDR_SYMPTR (abfd, filehdr_src->f_symptr);
-  filehdr_dst->f_nsyms = H_GET_32 (abfd, filehdr_src->f_nsyms);
+  filehdr_dst->f_nsyms  = H_GET_32 (abfd, filehdr_src->f_nsyms);
   filehdr_dst->f_opthdr = H_GET_16 (abfd, filehdr_src->f_opthdr);
   filehdr_dst->f_opthdr = H_GET_16 (abfd, filehdr_src->f_opthdr);
-  filehdr_dst->f_flags = H_GET_16 (abfd, filehdr_src->f_flags);
-#ifdef TIC80_TARGET_ID
-  filehdr_dst->f_target_id = H_GET_16 (abfd, filehdr_src->f_target_id);
-#endif
+  filehdr_dst->f_flags  = H_GET_16 (abfd, filehdr_src->f_flags);
 
 #ifdef COFF_ADJUST_FILEHDR_IN_POST
   COFF_ADJUST_FILEHDR_IN_POST (abfd, src, dst);
 
 #ifdef COFF_ADJUST_FILEHDR_IN_POST
   COFF_ADJUST_FILEHDR_IN_POST (abfd, src, dst);
@@ -304,10 +271,7 @@ coff_swap_filehdr_in (abfd, src, dst)
 }
 
 static  unsigned int
 }
 
 static  unsigned int
-coff_swap_filehdr_out (abfd, in, out)
-     bfd *abfd;
-     PTR in;
-     PTR out;
+coff_swap_filehdr_out (bfd *abfd, void * in, void * out)
 {
   struct internal_filehdr *filehdr_in = (struct internal_filehdr *) in;
   FILHDR *filehdr_out = (FILHDR *) out;
 {
   struct internal_filehdr *filehdr_in = (struct internal_filehdr *) in;
   FILHDR *filehdr_out = (FILHDR *) out;
@@ -322,9 +286,6 @@ coff_swap_filehdr_out (abfd, in, out)
   H_PUT_32 (abfd, filehdr_in->f_nsyms, filehdr_out->f_nsyms);
   H_PUT_16 (abfd, filehdr_in->f_opthdr, filehdr_out->f_opthdr);
   H_PUT_16 (abfd, filehdr_in->f_flags, filehdr_out->f_flags);
   H_PUT_32 (abfd, filehdr_in->f_nsyms, filehdr_out->f_nsyms);
   H_PUT_16 (abfd, filehdr_in->f_opthdr, filehdr_out->f_opthdr);
   H_PUT_16 (abfd, filehdr_in->f_flags, filehdr_out->f_flags);
-#ifdef TIC80_TARGET_ID
-  H_PUT_16 (abfd, filehdr_in->f_target_id, filehdr_out->f_target_id);
-#endif
 
 #ifdef COFF_ADJUST_FILEHDR_OUT_POST
   COFF_ADJUST_FILEHDR_OUT_POST (abfd, in, out);
 
 #ifdef COFF_ADJUST_FILEHDR_OUT_POST
   COFF_ADJUST_FILEHDR_OUT_POST (abfd, in, out);
@@ -335,10 +296,7 @@ coff_swap_filehdr_out (abfd, in, out)
 #ifndef NO_COFF_SYMBOLS
 
 static void
 #ifndef NO_COFF_SYMBOLS
 
 static void
-coff_swap_sym_in (abfd, ext1, in1)
-     bfd *abfd;
-     PTR ext1;
-     PTR in1;
+coff_swap_sym_in (bfd * abfd, void * ext1, void * in1)
 {
   SYMENT *ext = (SYMENT *) ext1;
   struct internal_syment *in = (struct internal_syment *) in1;
 {
   SYMENT *ext = (SYMENT *) ext1;
   struct internal_syment *in = (struct internal_syment *) in1;
@@ -351,21 +309,18 @@ coff_swap_sym_in (abfd, ext1, in1)
   else
     {
 #if SYMNMLEN != E_SYMNMLEN
   else
     {
 #if SYMNMLEN != E_SYMNMLEN
-      -> Error, we need to cope with truncating or extending SYMNMLEN!;
+#error we need to cope with truncating or extending SYMNMLEN
 #else
       memcpy (in->_n._n_name, ext->e.e_name, SYMNMLEN);
 #endif
     }
 #else
       memcpy (in->_n._n_name, ext->e.e_name, SYMNMLEN);
 #endif
     }
+
   in->n_value = H_GET_32 (abfd, ext->e_value);
   in->n_value = H_GET_32 (abfd, ext->e_value);
-  in->n_scnum = H_GET_16 (abfd, ext->e_scnum);
+  in->n_scnum = (short) H_GET_16 (abfd, ext->e_scnum);
   if (sizeof (ext->e_type) == 2)
   if (sizeof (ext->e_type) == 2)
-    {
-      in->n_type = H_GET_16 (abfd, ext->e_type);
-    }
+    in->n_type = H_GET_16 (abfd, ext->e_type);
   else
   else
-    {
-      in->n_type = H_GET_32 (abfd, ext->e_type);
-    }
+    in->n_type = H_GET_32 (abfd, ext->e_type);
   in->n_sclass = H_GET_8 (abfd, ext->e_sclass);
   in->n_numaux = H_GET_8 (abfd, ext->e_numaux);
 #ifdef COFF_ADJUST_SYM_IN_POST
   in->n_sclass = H_GET_8 (abfd, ext->e_sclass);
   in->n_numaux = H_GET_8 (abfd, ext->e_numaux);
 #ifdef COFF_ADJUST_SYM_IN_POST
@@ -374,10 +329,7 @@ coff_swap_sym_in (abfd, ext1, in1)
 }
 
 static unsigned int
 }
 
 static unsigned int
-coff_swap_sym_out (abfd, inp, extp)
-     bfd *abfd;
-     PTR inp;
-     PTR extp;
+coff_swap_sym_out (bfd * abfd, void * inp, void * extp)
 {
   struct internal_syment *in = (struct internal_syment *) inp;
   SYMENT *ext =(SYMENT *) extp;
 {
   struct internal_syment *in = (struct internal_syment *) inp;
   SYMENT *ext =(SYMENT *) extp;
@@ -394,7 +346,7 @@ coff_swap_sym_out (abfd, inp, extp)
   else
     {
 #if SYMNMLEN != E_SYMNMLEN
   else
     {
 #if SYMNMLEN != E_SYMNMLEN
-      -> Error, we need to cope with truncating or extending SYMNMLEN!;
+#error we need to cope with truncating or extending SYMNMLEN
 #else
       memcpy (ext->e.e_name, in->_n._n_name, SYMNMLEN);
 #endif
 #else
       memcpy (ext->e.e_name, in->_n._n_name, SYMNMLEN);
 #endif
@@ -404,13 +356,9 @@ coff_swap_sym_out (abfd, inp, extp)
   H_PUT_16 (abfd, in->n_scnum, ext->e_scnum);
 
   if (sizeof (ext->e_type) == 2)
   H_PUT_16 (abfd, in->n_scnum, ext->e_scnum);
 
   if (sizeof (ext->e_type) == 2)
-    {
-      H_PUT_16 (abfd, in->n_type, ext->e_type);
-    }
+    H_PUT_16 (abfd, in->n_type, ext->e_type);
   else
   else
-    {
-      H_PUT_32 (abfd, in->n_type, ext->e_type);
-    }
+    H_PUT_32 (abfd, in->n_type, ext->e_type);
 
   H_PUT_8 (abfd, in->n_sclass, ext->e_sclass);
   H_PUT_8 (abfd, in->n_numaux, ext->e_numaux);
 
   H_PUT_8 (abfd, in->n_sclass, ext->e_sclass);
   H_PUT_8 (abfd, in->n_numaux, ext->e_numaux);
@@ -423,23 +371,22 @@ coff_swap_sym_out (abfd, inp, extp)
 }
 
 static void
 }
 
 static void
-coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
-     bfd *abfd;
-     PTR ext1;
-     int type;
-     int class;
-     int indx;
-     int numaux;
-     PTR in1;
+coff_swap_aux_in (bfd *abfd,
+                 void * ext1,
+                 int type,
+                 int in_class,
+                 int indx,
+                 int numaux,
+                 void * in1)
 {
   AUXENT *ext = (AUXENT *) ext1;
   union internal_auxent *in = (union internal_auxent *) in1;
 
 #ifdef COFF_ADJUST_AUX_IN_PRE
 {
   AUXENT *ext = (AUXENT *) ext1;
   union internal_auxent *in = (union internal_auxent *) in1;
 
 #ifdef COFF_ADJUST_AUX_IN_PRE
-  COFF_ADJUST_AUX_IN_PRE (abfd, ext1, type, class, indx, numaux, in1);
+  COFF_ADJUST_AUX_IN_PRE (abfd, ext1, type, in_class, indx, numaux, in1);
 #endif
 
 #endif
 
-  switch (class)
+  switch (in_class)
     {
     case C_FILE:
       if (ext->x_file.x_fname[0] == 0)
     {
     case C_FILE:
       if (ext->x_file.x_fname[0] == 0)
@@ -450,9 +397,9 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
       else
        {
 #if FILNMLEN != E_FILNMLEN
       else
        {
 #if FILNMLEN != E_FILNMLEN
-         -> Error, we need to cope with truncating or extending FILNMLEN!;
+#error we need to cope with truncating or extending FILNMLEN
 #else
 #else
-         if (numaux > 1)
+         if (numaux > 1 && coff_data (abfd)->pe)
            {
              if (indx == 0)
                memcpy (in->x_file.x_fname, ext->x_file.x_fname,
            {
              if (indx == 0)
                memcpy (in->x_file.x_fname, ext->x_file.x_fname,
@@ -476,7 +423,7 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
          in->x_scn.x_nlinno = GET_SCN_NLINNO (abfd, ext);
 
          /* PE defines some extra fields; we zero them out for
          in->x_scn.x_nlinno = GET_SCN_NLINNO (abfd, ext);
 
          /* PE defines some extra fields; we zero them out for
-             safety.  */
+            safety.  */
          in->x_scn.x_checksum = 0;
          in->x_scn.x_associated = 0;
          in->x_scn.x_comdat = 0;
          in->x_scn.x_checksum = 0;
          in->x_scn.x_associated = 0;
          in->x_scn.x_comdat = 0;
@@ -491,7 +438,8 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
   in->x_sym.x_tvndx = H_GET_16 (abfd, ext->x_sym.x_tvndx);
 #endif
 
   in->x_sym.x_tvndx = H_GET_16 (abfd, ext->x_sym.x_tvndx);
 #endif
 
-  if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class))
+  if (in_class == C_BLOCK || in_class == C_FCN || ISFCN (type)
+      || ISTAG (in_class))
     {
       in->x_sym.x_fcnary.x_fcn.x_lnnoptr = GET_FCN_LNNOPTR (abfd, ext);
       in->x_sym.x_fcnary.x_fcn.x_endndx.l = GET_FCN_ENDNDX (abfd, ext);
     {
       in->x_sym.x_fcnary.x_fcn.x_lnnoptr = GET_FCN_LNNOPTR (abfd, ext);
       in->x_sym.x_fcnary.x_fcn.x_endndx.l = GET_FCN_ENDNDX (abfd, ext);
@@ -512,9 +460,7 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
     }
 
   if (ISFCN (type))
     }
 
   if (ISFCN (type))
-    {
-      in->x_sym.x_misc.x_fsize = H_GET_32 (abfd, ext->x_sym.x_misc.x_fsize);
-    }
+    in->x_sym.x_misc.x_fsize = H_GET_32 (abfd, ext->x_sym.x_misc.x_fsize);
   else
     {
       in->x_sym.x_misc.x_lnsz.x_lnno = GET_LNSZ_LNNO (abfd, ext);
   else
     {
       in->x_sym.x_misc.x_lnsz.x_lnno = GET_LNSZ_LNNO (abfd, ext);
@@ -524,30 +470,29 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
  end: ;
 
 #ifdef COFF_ADJUST_AUX_IN_POST
  end: ;
 
 #ifdef COFF_ADJUST_AUX_IN_POST
-  COFF_ADJUST_AUX_IN_POST (abfd, ext1, type, class, indx, numaux, in1);
+  COFF_ADJUST_AUX_IN_POST (abfd, ext1, type, in_class, indx, numaux, in1);
 #endif
 }
 
 static unsigned int
 #endif
 }
 
 static unsigned int
-coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
-     bfd *abfd;
-     PTR inp;
-     int type;
-     int class;
-     int indx ATTRIBUTE_UNUSED;
-     int numaux ATTRIBUTE_UNUSED;
-     PTR extp;
+coff_swap_aux_out (bfd * abfd,
+                  void * inp,
+                  int type,
+                  int in_class,
+                  int indx ATTRIBUTE_UNUSED,
+                  int numaux ATTRIBUTE_UNUSED,
+                  void * extp)
 {
 {
-  union internal_auxent *in = (union internal_auxent *) inp;
+  union internal_auxent * in = (union internal_auxent *) inp;
   AUXENT *ext = (AUXENT *) extp;
 
 #ifdef COFF_ADJUST_AUX_OUT_PRE
   AUXENT *ext = (AUXENT *) extp;
 
 #ifdef COFF_ADJUST_AUX_OUT_PRE
-  COFF_ADJUST_AUX_OUT_PRE (abfd, inp, type, class, indx, numaux, extp);
+  COFF_ADJUST_AUX_OUT_PRE (abfd, inp, type, in_class, indx, numaux, extp);
 #endif
 
 #endif
 
-  memset ((PTR)ext, 0, AUXESZ);
+  memset (ext, 0, AUXESZ);
 
 
-  switch (class)
+  switch (in_class)
     {
     case C_FILE:
       if (in->x_file.x_fname[0] == 0)
     {
     case C_FILE:
       if (in->x_file.x_fname[0] == 0)
@@ -558,7 +503,7 @@ coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
       else
        {
 #if FILNMLEN != E_FILNMLEN
       else
        {
 #if FILNMLEN != E_FILNMLEN
-         -> Error, we need to cope with truncating or extending FILNMLEN!;
+#error we need to cope with truncating or extending FILNMLEN
 #else
          memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN);
 #endif
 #else
          memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN);
 #endif
@@ -585,7 +530,8 @@ coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
   H_PUT_16 (abfd, in->x_sym.x_tvndx, ext->x_sym.x_tvndx);
 #endif
 
   H_PUT_16 (abfd, in->x_sym.x_tvndx, ext->x_sym.x_tvndx);
 #endif
 
-  if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class))
+  if (in_class == C_BLOCK || in_class == C_FCN || ISFCN (type)
+      || ISTAG (in_class))
     {
       PUT_FCN_LNNOPTR (abfd, in->x_sym.x_fcnary.x_fcn.x_lnnoptr, ext);
       PUT_FCN_ENDNDX (abfd, in->x_sym.x_fcnary.x_fcn.x_endndx.l, ext);
     {
       PUT_FCN_LNNOPTR (abfd, in->x_sym.x_fcnary.x_fcn.x_lnnoptr, ext);
       PUT_FCN_ENDNDX (abfd, in->x_sym.x_fcnary.x_fcn.x_endndx.l, ext);
@@ -615,7 +561,7 @@ coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
 
  end:
 #ifdef COFF_ADJUST_AUX_OUT_POST
 
  end:
 #ifdef COFF_ADJUST_AUX_OUT_POST
-  COFF_ADJUST_AUX_OUT_POST (abfd, inp, type, class, indx, numaux, extp);
+  COFF_ADJUST_AUX_OUT_POST (abfd, inp, type, in_class, indx, numaux, extp);
 #endif
   return AUXESZ;
 }
 #endif
   return AUXESZ;
 }
@@ -625,10 +571,7 @@ coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
 #ifndef NO_COFF_LINENOS
 
 static void
 #ifndef NO_COFF_LINENOS
 
 static void
-coff_swap_lineno_in (abfd, ext1, in1)
-     bfd *abfd;
-     PTR ext1;
-     PTR in1;
+coff_swap_lineno_in (bfd * abfd, void * ext1, void * in1)
 {
   LINENO *ext = (LINENO *) ext1;
   struct internal_lineno *in = (struct internal_lineno *) in1;
 {
   LINENO *ext = (LINENO *) ext1;
   struct internal_lineno *in = (struct internal_lineno *) in1;
@@ -638,10 +581,7 @@ coff_swap_lineno_in (abfd, ext1, in1)
 }
 
 static unsigned int
 }
 
 static unsigned int
-coff_swap_lineno_out (abfd, inp, outp)
-     bfd *abfd;
-     PTR inp;
-     PTR outp;
+coff_swap_lineno_out (bfd * abfd, void * inp, void * outp)
 {
   struct internal_lineno *in = (struct internal_lineno *) inp;
   struct external_lineno *ext = (struct external_lineno *) outp;
 {
   struct internal_lineno *in = (struct internal_lineno *) inp;
   struct external_lineno *ext = (struct external_lineno *) outp;
@@ -654,10 +594,7 @@ coff_swap_lineno_out (abfd, inp, outp)
 #endif /* NO_COFF_LINENOS */
 
 static void
 #endif /* NO_COFF_LINENOS */
 
 static void
-coff_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1)
-     bfd *abfd;
-     PTR aouthdr_ext1;
-     PTR aouthdr_int1;
+coff_swap_aouthdr_in (bfd * abfd, void * aouthdr_ext1, void * aouthdr_int1)
 {
   AOUTHDR *aouthdr_ext;
   struct internal_aouthdr *aouthdr_int;
 {
   AOUTHDR *aouthdr_ext;
   struct internal_aouthdr *aouthdr_int;
@@ -675,17 +612,6 @@ coff_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1)
   aouthdr_int->data_start =
     GET_AOUTHDR_DATA_START (abfd, aouthdr_ext->data_start);
 
   aouthdr_int->data_start =
     GET_AOUTHDR_DATA_START (abfd, aouthdr_ext->data_start);
 
-#ifdef I960
-  aouthdr_int->tagentries = H_GET_32 (abfd, aouthdr_ext->tagentries);
-#endif
-
-#ifdef APOLLO_M68
-  H_PUT_32 (abfd, aouthdr_int->o_inlib, aouthdr_ext->o_inlib);
-  H_PUT_32 (abfd, aouthdr_int->o_sri, aouthdr_ext->o_sri);
-  H_PUT_32 (abfd, aouthdr_int->vid[0], aouthdr_ext->vid);
-  H_PUT_32 (abfd, aouthdr_int->vid[1], aouthdr_ext->vid + 4);
-#endif
-
 #ifdef RS6000COFF_C
 #ifdef XCOFF64
   aouthdr_int->o_toc = H_GET_64 (abfd, aouthdr_ext->o_toc);
 #ifdef RS6000COFF_C
 #ifdef XCOFF64
   aouthdr_int->o_toc = H_GET_64 (abfd, aouthdr_ext->o_toc);
@@ -730,10 +656,7 @@ coff_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1)
 }
 
 static unsigned int
 }
 
 static unsigned int
-coff_swap_aouthdr_out (abfd, in, out)
-     bfd *abfd;
-     PTR in;
-     PTR out;
+coff_swap_aouthdr_out (bfd * abfd, void * in, void * out)
 {
   struct internal_aouthdr *aouthdr_in = (struct internal_aouthdr *) in;
   AOUTHDR *aouthdr_out = (AOUTHDR *) out;
 {
   struct internal_aouthdr *aouthdr_in = (struct internal_aouthdr *) in;
   AOUTHDR *aouthdr_out = (AOUTHDR *) out;
@@ -749,10 +672,6 @@ coff_swap_aouthdr_out (abfd, in, out)
   PUT_AOUTHDR_DATA_START (abfd, aouthdr_in->data_start,
                          aouthdr_out->data_start);
 
   PUT_AOUTHDR_DATA_START (abfd, aouthdr_in->data_start,
                          aouthdr_out->data_start);
 
-#ifdef I960
-  H_PUT_32 (abfd, aouthdr_in->tagentries, aouthdr_out->tagentries);
-#endif
-
 #ifdef RS6000COFF_C
 #ifdef XCOFF64
   H_PUT_64 (abfd, aouthdr_in->o_toc, aouthdr_out->o_toc);
 #ifdef RS6000COFF_C
 #ifdef XCOFF64
   H_PUT_64 (abfd, aouthdr_in->o_toc, aouthdr_out->o_toc);
@@ -806,11 +725,9 @@ coff_swap_aouthdr_out (abfd, in, out)
   return AOUTSZ;
 }
 
   return AOUTSZ;
 }
 
+ATTRIBUTE_UNUSED
 static void
 static void
-coff_swap_scnhdr_in (abfd, ext, in)
-     bfd *abfd;
-     PTR ext;
-     PTR in;
+coff_swap_scnhdr_in (bfd * abfd, void * ext, void * in)
 {
   SCNHDR *scnhdr_ext = (SCNHDR *) ext;
   struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *) in;
 {
   SCNHDR *scnhdr_ext = (SCNHDR *) ext;
   struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *) in;
@@ -830,19 +747,14 @@ coff_swap_scnhdr_in (abfd, ext, in)
   scnhdr_int->s_flags = GET_SCNHDR_FLAGS (abfd, scnhdr_ext->s_flags);
   scnhdr_int->s_nreloc = GET_SCNHDR_NRELOC (abfd, scnhdr_ext->s_nreloc);
   scnhdr_int->s_nlnno = GET_SCNHDR_NLNNO (abfd, scnhdr_ext->s_nlnno);
   scnhdr_int->s_flags = GET_SCNHDR_FLAGS (abfd, scnhdr_ext->s_flags);
   scnhdr_int->s_nreloc = GET_SCNHDR_NRELOC (abfd, scnhdr_ext->s_nreloc);
   scnhdr_int->s_nlnno = GET_SCNHDR_NLNNO (abfd, scnhdr_ext->s_nlnno);
-#ifdef I960
-  scnhdr_int->s_align = GET_SCNHDR_ALIGN (abfd, scnhdr_ext->s_align);
-#endif
 #ifdef COFF_ADJUST_SCNHDR_IN_POST
   COFF_ADJUST_SCNHDR_IN_POST (abfd, ext, in);
 #endif
 }
 
 #ifdef COFF_ADJUST_SCNHDR_IN_POST
   COFF_ADJUST_SCNHDR_IN_POST (abfd, ext, in);
 #endif
 }
 
+ATTRIBUTE_UNUSED
 static unsigned int
 static unsigned int
-coff_swap_scnhdr_out (abfd, in, out)
-     bfd *abfd;
-     PTR in;
-     PTR out;
+coff_swap_scnhdr_out (bfd * abfd, void * in, void * out)
 {
   struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *) in;
   SCNHDR *scnhdr_ext = (SCNHDR *) out;
 {
   struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *) in;
   SCNHDR *scnhdr_ext = (SCNHDR *) out;
@@ -860,10 +772,6 @@ coff_swap_scnhdr_out (abfd, in, out)
   PUT_SCNHDR_RELPTR (abfd, scnhdr_int->s_relptr, scnhdr_ext->s_relptr);
   PUT_SCNHDR_LNNOPTR (abfd, scnhdr_int->s_lnnoptr, scnhdr_ext->s_lnnoptr);
   PUT_SCNHDR_FLAGS (abfd, scnhdr_int->s_flags, scnhdr_ext->s_flags);
   PUT_SCNHDR_RELPTR (abfd, scnhdr_int->s_relptr, scnhdr_ext->s_relptr);
   PUT_SCNHDR_LNNOPTR (abfd, scnhdr_int->s_lnnoptr, scnhdr_ext->s_lnnoptr);
   PUT_SCNHDR_FLAGS (abfd, scnhdr_int->s_flags, scnhdr_ext->s_flags);
-#if defined(M88)
-  H_PUT_32 (abfd, scnhdr_int->s_nlnno, scnhdr_ext->s_nlnno);
-  H_PUT_32 (abfd, scnhdr_int->s_nreloc, scnhdr_ext->s_nreloc);
-#else
   if (scnhdr_int->s_nlnno <= MAX_SCNHDR_NLNNO)
     PUT_SCNHDR_NLNNO (abfd, scnhdr_int->s_nlnno, scnhdr_ext->s_nlnno);
   else
   if (scnhdr_int->s_nlnno <= MAX_SCNHDR_NLNNO)
     PUT_SCNHDR_NLNNO (abfd, scnhdr_int->s_nlnno, scnhdr_ext->s_nlnno);
   else
@@ -872,10 +780,10 @@ coff_swap_scnhdr_out (abfd, in, out)
 
       memcpy (buf, scnhdr_int->s_name, sizeof (scnhdr_int->s_name));
       buf[sizeof (scnhdr_int->s_name)] = '\0';
 
       memcpy (buf, scnhdr_int->s_name, sizeof (scnhdr_int->s_name));
       buf[sizeof (scnhdr_int->s_name)] = '\0';
-      (*_bfd_error_handler)
-       (_("%s: warning: %s: line number overflow: 0x%lx > 0xffff"),
-        bfd_get_filename (abfd),
-        buf, scnhdr_int->s_nlnno);
+      _bfd_error_handler
+       /* xgettext:c-format */
+       (_("%pB: warning: %s: line number overflow: 0x%lx > 0xffff"),
+        abfd, buf, scnhdr_int->s_nlnno);
       PUT_SCNHDR_NLNNO (abfd, 0xffff, scnhdr_ext->s_nlnno);
     }
 
       PUT_SCNHDR_NLNNO (abfd, 0xffff, scnhdr_ext->s_nlnno);
     }
 
@@ -887,18 +795,14 @@ coff_swap_scnhdr_out (abfd, in, out)
 
       memcpy (buf, scnhdr_int->s_name, sizeof (scnhdr_int->s_name));
       buf[sizeof (scnhdr_int->s_name)] = '\0';
 
       memcpy (buf, scnhdr_int->s_name, sizeof (scnhdr_int->s_name));
       buf[sizeof (scnhdr_int->s_name)] = '\0';
-      (*_bfd_error_handler) (_("%s: %s: reloc overflow: 0x%lx > 0xffff"),
-                            bfd_get_filename (abfd),
-                            buf, scnhdr_int->s_nreloc);
+      /* xgettext:c-format */
+      _bfd_error_handler (_("%pB: %s: reloc overflow: 0x%lx > 0xffff"),
+                         abfd, buf, scnhdr_int->s_nreloc);
       bfd_set_error (bfd_error_file_truncated);
       PUT_SCNHDR_NRELOC (abfd, 0xffff, scnhdr_ext->s_nreloc);
       ret = 0;
     }
       bfd_set_error (bfd_error_file_truncated);
       PUT_SCNHDR_NRELOC (abfd, 0xffff, scnhdr_ext->s_nreloc);
       ret = 0;
     }
-#endif
 
 
-#ifdef I960
-  PUT_SCNHDR_ALIGN (abfd, scnhdr_int->s_align, scnhdr_ext->s_align);
-#endif
 #ifdef COFF_ADJUST_SCNHDR_OUT_POST
   COFF_ADJUST_SCNHDR_OUT_POST (abfd, in, out);
 #endif
 #ifdef COFF_ADJUST_SCNHDR_OUT_POST
   COFF_ADJUST_SCNHDR_OUT_POST (abfd, in, out);
 #endif
This page took 0.031287 seconds and 4 git commands to generate.