Eliminate ia64 compiler warnings. Fix ia64 gas testsuite again.
[deliverable/binutils-gdb.git] / bfd / coffswap.h
index ae30a5d966f497bd00a5f35d4cd7fb0d1661fd24..2f89afbff2d08a2d6b331bcd676821b69de13a06 100644 (file)
@@ -1,5 +1,6 @@
 /* Generic COFF swapping routines, for BFD.
 /* Generic COFF swapping routines, for BFD.
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
    Written by Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
    Written by Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -26,10 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    Any file which uses this must first include "coff/internal.h" and
    "coff/CPU.h".  The functions will then be correct for that CPU.  */
 
    Any file which uses this must first include "coff/internal.h" and
    "coff/CPU.h".  The functions will then be correct for that CPU.  */
 
-#ifndef IMAGE_BASE
-#define IMAGE_BASE 0
-#endif
-
 #define PUTWORD bfd_h_put_32
 #define PUTHALF bfd_h_put_16
 #define        PUTBYTE bfd_h_put_8
 #define PUTWORD bfd_h_put_32
 #define PUTHALF bfd_h_put_16
 #define        PUTBYTE bfd_h_put_8
@@ -171,12 +168,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #ifndef GET_SCNHDR_NRELOC
 #define GET_SCNHDR_NRELOC bfd_h_get_16
 #endif
 #ifndef GET_SCNHDR_NRELOC
 #define GET_SCNHDR_NRELOC bfd_h_get_16
 #endif
+#ifndef MAX_SCNHDR_NRELOC
+#define MAX_SCNHDR_NRELOC 0xffff
+#endif
 #ifndef PUT_SCNHDR_NRELOC
 #define PUT_SCNHDR_NRELOC bfd_h_put_16
 #endif
 #ifndef GET_SCNHDR_NLNNO
 #define GET_SCNHDR_NLNNO bfd_h_get_16
 #endif
 #ifndef PUT_SCNHDR_NRELOC
 #define PUT_SCNHDR_NRELOC bfd_h_put_16
 #endif
 #ifndef GET_SCNHDR_NLNNO
 #define GET_SCNHDR_NLNNO bfd_h_get_16
 #endif
+#ifndef MAX_SCNHDR_NLNNO
+#define MAX_SCNHDR_NLNNO 0xffff
+#endif
 #ifndef PUT_SCNHDR_NLNNO
 #define PUT_SCNHDR_NLNNO bfd_h_put_16
 #endif
 #ifndef PUT_SCNHDR_NLNNO
 #define PUT_SCNHDR_NLNNO bfd_h_put_16
 #endif
@@ -187,6 +190,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define PUT_SCNHDR_FLAGS bfd_h_put_32
 #endif
 
 #define PUT_SCNHDR_FLAGS bfd_h_put_32
 #endif
 
+#ifndef GET_RELOC_VADDR
+#define GET_RELOC_VADDR bfd_h_get_32
+#endif
+#ifndef PUT_RELOC_VADDR
+#define PUT_RELOC_VADDR bfd_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_aouthdr_in PARAMS ((bfd *, PTR, PTR));
 static unsigned int coff_swap_aouthdr_out PARAMS ((bfd *, PTR, PTR));
@@ -220,7 +229,7 @@ coff_swap_reloc_in (abfd, src, 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 = bfd_h_get_32(abfd, (bfd_byte *)reloc_src->r_vaddr);
+  reloc_dst->r_vaddr = GET_RELOC_VADDR (abfd, (bfd_byte *)reloc_src->r_vaddr);
   reloc_dst->r_symndx = bfd_h_get_signed_32(abfd, (bfd_byte *) reloc_src->r_symndx);
 
 #ifdef RS6000COFF_C
   reloc_dst->r_symndx = bfd_h_get_signed_32(abfd, (bfd_byte *) reloc_src->r_symndx);
 
 #ifdef RS6000COFF_C
@@ -244,7 +253,7 @@ coff_swap_reloc_out (abfd, src, 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;
-  bfd_h_put_32(abfd, reloc_src->r_vaddr, (bfd_byte *) reloc_dst->r_vaddr);
+  PUT_RELOC_VADDR (abfd, reloc_src->r_vaddr, (bfd_byte *) reloc_dst->r_vaddr);
   bfd_h_put_32(abfd, reloc_src->r_symndx, (bfd_byte *) reloc_dst->r_symndx);
 
 #ifdef RS6000COFF_C
   bfd_h_put_32(abfd, reloc_src->r_symndx, (bfd_byte *) reloc_dst->r_symndx);
 
 #ifdef RS6000COFF_C
@@ -264,7 +273,7 @@ coff_swap_reloc_out (abfd, src, dst)
   SWAP_OUT_RELOC_EXTRA(abfd,reloc_src, reloc_dst);
 #endif
 
   SWAP_OUT_RELOC_EXTRA(abfd,reloc_src, reloc_dst);
 #endif
 
-  return RELSZ;
+  return bfd_coff_relsz (abfd);
 }
 
 #endif /* NO_COFF_RELOCS */
 }
 
 #endif /* NO_COFF_RELOCS */
