Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/bfd/coffswap.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* Generic COFF swapping routines, for BFD.
    2    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000
     2   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000,
     3   2001, 2002
    34   Free Software Foundation, Inc.
    45   Written by Cygnus Support.
    56
    6 This file is part of BFD, the Binary File Descriptor library.
    7 
    8 This program is free software; you can redistribute it and/or modify
    9 it under the terms of the GNU General Public License as published by
    10 the Free Software Foundation; either version 2 of the License, or
    11 (at your option) any later version.
    12 
    13 This program is distributed in the hope that it will be useful,
    14 but WITHOUT ANY WARRANTY; without even the implied warranty of
    15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 GNU General Public License for more details.
    17 
    18 You should have received a copy of the GNU General Public License
    19 along with this program; if not, write to the Free Software
    20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
     7   This file is part of BFD, the Binary File Descriptor library.
     8
     9   This program is free software; you can redistribute it and/or modify
     10   it under the terms of the GNU General Public License as published by
     11   the Free Software Foundation; either version 2 of the License, or
     12   (at your option) any later version.
     13
     14   This program is distributed in the hope that it will be useful,
     15   but WITHOUT ANY WARRANTY; without even the implied warranty of
     16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     17   GNU General Public License for more details.
     18
     19   You should have received a copy of the GNU General Public License
     20   along with this program; if not, write to the Free Software
     21   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    2122
    2223/* This file contains routines used to swap COFF data.  It is a header
     
    2829   "coff/CPU.h".  The functions will then be correct for that CPU.  */
    2930
    30 #define PUTWORD bfd_h_put_32
    31 #define PUTHALF bfd_h_put_16
    32 #define PUTBYTE bfd_h_put_8
    33 
    3431#ifndef GET_FCN_LNNOPTR
    35 #define GET_FCN_LNNOPTR(abfd, ext)  bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_lnnoptr)
     32#define GET_FCN_LNNOPTR(abfd, ext) \
     33  H_GET_32 (abfd, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr)
    3634#endif
    3735
    3836#ifndef GET_FCN_ENDNDX
    39 #define GET_FCN_ENDNDX(abfd, ext)  bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx)
     37#define GET_FCN_ENDNDX(abfd, ext) \
     38  H_GET_32 (abfd, ext->x_sym.x_fcnary.x_fcn.x_endndx)
    4039#endif
    4140
    4241#ifndef PUT_FCN_LNNOPTR
    43 #define PUT_FCN_LNNOPTR(abfd, in, ext)  PUTWORD(abfd,  in, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_lnnoptr)
     42#define PUT_FCN_LNNOPTR(abfd, in, ext) \
     43  H_PUT_32 (abfd,  in, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr)
    4444#endif
    4545#ifndef PUT_FCN_ENDNDX
    46 #define PUT_FCN_ENDNDX(abfd, in, ext) PUTWORD(abfd, in, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx)
     46#define PUT_FCN_ENDNDX(abfd, in, ext) \
     47  H_PUT_32 (abfd, in, ext->x_sym.x_fcnary.x_fcn.x_endndx)
    4748#endif
    4849#ifndef GET_LNSZ_LNNO
    49 #define GET_LNSZ_LNNO(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_misc.x_lnsz.x_lnno)
     50#define GET_LNSZ_LNNO(abfd, ext) \
     51  H_GET_16 (abfd, ext->x_sym.x_misc.x_lnsz.x_lnno)
    5052#endif
    5153#ifndef GET_LNSZ_SIZE
    52 #define GET_LNSZ_SIZE(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_misc.x_lnsz.x_size)
     54#define GET_LNSZ_SIZE(abfd, ext) \
     55  H_GET_16 (abfd, ext->x_sym.x_misc.x_lnsz.x_size)
    5356#endif
    5457#ifndef PUT_LNSZ_LNNO
    55 #define PUT_LNSZ_LNNO(abfd, in, ext) bfd_h_put_16(abfd, in, (bfd_byte *)ext->x_sym.x_misc.x_lnsz.x_lnno)
     58#define PUT_LNSZ_LNNO(abfd, in, ext) \
     59  H_PUT_16 (abfd, in, ext->x_sym.x_misc.x_lnsz.x_lnno)
    5660#endif
    5761#ifndef PUT_LNSZ_SIZE
    58 #define PUT_LNSZ_SIZE(abfd, in, ext) bfd_h_put_16(abfd, in, (bfd_byte*) ext->x_sym.x_misc.x_lnsz.x_size)
     62#define PUT_LNSZ_SIZE(abfd, in, ext) \
     63  H_PUT_16 (abfd, in, ext->x_sym.x_misc.x_lnsz.x_size)
    5964#endif
    6065#ifndef GET_SCN_SCNLEN
    61 #define GET_SCN_SCNLEN(abfd,  ext) bfd_h_get_32(abfd, (bfd_byte *) ext->x_scn.x_scnlen)
     66#define GET_SCN_SCNLEN(abfd, ext) \
     67  H_GET_32 (abfd, ext->x_scn.x_scnlen)
    6268#endif
    6369#ifndef GET_SCN_NRELOC
    64 #define GET_SCN_NRELOC(abfd,  ext) bfd_h_get_16(abfd, (bfd_byte *)ext->x_scn.x_nreloc)
     70#define GET_SCN_NRELOC(abfd, ext) \
     71  H_GET_16 (abfd, ext->x_scn.x_nreloc)
    6572#endif
    6673#ifndef GET_SCN_NLINNO
    67 #define GET_SCN_NLINNO(abfd, ext)  bfd_h_get_16(abfd, (bfd_byte *)ext->x_scn.x_nlinno)
     74#define GET_SCN_NLINNO(abfd, ext) \
     75  H_GET_16 (abfd, ext->x_scn.x_nlinno)
    6876#endif
    6977#ifndef PUT_SCN_SCNLEN
    70 #define PUT_SCN_SCNLEN(abfd,in, ext) bfd_h_put_32(abfd, in, (bfd_byte *) ext->x_scn.x_scnlen)
     78#define PUT_SCN_SCNLEN(abfd, in, ext) \
     79  H_PUT_32 (abfd, in, ext->x_scn.x_scnlen)
    7180#endif
    7281#ifndef PUT_SCN_NRELOC
    73 #define PUT_SCN_NRELOC(abfd,in, ext) bfd_h_put_16(abfd, in, (bfd_byte *)ext->x_scn.x_nreloc)
     82#define PUT_SCN_NRELOC(abfd, in, ext) \
     83  H_PUT_16 (abfd, in, ext->x_scn.x_nreloc)
    7484#endif
    7585#ifndef PUT_SCN_NLINNO
    76 #define PUT_SCN_NLINNO(abfd,in, ext)  bfd_h_put_16(abfd,in, (bfd_byte  *) ext->x_scn.x_nlinno)
     86#define PUT_SCN_NLINNO(abfd, in, ext) \
     87  H_PUT_16 (abfd, in, ext->x_scn.x_nlinno)
    7788#endif
    7889#ifndef GET_LINENO_LNNO
    79 #define GET_LINENO_LNNO(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) (ext->l_lnno));
     90#define GET_LINENO_LNNO(abfd, ext) \
     91  H_GET_16 (abfd, ext->l_lnno);
    8092#endif
    8193#ifndef PUT_LINENO_LNNO
    82 #define PUT_LINENO_LNNO(abfd,val, ext) bfd_h_put_16(abfd,val,  (bfd_byte *) (ext->l_lnno));
     94#define PUT_LINENO_LNNO(abfd, val, ext) \
     95  H_PUT_16 (abfd, val, ext->l_lnno);
    8396#endif
    8497
    8598/* The f_symptr field in the filehdr is sometimes 64 bits.  */
    8699#ifndef GET_FILEHDR_SYMPTR
    87 #define GET_FILEHDR_SYMPTR bfd_h_get_32
     100#define GET_FILEHDR_SYMPTR H_GET_32
    88101#endif
    89102#ifndef PUT_FILEHDR_SYMPTR
    90 #define PUT_FILEHDR_SYMPTR bfd_h_put_32
     103#define PUT_FILEHDR_SYMPTR H_PUT_32
    91104#endif
    92105
    93106/* Some fields in the aouthdr are sometimes 64 bits.  */
    94107#ifndef GET_AOUTHDR_TSIZE
    95 #define GET_AOUTHDR_TSIZE bfd_h_get_32
     108#define GET_AOUTHDR_TSIZE H_GET_32
    96109#endif
    97110#ifndef PUT_AOUTHDR_TSIZE
    98 #define PUT_AOUTHDR_TSIZE bfd_h_put_32
     111#define PUT_AOUTHDR_TSIZE H_PUT_32
    99112#endif
    100113#ifndef GET_AOUTHDR_DSIZE
    101 #define GET_AOUTHDR_DSIZE bfd_h_get_32
     114#define GET_AOUTHDR_DSIZE H_GET_32
    102115#endif
    103116#ifndef PUT_AOUTHDR_DSIZE
    104 #define PUT_AOUTHDR_DSIZE bfd_h_put_32
     117#define PUT_AOUTHDR_DSIZE H_PUT_32
    105118#endif
    106119#ifndef GET_AOUTHDR_BSIZE
    107 #define GET_AOUTHDR_BSIZE bfd_h_get_32
     120#define GET_AOUTHDR_BSIZE H_GET_32
    108121#endif
    109122#ifndef PUT_AOUTHDR_BSIZE
    110 #define PUT_AOUTHDR_BSIZE bfd_h_put_32
     123#define PUT_AOUTHDR_BSIZE H_PUT_32
    111124#endif
    112125#ifndef GET_AOUTHDR_ENTRY
    113 #define GET_AOUTHDR_ENTRY bfd_h_get_32
     126#define GET_AOUTHDR_ENTRY H_GET_32
    114127#endif
    115128#ifndef PUT_AOUTHDR_ENTRY
    116 #define PUT_AOUTHDR_ENTRY bfd_h_put_32
     129#define PUT_AOUTHDR_ENTRY H_PUT_32
    117130#endif
    118131#ifndef GET_AOUTHDR_TEXT_START
    119 #define GET_AOUTHDR_TEXT_START bfd_h_get_32
     132#define GET_AOUTHDR_TEXT_START H_GET_32
    120133#endif
    121134#ifndef PUT_AOUTHDR_TEXT_START
    122 #define PUT_AOUTHDR_TEXT_START bfd_h_put_32
     135#define PUT_AOUTHDR_TEXT_START H_PUT_32
    123136#endif
    124137#ifndef GET_AOUTHDR_DATA_START
    125 #define GET_AOUTHDR_DATA_START bfd_h_get_32
     138#define GET_AOUTHDR_DATA_START H_GET_32
    126139#endif
    127140#ifndef PUT_AOUTHDR_DATA_START
    128 #define PUT_AOUTHDR_DATA_START bfd_h_put_32
     141#define PUT_AOUTHDR_DATA_START H_PUT_32
    129142#endif
    130143
    131144/* Some fields in the scnhdr are sometimes 64 bits.  */
    132145#ifndef GET_SCNHDR_PADDR
    133 #define GET_SCNHDR_PADDR bfd_h_get_32
     146#define GET_SCNHDR_PADDR H_GET_32
    134147#endif
    135148#ifndef PUT_SCNHDR_PADDR
    136 #define PUT_SCNHDR_PADDR bfd_h_put_32
     149#define PUT_SCNHDR_PADDR H_PUT_32
    137150#endif
    138151#ifndef GET_SCNHDR_VADDR
    139 #define GET_SCNHDR_VADDR bfd_h_get_32
     152#define GET_SCNHDR_VADDR H_GET_32
    140153#endif
    141154#ifndef PUT_SCNHDR_VADDR
    142 #define PUT_SCNHDR_VADDR bfd_h_put_32
     155#define PUT_SCNHDR_VADDR H_PUT_32
    143156#endif
    144157#ifndef GET_SCNHDR_SIZE
    145 #define GET_SCNHDR_SIZE bfd_h_get_32
     158#define GET_SCNHDR_SIZE H_GET_32
    146159#endif
    147160#ifndef PUT_SCNHDR_SIZE
    148 #define PUT_SCNHDR_SIZE bfd_h_put_32
     161#define PUT_SCNHDR_SIZE H_PUT_32
    149162#endif
    150163#ifndef GET_SCNHDR_SCNPTR
    151 #define GET_SCNHDR_SCNPTR bfd_h_get_32
     164#define GET_SCNHDR_SCNPTR H_GET_32
    152165#endif
    153166#ifndef PUT_SCNHDR_SCNPTR
    154 #define PUT_SCNHDR_SCNPTR bfd_h_put_32
     167#define PUT_SCNHDR_SCNPTR H_PUT_32
    155168#endif
    156169#ifndef GET_SCNHDR_RELPTR
    157 #define GET_SCNHDR_RELPTR bfd_h_get_32
     170#define GET_SCNHDR_RELPTR H_GET_32
    158171#endif
    159172#ifndef PUT_SCNHDR_RELPTR
    160 #define PUT_SCNHDR_RELPTR bfd_h_put_32
     173#define PUT_SCNHDR_RELPTR H_PUT_32
    161174#endif
    162175#ifndef GET_SCNHDR_LNNOPTR
    163 #define GET_SCNHDR_LNNOPTR bfd_h_get_32
     176#define GET_SCNHDR_LNNOPTR H_GET_32
    164177#endif
    165178#ifndef PUT_SCNHDR_LNNOPTR
    166 #define PUT_SCNHDR_LNNOPTR bfd_h_put_32
     179#define PUT_SCNHDR_LNNOPTR H_PUT_32
    167180#endif
    168181#ifndef GET_SCNHDR_NRELOC
    169 #define GET_SCNHDR_NRELOC bfd_h_get_16
     182#define GET_SCNHDR_NRELOC H_GET_16
    170183#endif
    171184#ifndef MAX_SCNHDR_NRELOC
     
    173186#endif
    174187#ifndef PUT_SCNHDR_NRELOC
    175 #define PUT_SCNHDR_NRELOC bfd_h_put_16
     188#define PUT_SCNHDR_NRELOC H_PUT_16
    176189#endif
    177190#ifndef GET_SCNHDR_NLNNO
    178 #define GET_SCNHDR_NLNNO bfd_h_get_16
     191#define GET_SCNHDR_NLNNO H_GET_16
    179192#endif
    180193#ifndef MAX_SCNHDR_NLNNO
     
    182195#endif
    183196#ifndef PUT_SCNHDR_NLNNO
    184 #define PUT_SCNHDR_NLNNO bfd_h_put_16
     197#define PUT_SCNHDR_NLNNO H_PUT_16
    185198#endif
    186199#ifndef GET_SCNHDR_FLAGS
    187 #define GET_SCNHDR_FLAGS bfd_h_get_32
     200#define GET_SCNHDR_FLAGS H_GET_32
    188201#endif
    189202#ifndef PUT_SCNHDR_FLAGS
    190 #define PUT_SCNHDR_FLAGS bfd_h_put_32
     203#define PUT_SCNHDR_FLAGS H_PUT_32
    191204#endif
    192205
    193206#ifndef GET_RELOC_VADDR
    194 #define GET_RELOC_VADDR bfd_h_get_32
     207#define GET_RELOC_VADDR H_GET_32
    195208#endif
    196209#ifndef PUT_RELOC_VADDR
    197 #define PUT_RELOC_VADDR bfd_h_put_32
     210#define PUT_RELOC_VADDR H_PUT_32
    198211#endif
    199212
     
    230243  struct internal_reloc *reloc_dst = (struct internal_reloc *) dst;
    231244
    232   reloc_dst->r_vaddr = GET_RELOC_VADDR (abfd, (bfd_byte *)reloc_src->r_vaddr);
    233   reloc_dst->r_symndx = bfd_h_get_signed_32(abfd, (bfd_byte *) reloc_src->r_symndx);
    234 
    235 #ifdef RS6000COFF_C
    236   reloc_dst->r_type = bfd_h_get_8(abfd, reloc_src->r_type);
    237   reloc_dst->r_size = bfd_h_get_8(abfd, reloc_src->r_size);
    238 #else
    239   reloc_dst->r_type = bfd_h_get_16(abfd, (bfd_byte *) reloc_src->r_type);
    240 #endif
     245  reloc_dst->r_vaddr = GET_RELOC_VADDR (abfd, reloc_src->r_vaddr);
     246  reloc_dst->r_symndx = H_GET_S32 (abfd, reloc_src->r_symndx);
     247  reloc_dst->r_type = H_GET_16 (abfd, reloc_src->r_type);
    241248
    242249#ifdef SWAP_IN_RELOC_OFFSET
    243   reloc_dst->r_offset = SWAP_IN_RELOC_OFFSET(abfd,
    244                                              (bfd_byte *) reloc_src->r_offset);
     250  reloc_dst->r_offset = SWAP_IN_RELOC_OFFSET (abfd, reloc_src->r_offset);
    245251#endif
    246252}
     
    248254static unsigned int
    249255coff_swap_reloc_out (abfd, src, dst)
    250      bfd       *abfd;
    251      PTR        src;
    252      PTR        dst;
    253 {
    254   struct internal_reloc *reloc_src = (struct internal_reloc *)src;
    255   struct external_reloc *reloc_dst = (struct external_reloc *)dst;
    256   PUT_RELOC_VADDR (abfd, reloc_src->r_vaddr, (bfd_byte *) reloc_dst->r_vaddr);
    257   bfd_h_put_32(abfd, reloc_src->r_symndx, (bfd_byte *) reloc_dst->r_symndx);
    258 
    259 #ifdef RS6000COFF_C
    260   bfd_h_put_8 (abfd, reloc_src->r_type, (bfd_byte *) reloc_dst->r_type);
    261   bfd_h_put_8 (abfd, reloc_src->r_size, (bfd_byte *) reloc_dst->r_size);
    262 #else
    263   bfd_h_put_16(abfd, reloc_src->r_type, (bfd_byte *)
    264                reloc_dst->r_type);
    265 #endif
     256     bfd *abfd;
     257     PTR src;
     258     PTR dst;
     259{
     260  struct internal_reloc *reloc_src = (struct internal_reloc *) src;
     261  struct external_reloc *reloc_dst = (struct external_reloc *) dst;
     262  PUT_RELOC_VADDR (abfd, reloc_src->r_vaddr, reloc_dst->r_vaddr);
     263  H_PUT_32 (abfd, reloc_src->r_symndx, reloc_dst->r_symndx);
     264  H_PUT_16 (abfd, reloc_src->r_type, reloc_dst->r_type);
    266265
    267266#ifdef SWAP_OUT_RELOC_OFFSET
    268   SWAP_OUT_RELOC_OFFSET(abfd,
    269                         reloc_src->r_offset,
    270                         (bfd_byte *) reloc_dst->r_offset);
     267  SWAP_OUT_RELOC_OFFSET (abfd, reloc_src->r_offset, reloc_dst->r_offset);
    271268#endif
    272269#ifdef SWAP_OUT_RELOC_EXTRA
    273   SWAP_OUT_RELOC_EXTRA(abfd,reloc_src, reloc_dst);
     270  SWAP_OUT_RELOC_EXTRA (abfd, reloc_src, reloc_dst);
    274271#endif
    275272
     
    281278static void
    282279coff_swap_filehdr_in (abfd, src, dst)
    283      bfd            *abfd;
    284      PTR            src;
    285      PTR            dst;
     280     bfd *abfd;
     281     PTR src;
     282     PTR dst;
    286283{
    287284  FILHDR *filehdr_src = (FILHDR *) src;
     
    291288  COFF_ADJUST_FILEHDR_IN_PRE (abfd, src, dst);
    292289#endif
    293   filehdr_dst->f_magic = bfd_h_get_16(abfd, (bfd_byte *) filehdr_src->f_magic);
    294   filehdr_dst->f_nscns = bfd_h_get_16(abfd, (bfd_byte *)filehdr_src-> f_nscns);
    295   filehdr_dst->f_timdat = bfd_h_get_32(abfd, (bfd_byte *)filehdr_src-> f_timdat);
    296   filehdr_dst->f_symptr =
    297     GET_FILEHDR_SYMPTR (abfd, (bfd_byte *) filehdr_src->f_symptr);
    298   filehdr_dst->f_nsyms = bfd_h_get_32(abfd, (bfd_byte *)filehdr_src-> f_nsyms);
    299   filehdr_dst->f_opthdr = bfd_h_get_16(abfd, (bfd_byte *)filehdr_src-> f_opthdr);
    300   filehdr_dst->f_flags = bfd_h_get_16(abfd, (bfd_byte *)filehdr_src-> f_flags);
     290  filehdr_dst->f_magic = H_GET_16 (abfd, filehdr_src->f_magic);
     291  filehdr_dst->f_nscns = H_GET_16 (abfd, filehdr_src->f_nscns);
     292  filehdr_dst->f_timdat = H_GET_32 (abfd, filehdr_src->f_timdat);
     293  filehdr_dst->f_symptr = GET_FILEHDR_SYMPTR (abfd, filehdr_src->f_symptr);
     294  filehdr_dst->f_nsyms = H_GET_32 (abfd, filehdr_src->f_nsyms);
     295  filehdr_dst->f_opthdr = H_GET_16 (abfd, filehdr_src->f_opthdr);
     296  filehdr_dst->f_flags = H_GET_16 (abfd, filehdr_src->f_flags);
    301297#ifdef TIC80_TARGET_ID
    302   filehdr_dst->f_target_id = bfd_h_get_16(abfd, (bfd_byte *)filehdr_src-> f_target_id);
     298  filehdr_dst->f_target_id = H_GET_16 (abfd, filehdr_src->f_target_id);
    303299#endif
    304300
     
    310306static  unsigned int
    311307coff_swap_filehdr_out (abfd, in, out)
    312      bfd       *abfd;
    313      PTR        in;
    314      PTR        out;
    315 {
    316   struct internal_filehdr *filehdr_in = (struct internal_filehdr *)in;
    317   FILHDR *filehdr_out = (FILHDR *)out;
     308     bfd *abfd;
     309     PTR in;
     310     PTR out;
     311{
     312  struct internal_filehdr *filehdr_in = (struct internal_filehdr *) in;
     313  FILHDR *filehdr_out = (FILHDR *) out;
    318314
    319315#ifdef COFF_ADJUST_FILEHDR_OUT_PRE
    320316  COFF_ADJUST_FILEHDR_OUT_PRE (abfd, in, out);
    321317#endif
    322   bfd_h_put_16(abfd, filehdr_in->f_magic, (bfd_byte *) filehdr_out->f_magic);
    323   bfd_h_put_16(abfd, filehdr_in->f_nscns, (bfd_byte *) filehdr_out->f_nscns);
    324   bfd_h_put_32(abfd, filehdr_in->f_timdat, (bfd_byte *) filehdr_out->f_timdat);
    325   PUT_FILEHDR_SYMPTR (abfd, (bfd_vma) filehdr_in->f_symptr,
    326                       (bfd_byte *) filehdr_out->f_symptr);
    327   bfd_h_put_32(abfd, filehdr_in->f_nsyms, (bfd_byte *) filehdr_out->f_nsyms);
    328   bfd_h_put_16(abfd, filehdr_in->f_opthdr, (bfd_byte *) filehdr_out->f_opthdr);
    329   bfd_h_put_16(abfd, filehdr_in->f_flags, (bfd_byte *) filehdr_out->f_flags);
     318  H_PUT_16 (abfd, filehdr_in->f_magic, filehdr_out->f_magic);
     319  H_PUT_16 (abfd, filehdr_in->f_nscns, filehdr_out->f_nscns);
     320  H_PUT_32 (abfd, filehdr_in->f_timdat, filehdr_out->f_timdat);
     321  PUT_FILEHDR_SYMPTR (abfd, filehdr_in->f_symptr, filehdr_out->f_symptr);
     322  H_PUT_32 (abfd, filehdr_in->f_nsyms, filehdr_out->f_nsyms);
     323  H_PUT_16 (abfd, filehdr_in->f_opthdr, filehdr_out->f_opthdr);
     324  H_PUT_16 (abfd, filehdr_in->f_flags, filehdr_out->f_flags);
    330325#ifdef TIC80_TARGET_ID
    331   bfd_h_put_16(abfd, filehdr_in->f_target_id, (bfd_byte *) filehdr_out->f_target_id);
     326  H_PUT_16 (abfd, filehdr_in->f_target_id, filehdr_out->f_target_id);
    332327#endif
    333328
     
    342337static void
    343338coff_swap_sym_in (abfd, ext1, in1)
    344      bfd            *abfd;
     339     bfd *abfd;
    345340     PTR ext1;
    346341     PTR in1;
    347342{
    348   SYMENT *ext = (SYMENT *)ext1;
    349   struct internal_syment      *in = (struct internal_syment *)in1;
    350 
    351   if( ext->e.e_name[0] == 0) {
    352     in->_n._n_n._n_zeroes = 0;
    353     in->_n._n_n._n_offset = bfd_h_get_32(abfd, (bfd_byte *) ext->e.e.e_offset);
    354   }
    355   else {
     343  SYMENT *ext = (SYMENT *) ext1;
     344  struct internal_syment *in = (struct internal_syment *) in1;
     345
     346  if (ext->e.e_name[0] == 0)
     347    {
     348      in->_n._n_n._n_zeroes = 0;
     349      in->_n._n_n._n_offset = H_GET_32 (abfd, ext->e.e.e_offset);
     350    }
     351  else
     352    {
    356353#if SYMNMLEN != E_SYMNMLEN
    357    -> Error, we need to cope with truncating or extending SYMNMLEN!;
     354      -> Error, we need to cope with truncating or extending SYMNMLEN!;
    358355#else
    359     memcpy(in->_n._n_name, ext->e.e_name, SYMNMLEN);
    360 #endif
    361   }
    362   in->n_value = bfd_h_get_32(abfd, (bfd_byte *) ext->e_value);
    363   in->n_scnum = bfd_h_get_16(abfd, (bfd_byte *) ext->e_scnum);
    364   if (sizeof (ext->e_type) == 2){
    365     in->n_type = bfd_h_get_16(abfd, (bfd_byte *) ext->e_type);
    366   }
    367   else {
    368     in->n_type = bfd_h_get_32(abfd, (bfd_byte *) ext->e_type);
    369   }
    370   in->n_sclass = bfd_h_get_8(abfd, ext->e_sclass);
    371   in->n_numaux = bfd_h_get_8(abfd, ext->e_numaux);
     356      memcpy (in->_n._n_name, ext->e.e_name, SYMNMLEN);
     357#endif
     358    }
     359  in->n_value = H_GET_32 (abfd, ext->e_value);
     360  in->n_scnum = H_GET_16 (abfd, ext->e_scnum);
     361  if (sizeof (ext->e_type) == 2)
     362    {
     363      in->n_type = H_GET_16 (abfd, ext->e_type);
     364    }
     365  else
     366    {
     367      in->n_type = H_GET_32 (abfd, ext->e_type);
     368    }
     369  in->n_sclass = H_GET_8 (abfd, ext->e_sclass);
     370  in->n_numaux = H_GET_8 (abfd, ext->e_numaux);
    372371#ifdef COFF_ADJUST_SYM_IN_POST
    373372  COFF_ADJUST_SYM_IN_POST (abfd, ext1, in1);
     
    377376static unsigned int
    378377coff_swap_sym_out (abfd, inp, extp)
    379      bfd       *abfd;
    380      PTR        inp;
    381      PTR        extp;
    382 {
    383   struct internal_syment *in = (struct internal_syment *)inp;
    384   SYMENT *ext =(SYMENT *)extp;
    385   if(in->_n._n_name[0] == 0) {
    386     bfd_h_put_32(abfd, 0, (bfd_byte *) ext->e.e.e_zeroes);
    387     bfd_h_put_32(abfd, in->_n._n_n._n_offset, (bfd_byte *)  ext->e.e.e_offset);
    388   }
    389   else {
     378     bfd *abfd;
     379     PTR inp;
     380     PTR extp;
     381{
     382  struct internal_syment *in = (struct internal_syment *) inp;
     383  SYMENT *ext =(SYMENT *) extp;
     384
     385#ifdef COFF_ADJUST_SYM_OUT_PRE
     386  COFF_ADJUST_SYM_OUT_PRE (abfd, inp, extp);
     387#endif
     388
     389  if (in->_n._n_name[0] == 0)
     390    {
     391      H_PUT_32 (abfd, 0, ext->e.e.e_zeroes);
     392      H_PUT_32 (abfd, in->_n._n_n._n_offset, ext->e.e.e_offset);
     393    }
     394  else
     395    {
    390396#if SYMNMLEN != E_SYMNMLEN
    391     -> Error, we need to cope with truncating or extending SYMNMLEN!;
     397      -> Error, we need to cope with truncating or extending SYMNMLEN!;
    392398#else
    393     memcpy(ext->e.e_name, in->_n._n_name, SYMNMLEN);
    394 #endif
    395   }
    396   bfd_h_put_32(abfd,  in->n_value , (bfd_byte *) ext->e_value);
    397   bfd_h_put_16(abfd,  in->n_scnum , (bfd_byte *) ext->e_scnum);
     399      memcpy (ext->e.e_name, in->_n._n_name, SYMNMLEN);
     400#endif
     401    }
     402
     403  H_PUT_32 (abfd, in->n_value, ext->e_value);
     404  H_PUT_16 (abfd, in->n_scnum, ext->e_scnum);
     405
    398406  if (sizeof (ext->e_type) == 2)
    399       {
    400         bfd_h_put_16(abfd,  in->n_type , (bfd_byte *) ext->e_type);
    401       }
     407    {
     408      H_PUT_16 (abfd, in->n_type, ext->e_type);
     409    }
    402410  else
    403       {
    404         bfd_h_put_32(abfd,  in->n_type , (bfd_byte *) ext->e_type);
    405       }
    406   bfd_h_put_8(abfd,  in->n_sclass , ext->e_sclass);
    407   bfd_h_put_8(abfd,  in->n_numaux , ext->e_numaux);
     411    {
     412      H_PUT_32 (abfd, in->n_type, ext->e_type);
     413    }
     414
     415  H_PUT_8 (abfd, in->n_sclass, ext->e_sclass);
     416  H_PUT_8 (abfd, in->n_numaux, ext->e_numaux);
     417
    408418#ifdef COFF_ADJUST_SYM_OUT_POST
    409419  COFF_ADJUST_SYM_OUT_POST (abfd, inp, extp);
    410420#endif
     421
    411422  return SYMESZ;
    412423}
     
    414425static void
    415426coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
    416      bfd            *abfd;
    417      PTR              ext1;
    418      int             type;
    419      int             class;
    420      int              indx;
    421      int              numaux;
    422      PTR              in1;
    423 {
    424   AUXENT    *ext = (AUXENT *)ext1;
    425   union internal_auxent *in = (union internal_auxent *)in1;
     427     bfd *abfd;
     428     PTR ext1;
     429     int type;
     430     int class;
     431     int indx;
     432     int numaux;
     433     PTR in1;
     434{
     435  AUXENT *ext = (AUXENT *) ext1;
     436  union internal_auxent *in = (union internal_auxent *) in1;
    426437
    427438#ifdef COFF_ADJUST_AUX_IN_PRE
    428439  COFF_ADJUST_AUX_IN_PRE (abfd, ext1, type, class, indx, numaux, in1);
    429440#endif
    430   switch (class) {
     441
     442  switch (class)
     443    {
    431444    case C_FILE:
    432       if (ext->x_file.x_fname[0] == 0) {
     445      if (ext->x_file.x_fname[0] == 0)
     446        {
    433447          in->x_file.x_n.x_zeroes = 0;
    434           in->x_file.x_n.x_offset =
    435            bfd_h_get_32(abfd, (bfd_byte *) ext->x_file.x_n.x_offset);
    436         } else {
     448          in->x_file.x_n.x_offset = H_GET_32 (abfd, ext->x_file.x_n.x_offset);
     449        }
     450      else
     451        {
    437452#if FILNMLEN != E_FILNMLEN
    438             -> Error, we need to cope with truncating or extending FILNMLEN!;
     453          -> Error, we need to cope with truncating or extending FILNMLEN!;
    439454#else
    440             if (numaux > 1)
    441               {
    442                 if (indx == 0)
    443                   memcpy (in->x_file.x_fname, ext->x_file.x_fname,
    444                           numaux * sizeof (AUXENT));
    445               }
    446             else
    447               {
    448                 memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN);
    449               }
    450 #endif
    451           }
     455          if (numaux > 1)
     456            {
     457              if (indx == 0)
     458                memcpy (in->x_file.x_fname, ext->x_file.x_fname,
     459                        numaux * sizeof (AUXENT));
     460            }
     461          else
     462            memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN);
     463#endif
     464        }
    452465      goto end;
    453466
     
    457470#endif
    458471    case C_HIDDEN:
    459       if (type == T_NULL) {
    460           in->x_scn.x_scnlen = GET_SCN_SCNLEN(abfd, ext);
    461           in->x_scn.x_nreloc = GET_SCN_NRELOC(abfd, ext);
    462           in->x_scn.x_nlinno = GET_SCN_NLINNO(abfd, ext);
     472      if (type == T_NULL)
     473        {
     474          in->x_scn.x_scnlen = GET_SCN_SCNLEN (abfd, ext);
     475          in->x_scn.x_nreloc = GET_SCN_NRELOC (abfd, ext);
     476          in->x_scn.x_nlinno = GET_SCN_NLINNO (abfd, ext);
    463477
    464478          /* PE defines some extra fields; we zero them out for
     
    473487    }
    474488
    475   in->x_sym.x_tagndx.l = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_tagndx);
     489  in->x_sym.x_tagndx.l = H_GET_32 (abfd, ext->x_sym.x_tagndx);
    476490#ifndef NO_TVNDX
    477   in->x_sym.x_tvndx = bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_tvndx);
     491  in->x_sym.x_tvndx = H_GET_16 (abfd, ext->x_sym.x_tvndx);
    478492#endif
    479493
     
    486500    {
    487501#if DIMNUM != E_DIMNUM
    488  #error we need to cope with truncating or extending DIMNUM
     502#error we need to cope with truncating or extending DIMNUM
    489503#endif
    490504      in->x_sym.x_fcnary.x_ary.x_dimen[0] =
    491         bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[0]);
     505        H_GET_16 (abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[0]);
    492506      in->x_sym.x_fcnary.x_ary.x_dimen[1] =
    493         bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[1]);
     507        H_GET_16 (abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[1]);
    494508      in->x_sym.x_fcnary.x_ary.x_dimen[2] =
    495         bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[2]);
     509        H_GET_16 (abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[2]);
    496510      in->x_sym.x_fcnary.x_ary.x_dimen[3] =
    497         bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]);
    498     }
    499 
    500   if (ISFCN(type)) {
    501     in->x_sym.x_misc.x_fsize = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_misc.x_fsize);
    502   }
    503   else {
    504     in->x_sym.x_misc.x_lnsz.x_lnno = GET_LNSZ_LNNO(abfd, ext);
    505     in->x_sym.x_misc.x_lnsz.x_size = GET_LNSZ_SIZE(abfd, ext);
    506   }
    507 
    508 end: ;
    509   /* the semicolon is because MSVC doesn't like labels at
    510      end of block.  */
     511        H_GET_16 (abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[3]);
     512    }
     513
     514  if (ISFCN (type))
     515    {
     516      in->x_sym.x_misc.x_fsize = H_GET_32 (abfd, ext->x_sym.x_misc.x_fsize);
     517    }
     518  else
     519    {
     520      in->x_sym.x_misc.x_lnsz.x_lnno = GET_LNSZ_LNNO (abfd, ext);
     521      in->x_sym.x_misc.x_lnsz.x_size = GET_LNSZ_SIZE (abfd, ext);
     522    }
     523
     524 end: ;
    511525
    512526#ifdef COFF_ADJUST_AUX_IN_POST
     
    517531static unsigned int
    518532coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
    519      bfd   *abfd;
    520      PTR        inp;
    521      int   type;
    522      int   class;
    523      int   indx ATTRIBUTE_UNUSED;
    524      int   numaux ATTRIBUTE_UNUSED;
    525      PTR        extp;
    526 {
    527   union internal_auxent *in = (union internal_auxent *)inp;
    528   AUXENT *ext = (AUXENT *)extp;
     533     bfd *abfd;
     534     PTR inp;
     535     int type;
     536     int class;
     537     int indx ATTRIBUTE_UNUSED;
     538     int numaux ATTRIBUTE_UNUSED;
     539     PTR extp;
     540{
     541  union internal_auxent *in = (union internal_auxent *) inp;
     542  AUXENT *ext = (AUXENT *) extp;
    529543
    530544#ifdef COFF_ADJUST_AUX_OUT_PRE
    531545  COFF_ADJUST_AUX_OUT_PRE (abfd, inp, type, class, indx, numaux, extp);
    532546#endif
    533   memset((PTR)ext, 0, AUXESZ);
    534   switch (class) {
    535   case C_FILE:
    536     if (in->x_file.x_fname[0] == 0) {
    537       PUTWORD(abfd, 0, (bfd_byte *) ext->x_file.x_n.x_zeroes);
    538       PUTWORD(abfd,
    539               in->x_file.x_n.x_offset,
    540               (bfd_byte *) ext->x_file.x_n.x_offset);
    541     }
    542     else {
     547
     548  memset ((PTR)ext, 0, AUXESZ);
     549
     550  switch (class)
     551    {
     552    case C_FILE:
     553      if (in->x_file.x_fname[0] == 0)
     554        {
     555          H_PUT_32 (abfd, 0, ext->x_file.x_n.x_zeroes);
     556          H_PUT_32 (abfd, in->x_file.x_n.x_offset, ext->x_file.x_n.x_offset);
     557        }
     558      else
     559        {
    543560#if FILNMLEN != E_FILNMLEN
    544       -> Error, we need to cope with truncating or extending FILNMLEN!;
     561          -> Error, we need to cope with truncating or extending FILNMLEN!;
    545562#else
    546       memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN);
    547 #endif
    548     }
    549     goto end;
    550 
    551   case C_STAT:
     563          memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN);
     564#endif
     565        }
     566      goto end;
     567
     568    case C_STAT:
    552569#ifdef C_LEAFSTAT
    553   case C_LEAFSTAT:
    554 #endif
    555   case C_HIDDEN:
    556     if (type == T_NULL) {
    557       PUT_SCN_SCNLEN(abfd, in->x_scn.x_scnlen, ext);
    558       PUT_SCN_NRELOC(abfd, in->x_scn.x_nreloc, ext);
    559       PUT_SCN_NLINNO(abfd, in->x_scn.x_nlinno, ext);
    560       goto end;
    561     }
    562     break;
    563   }
    564 
    565   PUTWORD(abfd, in->x_sym.x_tagndx.l, (bfd_byte *) ext->x_sym.x_tagndx);
     570    case C_LEAFSTAT:
     571#endif
     572    case C_HIDDEN:
     573      if (type == T_NULL)
     574        {
     575          PUT_SCN_SCNLEN (abfd, in->x_scn.x_scnlen, ext);
     576          PUT_SCN_NRELOC (abfd, in->x_scn.x_nreloc, ext);
     577          PUT_SCN_NLINNO (abfd, in->x_scn.x_nlinno, ext);
     578          goto end;
     579        }
     580      break;
     581    }
     582
     583  H_PUT_32 (abfd, in->x_sym.x_tagndx.l, ext->x_sym.x_tagndx);
    566584#ifndef NO_TVNDX
    567   bfd_h_put_16(abfd, in->x_sym.x_tvndx , (bfd_byte *) ext->x_sym.x_tvndx);
     585  H_PUT_16 (abfd, in->x_sym.x_tvndx, ext->x_sym.x_tvndx);
    568586#endif
    569587
    570588  if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class))
    571589    {
    572       PUT_FCN_LNNOPTR(abfd, in->x_sym.x_fcnary.x_fcn.x_lnnoptr, ext);
    573       PUT_FCN_ENDNDX(abfd, in->x_sym.x_fcnary.x_fcn.x_endndx.l, ext);
     590      PUT_FCN_LNNOPTR (abfd, in->x_sym.x_fcnary.x_fcn.x_lnnoptr, ext);
     591      PUT_FCN_ENDNDX (abfd, in->x_sym.x_fcnary.x_fcn.x_endndx.l, ext);
    574592    }
    575593  else
    576594    {
    577595#if DIMNUM != E_DIMNUM
    578  #error we need to cope with truncating or extending DIMNUM
    579 #endif
    580       bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[0],
    581                     (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[0]);
    582       bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[1],
    583                     (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[1]);
    584       bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[2],
    585                     (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[2]);
    586       bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[3],
    587                     (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]);
     596#error we need to cope with truncating or extending DIMNUM
     597#endif
     598      H_PUT_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[0],
     599              ext->x_sym.x_fcnary.x_ary.x_dimen[0]);
     600      H_PUT_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[1],
     601              ext->x_sym.x_fcnary.x_ary.x_dimen[1]);
     602      H_PUT_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[2],
     603              ext->x_sym.x_fcnary.x_ary.x_dimen[2]);
     604      H_PUT_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[3],
     605              ext->x_sym.x_fcnary.x_ary.x_dimen[3]);
    588606    }
    589607
    590608  if (ISFCN (type))
    591     PUTWORD (abfd, in->x_sym.x_misc.x_fsize,
    592              (bfd_byte *)  ext->x_sym.x_misc.x_fsize);
     609    H_PUT_32 (abfd, in->x_sym.x_misc.x_fsize, ext->x_sym.x_misc.x_fsize);
    593610  else
    594611    {
     
    597614    }
    598615
    599 end:
     616 end:
    600617#ifdef COFF_ADJUST_AUX_OUT_POST
    601618  COFF_ADJUST_AUX_OUT_POST (abfd, inp, type, class, indx, numaux, extp);
     
    610627static void
    611628coff_swap_lineno_in (abfd, ext1, in1)
    612      bfd            *abfd;
     629     bfd *abfd;
    613630     PTR ext1;
    614631     PTR in1;
    615632{
    616   LINENO *ext = (LINENO *)ext1;
    617   struct internal_lineno      *in = (struct internal_lineno *)in1;
    618 
    619   in->l_addr.l_symndx = bfd_h_get_32(abfd, (bfd_byte *) ext->l_addr.l_symndx);
    620   in->l_lnno = GET_LINENO_LNNO(abfd, ext);
     633  LINENO *ext = (LINENO *) ext1;
     634  struct internal_lineno *in = (struct internal_lineno *) in1;
     635
     636  in->l_addr.l_symndx = H_GET_32 (abfd, ext->l_addr.l_symndx);
     637  in->l_lnno = GET_LINENO_LNNO (abfd, ext);
    621638}
    622639
    623640static unsigned int
    624641coff_swap_lineno_out (abfd, inp, outp)
    625      bfd       *abfd;
    626      PTR        inp;
    627      PTR        outp;
    628 {
    629   struct internal_lineno *in = (struct internal_lineno *)inp;
    630   struct external_lineno *ext = (struct external_lineno *)outp;
    631   PUTWORD(abfd, in->l_addr.l_symndx, (bfd_byte *)
    632           ext->l_addr.l_symndx);
     642     bfd *abfd;
     643     PTR inp;
     644     PTR outp;
     645{
     646  struct internal_lineno *in = (struct internal_lineno *) inp;
     647  struct external_lineno *ext = (struct external_lineno *) outp;
     648  H_PUT_32 (abfd, in->l_addr.l_symndx, ext->l_addr.l_symndx);
    633649
    634650  PUT_LINENO_LNNO (abfd, in->l_lnno, ext);
     
    640656static void
    641657coff_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1)
    642      bfd            *abfd;
     658     bfd *abfd;
    643659     PTR aouthdr_ext1;
    644660     PTR aouthdr_int1;
    645661{
    646   AOUTHDR        *aouthdr_ext = (AOUTHDR *) aouthdr_ext1;
    647   struct internal_aouthdr *aouthdr_int = (struct internal_aouthdr *)aouthdr_int1;
    648 
    649   aouthdr_int->magic = bfd_h_get_16(abfd, (bfd_byte *) aouthdr_ext->magic);
    650   aouthdr_int->vstamp = bfd_h_get_16(abfd, (bfd_byte *) aouthdr_ext->vstamp);
    651   aouthdr_int->tsize =
    652     GET_AOUTHDR_TSIZE (abfd, (bfd_byte *) aouthdr_ext->tsize);
    653   aouthdr_int->dsize =
    654     GET_AOUTHDR_DSIZE (abfd, (bfd_byte *) aouthdr_ext->dsize);
    655   aouthdr_int->bsize =
    656     GET_AOUTHDR_BSIZE (abfd, (bfd_byte *) aouthdr_ext->bsize);
    657   aouthdr_int->entry =
    658     GET_AOUTHDR_ENTRY (abfd, (bfd_byte *) aouthdr_ext->entry);
     662  AOUTHDR *aouthdr_ext;
     663  struct internal_aouthdr *aouthdr_int;
     664
     665  aouthdr_ext = (AOUTHDR *) aouthdr_ext1;
     666  aouthdr_int = (struct internal_aouthdr *) aouthdr_int1;
     667  aouthdr_int->magic = H_GET_16 (abfd, aouthdr_ext->magic);
     668  aouthdr_int->vstamp = H_GET_16 (abfd, aouthdr_ext->vstamp);
     669  aouthdr_int->tsize = GET_AOUTHDR_TSIZE (abfd, aouthdr_ext->tsize);
     670  aouthdr_int->dsize = GET_AOUTHDR_DSIZE (abfd, aouthdr_ext->dsize);
     671  aouthdr_int->bsize = GET_AOUTHDR_BSIZE (abfd, aouthdr_ext->bsize);
     672  aouthdr_int->entry = GET_AOUTHDR_ENTRY (abfd, aouthdr_ext->entry);
    659673  aouthdr_int->text_start =
    660     GET_AOUTHDR_TEXT_START (abfd, (bfd_byte *) aouthdr_ext->text_start);
     674    GET_AOUTHDR_TEXT_START (abfd, aouthdr_ext->text_start);
    661675  aouthdr_int->data_start =
    662     GET_AOUTHDR_DATA_START (abfd, (bfd_byte *) aouthdr_ext->data_start);
     676    GET_AOUTHDR_DATA_START (abfd, aouthdr_ext->data_start);
    663677
    664678#ifdef I960
    665   aouthdr_int->tagentries = bfd_h_get_32(abfd, (bfd_byte *) aouthdr_ext->tagentries);
     679  aouthdr_int->tagentries = H_GET_32 (abfd, aouthdr_ext->tagentries);
    666680#endif
    667681
    668682#ifdef APOLLO_M68
    669   bfd_h_put_32(abfd, aouthdr_int->o_inlib, (bfd_byte *) aouthdr_ext->o_inlib);
    670   bfd_h_put_32(abfd, aouthdr_int->o_sri, (bfd_byte *) aouthdr_ext->o_sri);
    671   bfd_h_put_32(abfd, aouthdr_int->vid[0], (bfd_byte *) aouthdr_ext->vid);
    672   bfd_h_put_32(abfd, aouthdr_int->vid[1], (bfd_byte *) aouthdr_ext->vid + 4);
     683  H_PUT_32 (abfd, aouthdr_int->o_inlib, aouthdr_ext->o_inlib);
     684  H_PUT_32 (abfd, aouthdr_int->o_sri, aouthdr_ext->o_sri);
     685  H_PUT_32 (abfd, aouthdr_int->vid[0], aouthdr_ext->vid);
     686  H_PUT_32 (abfd, aouthdr_int->vid[1], aouthdr_ext->vid + 4);
    673687#endif
    674688
    675689#ifdef RS6000COFF_C
    676690#ifdef XCOFF64
    677   aouthdr_int->o_toc = bfd_h_get_64(abfd, aouthdr_ext->o_toc);
     691  aouthdr_int->o_toc = H_GET_64 (abfd, aouthdr_ext->o_toc);
    678692#else
    679   aouthdr_int->o_toc = bfd_h_get_32(abfd, aouthdr_ext->o_toc);
    680 #endif
    681   aouthdr_int->o_snentry = bfd_h_get_16(abfd, aouthdr_ext->o_snentry);
    682   aouthdr_int->o_sntext = bfd_h_get_16(abfd, aouthdr_ext->o_sntext);
    683   aouthdr_int->o_sndata = bfd_h_get_16(abfd, aouthdr_ext->o_sndata);
    684   aouthdr_int->o_sntoc = bfd_h_get_16(abfd, aouthdr_ext->o_sntoc);
    685   aouthdr_int->o_snloader = bfd_h_get_16(abfd, aouthdr_ext->o_snloader);
    686   aouthdr_int->o_snbss = bfd_h_get_16(abfd, aouthdr_ext->o_snbss);
    687   aouthdr_int->o_algntext = bfd_h_get_16(abfd, aouthdr_ext->o_algntext);
    688   aouthdr_int->o_algndata = bfd_h_get_16(abfd, aouthdr_ext->o_algndata);
    689   aouthdr_int->o_modtype = bfd_h_get_16(abfd, aouthdr_ext->o_modtype);
    690   aouthdr_int->o_cputype = bfd_h_get_16(abfd, aouthdr_ext->o_cputype);
     693  aouthdr_int->o_toc = H_GET_32 (abfd, aouthdr_ext->o_toc);
     694#endif
     695  aouthdr_int->o_snentry  = H_GET_16 (abfd, aouthdr_ext->o_snentry);
     696  aouthdr_int->o_sntext   = H_GET_16 (abfd, aouthdr_ext->o_sntext);
     697  aouthdr_int->o_sndata   = H_GET_16 (abfd, aouthdr_ext->o_sndata);
     698  aouthdr_int->o_sntoc    = H_GET_16 (abfd, aouthdr_ext->o_sntoc);
     699  aouthdr_int->o_snloader = H_GET_16 (abfd, aouthdr_ext->o_snloader);
     700  aouthdr_int->o_snbss    = H_GET_16 (abfd, aouthdr_ext->o_snbss);
     701  aouthdr_int->o_algntext = H_GET_16 (abfd, aouthdr_ext->o_algntext);
     702  aouthdr_int->o_algndata = H_GET_16 (abfd, aouthdr_ext->o_algndata);
     703  aouthdr_int->o_modtype  = H_GET_16 (abfd, aouthdr_ext->o_modtype);
     704  aouthdr_int->o_cputype  = H_GET_16 (abfd, aouthdr_ext->o_cputype);
    691705#ifdef XCOFF64
    692   aouthdr_int->o_maxstack = bfd_h_get_64(abfd, aouthdr_ext->o_maxstack);
    693   aouthdr_int->o_maxdata = bfd_h_get_64(abfd, aouthdr_ext->o_maxdata);
     706  aouthdr_int->o_maxstack = H_GET_64 (abfd, aouthdr_ext->o_maxstack);
     707  aouthdr_int->o_maxdata  = H_GET_64 (abfd, aouthdr_ext->o_maxdata);
    694708#else
    695   aouthdr_int->o_maxstack = bfd_h_get_32(abfd, aouthdr_ext->o_maxstack);
    696   aouthdr_int->o_maxdata = bfd_h_get_32(abfd, aouthdr_ext->o_maxdata);
     709  aouthdr_int->o_maxstack = H_GET_32 (abfd, aouthdr_ext->o_maxstack);
     710  aouthdr_int->o_maxdata  = H_GET_32 (abfd, aouthdr_ext->o_maxdata);
    697711#endif
    698712#endif
    699713
    700714#ifdef MIPSECOFF
    701   aouthdr_int->bss_start = bfd_h_get_32(abfd, aouthdr_ext->bss_start);
    702   aouthdr_int->gp_value = bfd_h_get_32(abfd, aouthdr_ext->gp_value);
    703   aouthdr_int->gprmask = bfd_h_get_32(abfd, aouthdr_ext->gprmask);
    704   aouthdr_int->cprmask[0] = bfd_h_get_32(abfd, aouthdr_ext->cprmask[0]);
    705   aouthdr_int->cprmask[1] = bfd_h_get_32(abfd, aouthdr_ext->cprmask[1]);
    706   aouthdr_int->cprmask[2] = bfd_h_get_32(abfd, aouthdr_ext->cprmask[2]);
    707   aouthdr_int->cprmask[3] = bfd_h_get_32(abfd, aouthdr_ext->cprmask[3]);
     715  aouthdr_int->bss_start  = H_GET_32 (abfd, aouthdr_ext->bss_start);
     716  aouthdr_int->gp_value   = H_GET_32 (abfd, aouthdr_ext->gp_value);
     717  aouthdr_int->gprmask    = H_GET_32 (abfd, aouthdr_ext->gprmask);
     718  aouthdr_int->cprmask[0] = H_GET_32 (abfd, aouthdr_ext->cprmask[0]);
     719  aouthdr_int->cprmask[1] = H_GET_32 (abfd, aouthdr_ext->cprmask[1]);
     720  aouthdr_int->cprmask[2] = H_GET_32 (abfd, aouthdr_ext->cprmask[2]);
     721  aouthdr_int->cprmask[3] = H_GET_32 (abfd, aouthdr_ext->cprmask[3]);
    708722#endif
    709723
    710724#ifdef ALPHAECOFF
    711   aouthdr_int->bss_start = bfd_h_get_64(abfd, aouthdr_ext->bss_start);
    712   aouthdr_int->gp_value = bfd_h_get_64(abfd, aouthdr_ext->gp_value);
    713   aouthdr_int->gprmask = bfd_h_get_32(abfd, aouthdr_ext->gprmask);
    714   aouthdr_int->fprmask = bfd_h_get_32(abfd, aouthdr_ext->fprmask);
     725  aouthdr_int->bss_start = H_GET_64 (abfd, aouthdr_ext->bss_start);
     726  aouthdr_int->gp_value  = H_GET_64 (abfd, aouthdr_ext->gp_value);
     727  aouthdr_int->gprmask   = H_GET_32 (abfd, aouthdr_ext->gprmask);
     728  aouthdr_int->fprmask   = H_GET_32 (abfd, aouthdr_ext->fprmask);
    715729#endif
    716730}
     
    718732static unsigned int
    719733coff_swap_aouthdr_out (abfd, in, out)
    720      bfd       *abfd;
    721      PTR        in;
    722      PTR        out;
    723 {
    724   struct internal_aouthdr *aouthdr_in = (struct internal_aouthdr *)in;
    725   AOUTHDR *aouthdr_out = (AOUTHDR *)out;
    726 
    727   bfd_h_put_16(abfd, aouthdr_in->magic, (bfd_byte *) aouthdr_out->magic);
    728   bfd_h_put_16(abfd, aouthdr_in->vstamp, (bfd_byte *) aouthdr_out->vstamp);
    729   PUT_AOUTHDR_TSIZE (abfd, aouthdr_in->tsize, (bfd_byte *) aouthdr_out->tsize);
    730   PUT_AOUTHDR_DSIZE (abfd, aouthdr_in->dsize, (bfd_byte *) aouthdr_out->dsize);
    731   PUT_AOUTHDR_BSIZE (abfd, aouthdr_in->bsize, (bfd_byte *) aouthdr_out->bsize);
    732   PUT_AOUTHDR_ENTRY (abfd, aouthdr_in->entry, (bfd_byte *) aouthdr_out->entry);
     734     bfd *abfd;
     735     PTR in;
     736     PTR out;
     737{
     738  struct internal_aouthdr *aouthdr_in = (struct internal_aouthdr *) in;
     739  AOUTHDR *aouthdr_out = (AOUTHDR *) out;
     740
     741  H_PUT_16 (abfd, aouthdr_in->magic, aouthdr_out->magic);
     742  H_PUT_16 (abfd, aouthdr_in->vstamp, aouthdr_out->vstamp);
     743  PUT_AOUTHDR_TSIZE (abfd, aouthdr_in->tsize, aouthdr_out->tsize);
     744  PUT_AOUTHDR_DSIZE (abfd, aouthdr_in->dsize, aouthdr_out->dsize);
     745  PUT_AOUTHDR_BSIZE (abfd, aouthdr_in->bsize, aouthdr_out->bsize);
     746  PUT_AOUTHDR_ENTRY (abfd, aouthdr_in->entry, aouthdr_out->entry);
    733747  PUT_AOUTHDR_TEXT_START (abfd, aouthdr_in->text_start,
    734                           (bfd_byte *) aouthdr_out->text_start);
     748                          aouthdr_out->text_start);
    735749  PUT_AOUTHDR_DATA_START (abfd, aouthdr_in->data_start,
    736                           (bfd_byte *) aouthdr_out->data_start);
     750                          aouthdr_out->data_start);
    737751
    738752#ifdef I960
    739   bfd_h_put_32(abfd, aouthdr_in->tagentries, (bfd_byte *) aouthdr_out->tagentries);
     753  H_PUT_32 (abfd, aouthdr_in->tagentries, aouthdr_out->tagentries);
    740754#endif
    741755
    742756#ifdef RS6000COFF_C
    743757#ifdef XCOFF64
    744   bfd_h_put_64 (abfd, aouthdr_in->o_toc, aouthdr_out->o_toc);
     758  H_PUT_64 (abfd, aouthdr_in->o_toc, aouthdr_out->o_toc);
    745759#else
    746   bfd_h_put_32 (abfd, aouthdr_in->o_toc, aouthdr_out->o_toc);
    747 #endif
    748   bfd_h_put_16 (abfd, aouthdr_in->o_snentry, aouthdr_out->o_snentry);
    749   bfd_h_put_16 (abfd, aouthdr_in->o_sntext, aouthdr_out->o_sntext);
    750   bfd_h_put_16 (abfd, aouthdr_in->o_sndata, aouthdr_out->o_sndata);
    751   bfd_h_put_16 (abfd, aouthdr_in->o_sntoc, aouthdr_out->o_sntoc);
    752   bfd_h_put_16 (abfd, aouthdr_in->o_snloader, aouthdr_out->o_snloader);
    753   bfd_h_put_16 (abfd, aouthdr_in->o_snbss, aouthdr_out->o_snbss);
    754   bfd_h_put_16 (abfd, aouthdr_in->o_algntext, aouthdr_out->o_algntext);
    755   bfd_h_put_16 (abfd, aouthdr_in->o_algndata, aouthdr_out->o_algndata);
    756   bfd_h_put_16 (abfd, aouthdr_in->o_modtype, aouthdr_out->o_modtype);
    757   bfd_h_put_16 (abfd, aouthdr_in->o_cputype, aouthdr_out->o_cputype);
     760  H_PUT_32 (abfd, aouthdr_in->o_toc, aouthdr_out->o_toc);
     761#endif
     762  H_PUT_16 (abfd, aouthdr_in->o_snentry, aouthdr_out->o_snentry);
     763  H_PUT_16 (abfd, aouthdr_in->o_sntext, aouthdr_out->o_sntext);
     764  H_PUT_16 (abfd, aouthdr_in->o_sndata, aouthdr_out->o_sndata);
     765  H_PUT_16 (abfd, aouthdr_in->o_sntoc, aouthdr_out->o_sntoc);
     766  H_PUT_16 (abfd, aouthdr_in->o_snloader, aouthdr_out->o_snloader);
     767  H_PUT_16 (abfd, aouthdr_in->o_snbss, aouthdr_out->o_snbss);
     768  H_PUT_16 (abfd, aouthdr_in->o_algntext, aouthdr_out->o_algntext);
     769  H_PUT_16 (abfd, aouthdr_in->o_algndata, aouthdr_out->o_algndata);
     770  H_PUT_16 (abfd, aouthdr_in->o_modtype, aouthdr_out->o_modtype);
     771  H_PUT_16 (abfd, aouthdr_in->o_cputype, aouthdr_out->o_cputype);
    758772#ifdef XCOFF64
    759   bfd_h_put_64 (abfd, aouthdr_in->o_maxstack, aouthdr_out->o_maxstack);
    760   bfd_h_put_64 (abfd, aouthdr_in->o_maxdata, aouthdr_out->o_maxdata);
     773  H_PUT_64 (abfd, aouthdr_in->o_maxstack, aouthdr_out->o_maxstack);
     774  H_PUT_64 (abfd, aouthdr_in->o_maxdata, aouthdr_out->o_maxdata);
    761775#else
    762   bfd_h_put_32 (abfd, aouthdr_in->o_maxstack, aouthdr_out->o_maxstack);
    763   bfd_h_put_32 (abfd, aouthdr_in->o_maxdata, aouthdr_out->o_maxdata);
     776  H_PUT_32 (abfd, aouthdr_in->o_maxstack, aouthdr_out->o_maxstack);
     777  H_PUT_32 (abfd, aouthdr_in->o_maxdata, aouthdr_out->o_maxdata);
    764778#endif
    765779  memset (aouthdr_out->o_resv2, 0, sizeof aouthdr_out->o_resv2);
     
    771785
    772786#ifdef MIPSECOFF
    773   bfd_h_put_32(abfd, aouthdr_in->bss_start, (bfd_byte *) aouthdr_out->bss_start);
    774   bfd_h_put_32(abfd, aouthdr_in->gp_value, (bfd_byte *) aouthdr_out->gp_value);
    775   bfd_h_put_32(abfd, aouthdr_in->gprmask, (bfd_byte *) aouthdr_out->gprmask);
    776   bfd_h_put_32(abfd, aouthdr_in->cprmask[0], (bfd_byte *) aouthdr_out->cprmask[0]);
    777   bfd_h_put_32(abfd, aouthdr_in->cprmask[1], (bfd_byte *) aouthdr_out->cprmask[1]);
    778   bfd_h_put_32(abfd, aouthdr_in->cprmask[2], (bfd_byte *) aouthdr_out->cprmask[2]);
    779   bfd_h_put_32(abfd, aouthdr_in->cprmask[3], (bfd_byte *) aouthdr_out->cprmask[3]);
     787  H_PUT_32 (abfd, aouthdr_in->bss_start, aouthdr_out->bss_start);
     788  H_PUT_32 (abfd, aouthdr_in->gp_value, aouthdr_out->gp_value);
     789  H_PUT_32 (abfd, aouthdr_in->gprmask, aouthdr_out->gprmask);
     790  H_PUT_32 (abfd, aouthdr_in->cprmask[0], aouthdr_out->cprmask[0]);
     791  H_PUT_32 (abfd, aouthdr_in->cprmask[1], aouthdr_out->cprmask[1]);
     792  H_PUT_32 (abfd, aouthdr_in->cprmask[2], aouthdr_out->cprmask[2]);
     793  H_PUT_32 (abfd, aouthdr_in->cprmask[3], aouthdr_out->cprmask[3]);
    780794#endif
    781795
    782796#ifdef ALPHAECOFF
    783797  /* FIXME: What does bldrev mean?  */
    784   bfd_h_put_16(abfd, (bfd_vma) 2, (bfd_byte *) aouthdr_out->bldrev);
    785   bfd_h_put_16(abfd, (bfd_vma) 0, (bfd_byte *) aouthdr_out->padding);
    786   bfd_h_put_64(abfd, aouthdr_in->bss_start, (bfd_byte *) aouthdr_out->bss_start);
    787   bfd_h_put_64(abfd, aouthdr_in->gp_value, (bfd_byte *) aouthdr_out->gp_value);
    788   bfd_h_put_32(abfd, aouthdr_in->gprmask, (bfd_byte *) aouthdr_out->gprmask);
    789   bfd_h_put_32(abfd, aouthdr_in->fprmask, (bfd_byte *) aouthdr_out->fprmask);
     798  H_PUT_16 (abfd, 2, aouthdr_out->bldrev);
     799  H_PUT_16 (abfd, 0, aouthdr_out->padding);
     800  H_PUT_64 (abfd, aouthdr_in->bss_start, aouthdr_out->bss_start);
     801  H_PUT_64 (abfd, aouthdr_in->gp_value, aouthdr_out->gp_value);
     802  H_PUT_32 (abfd, aouthdr_in->gprmask, aouthdr_out->gprmask);
     803  H_PUT_32 (abfd, aouthdr_in->fprmask, aouthdr_out->fprmask);
    790804#endif
    791805
     
    795809static void
    796810coff_swap_scnhdr_in (abfd, ext, in)
    797      bfd            *abfd;
    798      PTR            ext;
    799      PTR            in;
     811     bfd *abfd;
     812     PTR ext;
     813     PTR in;
    800814{
    801815  SCNHDR *scnhdr_ext = (SCNHDR *) ext;
     
    805819  COFF_ADJUST_SCNHDR_IN_PRE (abfd, ext, in);
    806820#endif
    807   memcpy(scnhdr_int->s_name, scnhdr_ext->s_name, sizeof (scnhdr_int->s_name));
    808   scnhdr_int->s_vaddr =
    809     GET_SCNHDR_VADDR (abfd, (bfd_byte *) scnhdr_ext->s_vaddr);
    810   scnhdr_int->s_paddr =
    811     GET_SCNHDR_PADDR (abfd, (bfd_byte *) scnhdr_ext->s_paddr);
    812   scnhdr_int->s_size =
    813     GET_SCNHDR_SIZE (abfd, (bfd_byte *) scnhdr_ext->s_size);
    814 
    815   scnhdr_int->s_scnptr =
    816     GET_SCNHDR_SCNPTR (abfd, (bfd_byte *) scnhdr_ext->s_scnptr);
    817   scnhdr_int->s_relptr =
    818     GET_SCNHDR_RELPTR (abfd, (bfd_byte *) scnhdr_ext->s_relptr);
    819   scnhdr_int->s_lnnoptr =
    820     GET_SCNHDR_LNNOPTR (abfd, (bfd_byte *) scnhdr_ext->s_lnnoptr);
    821   scnhdr_int->s_flags =
    822     GET_SCNHDR_FLAGS (abfd, (bfd_byte *) scnhdr_ext->s_flags);
    823   scnhdr_int->s_nreloc =
    824     GET_SCNHDR_NRELOC (abfd, (bfd_byte *) scnhdr_ext->s_nreloc);
    825   scnhdr_int->s_nlnno =
    826     GET_SCNHDR_NLNNO (abfd, (bfd_byte *) scnhdr_ext->s_nlnno);
     821  memcpy (scnhdr_int->s_name, scnhdr_ext->s_name, sizeof (scnhdr_int->s_name));
     822
     823  scnhdr_int->s_vaddr = GET_SCNHDR_VADDR (abfd, scnhdr_ext->s_vaddr);
     824  scnhdr_int->s_paddr = GET_SCNHDR_PADDR (abfd, scnhdr_ext->s_paddr);
     825  scnhdr_int->s_size = GET_SCNHDR_SIZE (abfd, scnhdr_ext->s_size);
     826
     827  scnhdr_int->s_scnptr = GET_SCNHDR_SCNPTR (abfd, scnhdr_ext->s_scnptr);
     828  scnhdr_int->s_relptr = GET_SCNHDR_RELPTR (abfd, scnhdr_ext->s_relptr);
     829  scnhdr_int->s_lnnoptr = GET_SCNHDR_LNNOPTR (abfd, scnhdr_ext->s_lnnoptr);
     830  scnhdr_int->s_flags = GET_SCNHDR_FLAGS (abfd, scnhdr_ext->s_flags);
     831  scnhdr_int->s_nreloc = GET_SCNHDR_NRELOC (abfd, scnhdr_ext->s_nreloc);
     832  scnhdr_int->s_nlnno = GET_SCNHDR_NLNNO (abfd, scnhdr_ext->s_nlnno);
    827833#ifdef I960
    828   scnhdr_int->s_align =
    829     GET_SCNHDR_ALIGN (abfd, (bfd_byte *) scnhdr_ext->s_align);
     834  scnhdr_int->s_align = GET_SCNHDR_ALIGN (abfd, scnhdr_ext->s_align);
    830835#endif
    831836#ifdef COFF_ADJUST_SCNHDR_IN_POST
     
    836841static unsigned int
    837842coff_swap_scnhdr_out (abfd, in, out)
    838      bfd       *abfd;
    839      PTR        in;
    840      PTR        out;
    841 {
    842   struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *)in;
    843   SCNHDR *scnhdr_ext = (SCNHDR *)out;
     843     bfd *abfd;
     844     PTR in;
     845     PTR out;
     846{
     847  struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *) in;
     848  SCNHDR *scnhdr_ext = (SCNHDR *) out;
    844849  unsigned int ret = bfd_coff_scnhsz (abfd);
    845850
     
    847852  COFF_ADJUST_SCNHDR_OUT_PRE (abfd, in, out);
    848853#endif
    849   memcpy(scnhdr_ext->s_name, scnhdr_int->s_name, sizeof (scnhdr_int->s_name));
    850 
    851   PUT_SCNHDR_VADDR (abfd, scnhdr_int->s_vaddr,
    852                     (bfd_byte *) scnhdr_ext->s_vaddr);
    853 
    854   PUT_SCNHDR_PADDR (abfd, scnhdr_int->s_paddr,
    855                     (bfd_byte *) scnhdr_ext->s_paddr);
    856   PUT_SCNHDR_SIZE (abfd, scnhdr_int->s_size,
    857                    (bfd_byte *) scnhdr_ext->s_size);
    858 
    859   PUT_SCNHDR_SCNPTR (abfd, scnhdr_int->s_scnptr,
    860                      (bfd_byte *) scnhdr_ext->s_scnptr);
    861   PUT_SCNHDR_RELPTR (abfd, scnhdr_int->s_relptr,
    862                      (bfd_byte *) scnhdr_ext->s_relptr);
    863   PUT_SCNHDR_LNNOPTR (abfd, scnhdr_int->s_lnnoptr,
    864                       (bfd_byte *) scnhdr_ext->s_lnnoptr);
    865   PUT_SCNHDR_FLAGS (abfd, scnhdr_int->s_flags,
    866                     (bfd_byte *) scnhdr_ext->s_flags);
     854  memcpy (scnhdr_ext->s_name, scnhdr_int->s_name, sizeof (scnhdr_int->s_name));
     855
     856  PUT_SCNHDR_VADDR (abfd, scnhdr_int->s_vaddr, scnhdr_ext->s_vaddr);
     857  PUT_SCNHDR_PADDR (abfd, scnhdr_int->s_paddr, scnhdr_ext->s_paddr);
     858  PUT_SCNHDR_SIZE (abfd, scnhdr_int->s_size, scnhdr_ext->s_size);
     859  PUT_SCNHDR_SCNPTR (abfd, scnhdr_int->s_scnptr, scnhdr_ext->s_scnptr);
     860  PUT_SCNHDR_RELPTR (abfd, scnhdr_int->s_relptr, scnhdr_ext->s_relptr);
     861  PUT_SCNHDR_LNNOPTR (abfd, scnhdr_int->s_lnnoptr, scnhdr_ext->s_lnnoptr);
     862  PUT_SCNHDR_FLAGS (abfd, scnhdr_int->s_flags, scnhdr_ext->s_flags);
    867863#if defined(M88)
    868   PUTWORD(abfd, scnhdr_int->s_nlnno, (bfd_byte *) scnhdr_ext->s_nlnno);
    869   PUTWORD(abfd, scnhdr_int->s_nreloc, (bfd_byte *) scnhdr_ext->s_nreloc);
     864  H_PUT_32 (abfd, scnhdr_int->s_nlnno, scnhdr_ext->s_nlnno);
     865  H_PUT_32 (abfd, scnhdr_int->s_nreloc, scnhdr_ext->s_nreloc);
    870866#else
    871867  if (scnhdr_int->s_nlnno <= MAX_SCNHDR_NLNNO)
    872     PUT_SCNHDR_NLNNO(abfd, scnhdr_int->s_nlnno,
    873             (bfd_byte *) scnhdr_ext->s_nlnno);
     868    PUT_SCNHDR_NLNNO (abfd, scnhdr_int->s_nlnno, scnhdr_ext->s_nlnno);
    874869  else
    875870    {
     
    882877         bfd_get_filename (abfd),
    883878         buf, scnhdr_int->s_nlnno);
    884       PUT_SCNHDR_NLNNO(abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nlnno);
    885     }
     879      PUT_SCNHDR_NLNNO (abfd, 0xffff, scnhdr_ext->s_nlnno);
     880    }
     881
    886882  if (scnhdr_int->s_nreloc <= MAX_SCNHDR_NRELOC)
    887     PUT_SCNHDR_NRELOC(abfd, scnhdr_int->s_nreloc,
    888             (bfd_byte *) scnhdr_ext->s_nreloc);
     883    PUT_SCNHDR_NRELOC (abfd, scnhdr_int->s_nreloc, scnhdr_ext->s_nreloc);
    889884  else
    890885    {
     
    897892                             buf, scnhdr_int->s_nreloc);
    898893      bfd_set_error (bfd_error_file_truncated);
    899       PUT_SCNHDR_NRELOC(abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nreloc);
     894      PUT_SCNHDR_NRELOC (abfd, 0xffff, scnhdr_ext->s_nreloc);
    900895      ret = 0;
    901896    }
     
    903898
    904899#ifdef I960
    905   PUT_SCNHDR_ALIGN (abfd, scnhdr_int->s_align, (bfd_byte *) scnhdr_ext->s_align);
     900  PUT_SCNHDR_ALIGN (abfd, scnhdr_int->s_align, scnhdr_ext->s_align);
    906901#endif
    907902#ifdef COFF_ADJUST_SCNHDR_OUT_POST
Note: See TracChangeset for help on using the changeset viewer.