@@ -324,10 +333,9 @@ coff_swap_filehdr_out (abfd, in, out)
 #ifdef COFF_ADJUST_FILEHDR_OUT_POST
   COFF_ADJUST_FILEHDR_OUT_POST (abfd, in, out);
 #endif
 #ifdef COFF_ADJUST_FILEHDR_OUT_POST
   COFF_ADJUST_FILEHDR_OUT_POST (abfd, in, out);
 #endif
-  return FILHSZ;
+  return bfd_coff_filhsz (abfd);
 }
 
 }
 
-
 #ifndef NO_COFF_SYMBOLS
 
 static void
 #ifndef NO_COFF_SYMBOLS
 
 static void
@@ -350,9 +358,9 @@ coff_swap_sym_in (abfd, ext1, in1)
     memcpy(in->_n._n_name, ext->e.e_name, SYMNMLEN);
 #endif
   }
     memcpy(in->_n._n_name, ext->e.e_name, SYMNMLEN);
 #endif
   }
-  in->n_value = bfd_h_get_32(abfd, (bfd_byte *) ext->e_value); 
+  in->n_value = bfd_h_get_32(abfd, (bfd_byte *) ext->e_value);
   in->n_scnum = bfd_h_get_16(abfd, (bfd_byte *) ext->e_scnum);
   in->n_scnum = bfd_h_get_16(abfd, (bfd_byte *) ext->e_scnum);
-  if (sizeof(ext->e_type) == 2){
+  if (sizeof (ext->e_type) == 2){
     in->n_type = bfd_h_get_16(abfd, (bfd_byte *) ext->e_type);
   }
   else {
     in->n_type = bfd_h_get_16(abfd, (bfd_byte *) ext->e_type);
   }
   else {
@@ -360,6 +368,9 @@ coff_swap_sym_in (abfd, ext1, in1)
   }
   in->n_sclass = bfd_h_get_8(abfd, ext->e_sclass);
   in->n_numaux = bfd_h_get_8(abfd, ext->e_numaux);
   }
   in->n_sclass = bfd_h_get_8(abfd, ext->e_sclass);
   in->n_numaux = bfd_h_get_8(abfd, ext->e_numaux);
+#ifdef COFF_ADJUST_SYM_IN_POST
+  COFF_ADJUST_SYM_IN_POST (abfd, ext1, in1);
+#endif
 }
 
 static unsigned int
 }
 
 static unsigned int
@@ -383,7 +394,7 @@ coff_swap_sym_out (abfd, inp, extp)
   }
   bfd_h_put_32(abfd,  in->n_value , (bfd_byte *) ext->e_value);
   bfd_h_put_16(abfd,  in->n_scnum , (bfd_byte *) ext->e_scnum);
   }
   bfd_h_put_32(abfd,  in->n_value , (bfd_byte *) ext->e_value);
   bfd_h_put_16(abfd,  in->n_scnum , (bfd_byte *) ext->e_scnum);
-  if (sizeof(ext->e_type) == 2)
+  if (sizeof (ext->e_type) == 2)
       {
        bfd_h_put_16(abfd,  in->n_type , (bfd_byte *) ext->e_type);
       }
       {
        bfd_h_put_16(abfd,  in->n_type , (bfd_byte *) ext->e_type);
       }
@@ -393,6 +404,9 @@ coff_swap_sym_out (abfd, inp, extp)
       }
   bfd_h_put_8(abfd,  in->n_sclass , ext->e_sclass);
   bfd_h_put_8(abfd,  in->n_numaux , ext->e_numaux);
       }
   bfd_h_put_8(abfd,  in->n_sclass , ext->e_sclass);
   bfd_h_put_8(abfd,  in->n_numaux , ext->e_numaux);
+#ifdef COFF_ADJUST_SYM_OUT_POST
+  COFF_ADJUST_SYM_OUT_POST (abfd, inp, extp);
+#endif
   return SYMESZ;
 }
 
   return SYMESZ;
 }
 
@@ -416,39 +430,26 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
     case C_FILE:
       if (ext->x_file.x_fname[0] == 0) {
          in->x_file.x_n.x_zeroes = 0;
     case C_FILE:
       if (ext->x_file.x_fname[0] == 0) {
          in->x_file.x_n.x_zeroes = 0;
-         in->x_file.x_n.x_offset = 
+         in->x_file.x_n.x_offset =
           bfd_h_get_32(abfd, (bfd_byte *) ext->x_file.x_n.x_offset);
        } else {
 #if FILNMLEN != E_FILNMLEN
            -> Error, we need to cope with truncating or extending FILNMLEN!;
 #else
           bfd_h_get_32(abfd, (bfd_byte *) ext->x_file.x_n.x_offset);
        } else {
 #if FILNMLEN != E_FILNMLEN
            -> Error, we need to cope with truncating or extending FILNMLEN!;
 #else
-           memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN);
+           if (numaux > 1)
+             {
+               if (indx == 0)
+                 memcpy (in->x_file.x_fname, ext->x_file.x_fname,
+                         numaux * sizeof (AUXENT));
+             }
+           else
+             {
+               memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN);
+             }
 #endif
          }
       goto end;
 
 #endif
          }
       goto end;
 
-      /* RS/6000 "csect" auxents */
-#ifdef RS6000COFF_C
-    case C_EXT:
-    case C_HIDEXT:
-      if (indx + 1 == numaux)
-       {
-         in->x_csect.x_scnlen.l = bfd_h_get_32 (abfd, ext->x_csect.x_scnlen);
-         in->x_csect.x_parmhash = bfd_h_get_32 (abfd,
-                                                ext->x_csect.x_parmhash);
-         in->x_csect.x_snhash   = bfd_h_get_16 (abfd, ext->x_csect.x_snhash);
-         /* We don't have to hack bitfields in x_smtyp because it's
-            defined by shifts-and-ands, which are equivalent on all
-            byte orders.  */
-         in->x_csect.x_smtyp    = bfd_h_get_8  (abfd, ext->x_csect.x_smtyp);
-         in->x_csect.x_smclas   = bfd_h_get_8  (abfd, ext->x_csect.x_smclas);
-         in->x_csect.x_stab     = bfd_h_get_32 (abfd, ext->x_csect.x_stab);
-         in->x_csect.x_snstab   = bfd_h_get_16 (abfd, ext->x_csect.x_snstab);
-         goto end;
-       }
-      break;
-#endif
-
     case C_STAT:
 #ifdef C_LEAFSTAT
     case C_LEAFSTAT:
     case C_STAT:
 #ifdef C_LEAFSTAT
     case C_LEAFSTAT:
@@ -505,7 +506,7 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
 
 end: ;
   /* the semicolon is because MSVC doesn't like labels at
 
 end: ;
   /* the semicolon is because MSVC doesn't like labels at
-     end of block. */
+     end of block.  */
 
 #ifdef COFF_ADJUST_AUX_IN_POST
   COFF_ADJUST_AUX_IN_POST (abfd, ext1, type, class, indx, numaux, in1);
 
 #ifdef COFF_ADJUST_AUX_IN_POST
   COFF_ADJUST_AUX_IN_POST (abfd, ext1, type, class, indx, numaux, in1);
@@ -518,8 +519,8 @@ coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
      PTR       inp;
      int   type;
      int   class;
      PTR       inp;
      int   type;
      int   class;
-     int   indx;
-     int   numaux;
+     int   indx ATTRIBUTE_UNUSED;
+     int   numaux ATTRIBUTE_UNUSED;
      PTR       extp;
 {
   union internal_auxent *in = (union internal_auxent *)inp;
      PTR       extp;
 {
   union internal_auxent *in = (union internal_auxent *)inp;
@@ -546,27 +547,6 @@ coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
     }
     goto end;
 
     }
     goto end;
 
-#ifdef RS6000COFF_C
-  /* RS/6000 "csect" auxents */
-  case C_EXT:
-  case C_HIDEXT:
-    if (indx + 1 == numaux)
-      {
-       PUTWORD (abfd, in->x_csect.x_scnlen.l,  ext->x_csect.x_scnlen);
-       PUTWORD (abfd, in->x_csect.x_parmhash,  ext->x_csect.x_parmhash);
-       PUTHALF (abfd, in->x_csect.x_snhash,    ext->x_csect.x_snhash);
-       /* We don't have to hack bitfields in x_smtyp because it's
-          defined by shifts-and-ands, which are equivalent on all
-          byte orders.  */
-       PUTBYTE (abfd, in->x_csect.x_smtyp,     ext->x_csect.x_smtyp);
-       PUTBYTE (abfd, in->x_csect.x_smclas,    ext->x_csect.x_smclas);
-       PUTWORD (abfd, in->x_csect.x_stab,      ext->x_csect.x_stab);
-       PUTHALF (abfd, in->x_csect.x_snstab,    ext->x_csect.x_snstab);
-       goto end;
-      }
-    break;
-#endif
-
   case C_STAT:
 #ifdef C_LEAFSTAT
   case C_LEAFSTAT:
   case C_STAT:
 #ifdef C_LEAFSTAT
   case C_LEAFSTAT:
@@ -691,9 +671,12 @@ coff_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1)
   bfd_h_put_32(abfd, aouthdr_int->vid[1], (bfd_byte *) aouthdr_ext->vid + 4);
 #endif
 
   bfd_h_put_32(abfd, aouthdr_int->vid[1], (bfd_byte *) aouthdr_ext->vid + 4);
 #endif
 
-
 #ifdef RS6000COFF_C
 #ifdef RS6000COFF_C
+#ifdef XCOFF64
+  aouthdr_int->o_toc = bfd_h_get_64(abfd, aouthdr_ext->o_toc);
+#else
   aouthdr_int->o_toc = bfd_h_get_32(abfd, aouthdr_ext->o_toc);
   aouthdr_int->o_toc = bfd_h_get_32(abfd, aouthdr_ext->o_toc);
+#endif
   aouthdr_int->o_snentry = bfd_h_get_16(abfd, aouthdr_ext->o_snentry);
   aouthdr_int->o_sntext = bfd_h_get_16(abfd, aouthdr_ext->o_sntext);
   aouthdr_int->o_sndata = bfd_h_get_16(abfd, aouthdr_ext->o_sndata);
   aouthdr_int->o_snentry = bfd_h_get_16(abfd, aouthdr_ext->o_snentry);
   aouthdr_int->o_sntext = bfd_h_get_16(abfd, aouthdr_ext->o_sntext);
   aouthdr_int->o_sndata = bfd_h_get_16(abfd, aouthdr_ext->o_sndata);
@@ -704,9 +687,14 @@ coff_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1)
   aouthdr_int->o_algndata = bfd_h_get_16(abfd, aouthdr_ext->o_algndata);
   aouthdr_int->o_modtype = bfd_h_get_16(abfd, aouthdr_ext->o_modtype);
   aouthdr_int->o_cputype = bfd_h_get_16(abfd, aouthdr_ext->o_cputype);
   aouthdr_int->o_algndata = bfd_h_get_16(abfd, aouthdr_ext->o_algndata);
   aouthdr_int->o_modtype = bfd_h_get_16(abfd, aouthdr_ext->o_modtype);
   aouthdr_int->o_cputype = bfd_h_get_16(abfd, aouthdr_ext->o_cputype);
+#ifdef XCOFF64
+  aouthdr_int->o_maxstack = bfd_h_get_64(abfd, aouthdr_ext->o_maxstack);
+  aouthdr_int->o_maxdata = bfd_h_get_64(abfd, aouthdr_ext->o_maxdata);
+#else
   aouthdr_int->o_maxstack = bfd_h_get_32(abfd, aouthdr_ext->o_maxstack);
   aouthdr_int->o_maxdata = bfd_h_get_32(abfd, aouthdr_ext->o_maxdata);
 #endif
   aouthdr_int->o_maxstack = bfd_h_get_32(abfd, aouthdr_ext->o_maxstack);
   aouthdr_int->o_maxdata = bfd_h_get_32(abfd, aouthdr_ext->o_maxdata);
 #endif
+#endif
 
 #ifdef MIPSECOFF
   aouthdr_int->bss_start = bfd_h_get_32(abfd, aouthdr_ext->bss_start);
 
 #ifdef MIPSECOFF
   aouthdr_int->bss_start = bfd_h_get_32(abfd, aouthdr_ext->bss_start);
@@ -751,7 +739,11 @@ coff_swap_aouthdr_out (abfd, in, out)
 #endif
 
 #ifdef RS6000COFF_C
 #endif
 
 #ifdef RS6000COFF_C
+#ifdef XCOFF64
+  bfd_h_put_64 (abfd, aouthdr_in->o_toc, aouthdr_out->o_toc);
+#else
   bfd_h_put_32 (abfd, aouthdr_in->o_toc, aouthdr_out->o_toc);
   bfd_h_put_32 (abfd, aouthdr_in->o_toc, aouthdr_out->o_toc);
+#endif
   bfd_h_put_16 (abfd, aouthdr_in->o_snentry, aouthdr_out->o_snentry);
   bfd_h_put_16 (abfd, aouthdr_in->o_sntext, aouthdr_out->o_sntext);
   bfd_h_put_16 (abfd, aouthdr_in->o_sndata, aouthdr_out->o_sndata);
   bfd_h_put_16 (abfd, aouthdr_in->o_snentry, aouthdr_out->o_snentry);
   bfd_h_put_16 (abfd, aouthdr_in->o_sntext, aouthdr_out->o_sntext);
   bfd_h_put_16 (abfd, aouthdr_in->o_sndata, aouthdr_out->o_sndata);
@@ -762,9 +754,18 @@ coff_swap_aouthdr_out (abfd, in, out)
   bfd_h_put_16 (abfd, aouthdr_in->o_algndata, aouthdr_out->o_algndata);
   bfd_h_put_16 (abfd, aouthdr_in->o_modtype, aouthdr_out->o_modtype);
   bfd_h_put_16 (abfd, aouthdr_in->o_cputype, aouthdr_out->o_cputype);
   bfd_h_put_16 (abfd, aouthdr_in->o_algndata, aouthdr_out->o_algndata);
   bfd_h_put_16 (abfd, aouthdr_in->o_modtype, aouthdr_out->o_modtype);
   bfd_h_put_16 (abfd, aouthdr_in->o_cputype, aouthdr_out->o_cputype);
+#ifdef XCOFF64
+  bfd_h_put_64 (abfd, aouthdr_in->o_maxstack, aouthdr_out->o_maxstack);
+  bfd_h_put_64 (abfd, aouthdr_in->o_maxdata, aouthdr_out->o_maxdata);
+#else
   bfd_h_put_32 (abfd, aouthdr_in->o_maxstack, aouthdr_out->o_maxstack);
   bfd_h_put_32 (abfd, aouthdr_in->o_maxdata, aouthdr_out->o_maxdata);
   bfd_h_put_32 (abfd, aouthdr_in->o_maxstack, aouthdr_out->o_maxstack);
   bfd_h_put_32 (abfd, aouthdr_in->o_maxdata, aouthdr_out->o_maxdata);
+#endif
   memset (aouthdr_out->o_resv2, 0, sizeof aouthdr_out->o_resv2);
   memset (aouthdr_out->o_resv2, 0, sizeof aouthdr_out->o_resv2);
+#ifdef XCOFF64
+  memset (aouthdr_out->o_debugger, 0, sizeof aouthdr_out->o_debugger);
+  memset (aouthdr_out->o_resv3, 0, sizeof aouthdr_out->o_resv3);
+#endif
 #endif
 
 #ifdef MIPSECOFF
 #endif
 
 #ifdef MIPSECOFF
@@ -802,7 +803,7 @@ coff_swap_scnhdr_in (abfd, ext, in)
 #ifdef COFF_ADJUST_SCNHDR_IN_PRE
   COFF_ADJUST_SCNHDR_IN_PRE (abfd, ext, in);
 #endif
 #ifdef COFF_ADJUST_SCNHDR_IN_PRE
   COFF_ADJUST_SCNHDR_IN_PRE (abfd, ext, in);
 #endif
-  memcpy(scnhdr_int->s_name, scnhdr_ext->s_name, sizeof(scnhdr_int->s_name));
+  memcpy(scnhdr_int->s_name, scnhdr_ext->s_name, sizeof (scnhdr_int->s_name));
   scnhdr_int->s_vaddr =
     GET_SCNHDR_VADDR (abfd, (bfd_byte *) scnhdr_ext->s_vaddr);
   scnhdr_int->s_paddr =
   scnhdr_int->s_vaddr =
     GET_SCNHDR_VADDR (abfd, (bfd_byte *) scnhdr_ext->s_vaddr);
   scnhdr_int->s_paddr =
@@ -839,17 +840,16 @@ coff_swap_scnhdr_out (abfd, in, 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;
-  unsigned int ret = SCNHSZ;
+  unsigned int ret = bfd_coff_scnhsz (abfd);
 
 #ifdef COFF_ADJUST_SCNHDR_OUT_PRE
   COFF_ADJUST_SCNHDR_OUT_PRE (abfd, in, out);
 #endif
 
 #ifdef COFF_ADJUST_SCNHDR_OUT_PRE
   COFF_ADJUST_SCNHDR_OUT_PRE (abfd, in, out);
 #endif
-  memcpy(scnhdr_ext->s_name, scnhdr_int->s_name, sizeof(scnhdr_int->s_name));
+  memcpy(scnhdr_ext->s_name, scnhdr_int->s_name, sizeof (scnhdr_int->s_name));
 
   PUT_SCNHDR_VADDR (abfd, scnhdr_int->s_vaddr,
                    (bfd_byte *) scnhdr_ext->s_vaddr);
 
 
   PUT_SCNHDR_VADDR (abfd, scnhdr_int->s_vaddr,
                    (bfd_byte *) scnhdr_ext->s_vaddr);
 
-
   PUT_SCNHDR_PADDR (abfd, scnhdr_int->s_paddr,
                    (bfd_byte *) scnhdr_ext->s_paddr);
   PUT_SCNHDR_SIZE (abfd, scnhdr_int->s_size,
   PUT_SCNHDR_PADDR (abfd, scnhdr_int->s_paddr,
                    (bfd_byte *) scnhdr_ext->s_paddr);
   PUT_SCNHDR_SIZE (abfd, scnhdr_int->s_size,
@@ -867,8 +867,9 @@ coff_swap_scnhdr_out (abfd, in, out)
   PUTWORD(abfd, scnhdr_int->s_nlnno, (bfd_byte *) scnhdr_ext->s_nlnno);
   PUTWORD(abfd, scnhdr_int->s_nreloc, (bfd_byte *) scnhdr_ext->s_nreloc);
 #else
   PUTWORD(abfd, scnhdr_int->s_nlnno, (bfd_byte *) scnhdr_ext->s_nlnno);
   PUTWORD(abfd, scnhdr_int->s_nreloc, (bfd_byte *) scnhdr_ext->s_nreloc);
 #else
-  if (scnhdr_int->s_nlnno <= 0xffff)
-    PUTHALF(abfd, scnhdr_int->s_nlnno, (bfd_byte *) scnhdr_ext->s_nlnno);
+  if (scnhdr_int->s_nlnno <= MAX_SCNHDR_NLNNO)
+    PUT_SCNHDR_NLNNO(abfd, scnhdr_int->s_nlnno,
+           (bfd_byte *) scnhdr_ext->s_nlnno);
   else
     {
       char buf[sizeof (scnhdr_int->s_name) + 1];
   else
     {
       char buf[sizeof (scnhdr_int->s_name) + 1];
@@ -879,10 +880,11 @@ coff_swap_scnhdr_out (abfd, in, out)
        (_("%s: warning: %s: line number overflow: 0x%lx > 0xffff"),
         bfd_get_filename (abfd),
         buf, scnhdr_int->s_nlnno);
        (_("%s: warning: %s: line number overflow: 0x%lx > 0xffff"),
         bfd_get_filename (abfd),
         buf, scnhdr_int->s_nlnno);
-      PUTHALF (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nlnno);
+      PUT_SCNHDR_NLNNO(abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nlnno);
     }
     }
-  if (scnhdr_int->s_nreloc <= 0xffff)
-    PUTHALF(abfd, scnhdr_int->s_nreloc, (bfd_byte *) scnhdr_ext->s_nreloc);
+  if (scnhdr_int->s_nreloc <= MAX_SCNHDR_NRELOC)
+    PUT_SCNHDR_NRELOC(abfd, scnhdr_int->s_nreloc,
+           (bfd_byte *) scnhdr_ext->s_nreloc);
   else
     {
       char buf[sizeof (scnhdr_int->s_name) + 1];
   else
     {
       char buf[sizeof (scnhdr_int->s_name) + 1];
@@ -893,7 +895,7 @@ coff_swap_scnhdr_out (abfd, in, out)
                             bfd_get_filename (abfd),
                             buf, scnhdr_int->s_nreloc);
       bfd_set_error (bfd_error_file_truncated);
                             bfd_get_filename (abfd),
                             buf, scnhdr_int->s_nreloc);
       bfd_set_error (bfd_error_file_truncated);
-      PUTHALF (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nreloc);
+      PUT_SCNHDR_NRELOC(abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nreloc);
       ret = 0;
     }
 #endif
       ret = 0;
     }
 #endif
This page took 0.027897 seconds and 4 git commands to generate.