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/coffcode.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* Support for the generic parts of most COFF variants, for BFD.
    22   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    3    2000, 2001
     3   2000, 2001, 2002, 2003
    44   Free Software Foundation, Inc.
    55   Written by Cygnus Support.
    66
    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.  */
     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.  */
    2222
    2323/*
     
    226226        the offsets generated by the previous pass and the pointers
    227227        generated when the symbol table was read in to create the
    228         structured hierachy required by coff. It changes each pointer
     228        structured hierarchy required by coff. It changes each pointer
    229229        to a symbol into the index into the symbol table of the asymbol.
    230230
     
    249249.typedef struct coff_ptr_struct
    250250.{
    251 .
    252 .       {* Remembers the offset from the first symbol in the file for
    253 .          this symbol. Generated by coff_renumber_symbols. *}
    254 .unsigned int offset;
    255 .
    256 .       {* Should the value of this symbol be renumbered.  Used for
    257 .          XCOFF C_BSTAT symbols.  Set by coff_slurp_symbol_table.  *}
    258 .unsigned int fix_value : 1;
    259 .
    260 .       {* Should the tag field of this symbol be renumbered.
    261 .          Created by coff_pointerize_aux. *}
    262 .unsigned int fix_tag : 1;
    263 .
    264 .       {* Should the endidx field of this symbol be renumbered.
    265 .          Created by coff_pointerize_aux. *}
    266 .unsigned int fix_end : 1;
    267 .
    268 .       {* Should the x_csect.x_scnlen field be renumbered.
    269 .          Created by coff_pointerize_aux. *}
    270 .unsigned int fix_scnlen : 1;
    271 .
    272 .       {* Fix up an XCOFF C_BINCL/C_EINCL symbol.  The value is the
    273 .          index into the line number entries.  Set by
    274 .          coff_slurp_symbol_table.  *}
    275 .unsigned int fix_line : 1;
    276 .
    277 .       {* The container for the symbol structure as read and translated
    278 .           from the file. *}
    279 .
    280 .union {
    281 .   union internal_auxent auxent;
    282 .   struct internal_syment syment;
    283 . } u;
     251.  {* Remembers the offset from the first symbol in the file for
     252.     this symbol. Generated by coff_renumber_symbols. *}
     253.  unsigned int offset;
     254.
     255.  {* Should the value of this symbol be renumbered.  Used for
     256.     XCOFF C_BSTAT symbols.  Set by coff_slurp_symbol_table.  *}
     257.  unsigned int fix_value : 1;
     258.
     259.  {* Should the tag field of this symbol be renumbered.
     260.     Created by coff_pointerize_aux. *}
     261.  unsigned int fix_tag : 1;
     262.
     263.  {* Should the endidx field of this symbol be renumbered.
     264.     Created by coff_pointerize_aux. *}
     265.  unsigned int fix_end : 1;
     266.
     267.  {* Should the x_csect.x_scnlen field be renumbered.
     268.     Created by coff_pointerize_aux. *}
     269.  unsigned int fix_scnlen : 1;
     270.
     271.  {* Fix up an XCOFF C_BINCL/C_EINCL symbol.  The value is the
     272.     index into the line number entries.  Set by coff_slurp_symbol_table.  *}
     273.  unsigned int fix_line : 1;
     274.
     275.  {* The container for the symbol structure as read and translated
     276.     from the file. *}
     277.  union
     278.  {
     279.    union internal_auxent auxent;
     280.    struct internal_syment syment;
     281.  } u;
    284282.} combined_entry_type;
    285283.
     
    289287.typedef struct coff_symbol_struct
    290288.{
    291  {* The actual symbol which the rest of BFD works with *}
    292 .asymbol symbol;
    293 .
    294  {* A pointer to the hidden information for this symbol *}
    295 .combined_entry_type *native;
    296 .
    297  {* A pointer to the linenumber information for this symbol *}
    298 .struct lineno_cache_entry *lineno;
    299 .
    300  {* Have the line numbers been relocated yet ? *}
    301 .boolean done_lineno;
     289{* The actual symbol which the rest of BFD works with *}
     290.  asymbol symbol;
     291.
     292{* A pointer to the hidden information for this symbol *}
     293.  combined_entry_type *native;
     294.
     295{* A pointer to the linenumber information for this symbol *}
     296.  struct lineno_cache_entry *lineno;
     297.
     298{* Have the line numbers been relocated yet ? *}
     299.  bfd_boolean done_lineno;
    302300.} coff_symbol_type;
    303301
     
    312310#define STRING_SIZE_SIZE (4)
    313311
    314 static long sec_to_styp_flags PARAMS ((const char *, flagword));
    315 static flagword styp_to_sec_flags
    316   PARAMS ((bfd *, PTR, const char *, asection *));
    317 static boolean coff_bad_format_hook PARAMS ((bfd *, PTR));
     312static long sec_to_styp_flags
     313  PARAMS ((const char *, flagword));
     314static bfd_boolean styp_to_sec_flags
     315  PARAMS ((bfd *, PTR, const char *, asection *, flagword *));
     316static bfd_boolean coff_bad_format_hook
     317  PARAMS ((bfd *, PTR));
    318318static void coff_set_custom_section_alignment
    319319  PARAMS ((bfd *, asection *, const struct coff_section_alignment_entry *,
    320320           const unsigned int));
    321 static boolean coff_new_section_hook PARAMS ((bfd *, asection *));
    322 static boolean coff_set_arch_mach_hook PARAMS ((bfd *, PTR));
    323 static boolean coff_write_relocs PARAMS ((bfd *, int));
    324 static boolean coff_set_flags
     321static bfd_boolean coff_new_section_hook
     322  PARAMS ((bfd *, asection *));
     323static bfd_boolean coff_set_arch_mach_hook
     324  PARAMS ((bfd *, PTR));
     325static bfd_boolean coff_write_relocs
     326  PARAMS ((bfd *, int));
     327static bfd_boolean coff_set_flags
    325328  PARAMS ((bfd *, unsigned int *, unsigned short *));
    326 static boolean coff_set_arch_mach
    327   PARAMS ((bfd *, enum bfd_architecture, unsigned long));
    328 static boolean coff_compute_section_file_positions PARAMS ((bfd *));
    329 static boolean coff_write_object_contents PARAMS ((bfd *));
    330 static boolean coff_set_section_contents
     329static bfd_boolean coff_set_arch_mach
     330  PARAMS ((bfd *, enum bfd_architecture, unsigned long)) ATTRIBUTE_UNUSED;
     331static bfd_boolean coff_compute_section_file_positions
     332  PARAMS ((bfd *));
     333static bfd_boolean coff_write_object_contents
     334  PARAMS ((bfd *)) ATTRIBUTE_UNUSED;
     335static bfd_boolean coff_set_section_contents
    331336  PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
    332 static PTR buy_and_read PARAMS ((bfd *, file_ptr, int, size_t));
    333 static boolean coff_slurp_line_table PARAMS ((bfd *, asection *));
    334 static boolean coff_slurp_symbol_table PARAMS ((bfd *));
     337static PTR buy_and_read
     338  PARAMS ((bfd *, file_ptr, bfd_size_type));
     339static bfd_boolean coff_slurp_line_table
     340  PARAMS ((bfd *, asection *));
     341static bfd_boolean coff_slurp_symbol_table
     342  PARAMS ((bfd *));
    335343static enum coff_symbol_classification coff_classify_symbol
    336344  PARAMS ((bfd *, struct internal_syment *));
    337 static boolean coff_slurp_reloc_table PARAMS ((bfd *, asection *, asymbol **));
     345static bfd_boolean coff_slurp_reloc_table
     346  PARAMS ((bfd *, asection *, asymbol **));
    338347static long coff_canonicalize_reloc
    339348  PARAMS ((bfd *, asection *, arelent **, asymbol **));
    340349#ifndef coff_mkobject_hook
    341 static PTR coff_mkobject_hook PARAMS ((bfd *, PTR,  PTR));
     350static PTR coff_mkobject_hook
     351  PARAMS ((bfd *, PTR,  PTR));
    342352#endif
    343353#ifdef COFF_WITH_PE
    344 static flagword handle_COMDAT PARAMS ((bfd *, flagword, PTR, const char *, asection *));
     354static flagword handle_COMDAT
     355  PARAMS ((bfd *, flagword, PTR, const char *, asection *));
     356#endif
     357#ifdef COFF_IMAGE_WITH_PE
     358static bfd_boolean coff_read_word
     359  PARAMS ((bfd *, unsigned int *));
     360static unsigned int coff_compute_checksum
     361  PARAMS ((bfd *));
     362static bfd_boolean coff_apply_checksum
     363  PARAMS ((bfd *));
    345364#endif
    346365
     
    370389static long
    371390sec_to_styp_flags (sec_name, sec_flags)
    372      CONST char *sec_name;
     391     const char *sec_name;
    373392     flagword sec_flags;
    374393{
     
    431450    {
    432451      styp_flags = STYP_LOADER;
     452    }
     453  else if (!strcmp (sec_name, _EXCEPT))
     454    {
     455      styp_flags = STYP_EXCEPT;
     456    }
     457  else if (!strcmp (sec_name, _TYPCHK))
     458    {
     459      styp_flags = STYP_TYPCHK;
    433460    }
    434461#endif
     
    510537    styp_flags |= IMAGE_SCN_CNT_UNINITIALIZED_DATA;  /* ==STYP_BSS */
    511538  /* skip ROM */
    512   /* skip CONSTRUCTOR */
     539  /* skip constRUCTOR */
    513540  /* skip CONTENTS */
    514541#ifdef STYP_NOLOAD
     
    533560  /* For now, the read/write bits are mapped onto SEC_READONLY, even
    534561     though the semantics don't quite match.  The bits from the input
    535      are retained in pei_section_data(abfd, section)->pe_flags */
    536 
    537   styp_flags |= IMAGE_SCN_MEM_READ;       /* always readable.  */
     562     are retained in pei_section_data(abfd, section)->pe_flags. */
     563
     564  styp_flags |= IMAGE_SCN_MEM_READ;       /* Always readable.  */
    538565  if ((sec_flags & SEC_READONLY) == 0)
    539     styp_flags |= IMAGE_SCN_MEM_WRITE;    /* Invert READONLY for write */
     566    styp_flags |= IMAGE_SCN_MEM_WRITE;    /* Invert READONLY for write. */
    540567  if (sec_flags & SEC_CODE)
    541     styp_flags |= IMAGE_SCN_MEM_EXECUTE;  /* CODE->EXECUTE */
     568    styp_flags |= IMAGE_SCN_MEM_EXECUTE;  /* CODE->EXECUTE. */
    542569  if (sec_flags & SEC_SHARED)
    543     styp_flags |= IMAGE_SCN_MEM_SHARED;   /* Shared remains meaningful */
     570    styp_flags |= IMAGE_SCN_MEM_SHARED;   /* Shared remains meaningful. */
    544571
    545572  return styp_flags;
     
    555582#ifndef COFF_WITH_PE
    556583
    557 static flagword
    558 styp_to_sec_flags (abfd, hdr, name, section)
     584static bfd_boolean
     585styp_to_sec_flags (abfd, hdr, name, section, flags_ptr)
    559586     bfd *abfd ATTRIBUTE_UNUSED;
    560587     PTR hdr;
    561588     const char *name;
    562589     asection *section ATTRIBUTE_UNUSED;
     590     flagword *flags_ptr;
    563591{
    564592  struct internal_scnhdr *internal_s = (struct internal_scnhdr *) hdr;
     
    568596#ifdef STYP_BLOCK
    569597  if (styp_flags & STYP_BLOCK)
    570       sec_flags |= SEC_BLOCK;
     598    sec_flags |= SEC_BLOCK;
    571599#endif
    572600
    573601#ifdef STYP_CLINK
    574602  if (styp_flags & STYP_CLINK)
    575       sec_flags |= SEC_CLINK;
     603    sec_flags |= SEC_CLINK;
    576604#endif
    577605
    578606#ifdef STYP_NOLOAD
    579607  if (styp_flags & STYP_NOLOAD)
    580     {
    581       sec_flags |= SEC_NEVER_LOAD;
    582     }
     608    sec_flags |= SEC_NEVER_LOAD;
    583609#endif /* STYP_NOLOAD */
    584610
     
    621647    }
    622648  else if (styp_flags & STYP_PAD)
    623     {
    624       sec_flags = 0;
    625     }
     649    sec_flags = 0;
    626650  else if (strcmp (name, _TEXT) == 0)
    627651    {
     
    666690#ifdef _LIT
    667691  else if (strcmp (name, _LIT) == 0)
    668     {
    669       sec_flags = SEC_LOAD | SEC_ALLOC | SEC_READONLY;
    670     }
     692    sec_flags = SEC_LOAD | SEC_ALLOC | SEC_READONLY;
    671693#endif
    672694  else
    673     {
    674       sec_flags |= SEC_ALLOC | SEC_LOAD;
    675     }
    676 
    677 #ifdef STYP_LIT                 /* A29k readonly text/data section type */
     695    sec_flags |= SEC_ALLOC | SEC_LOAD;
     696
     697#ifdef STYP_LIT                 /* A29k readonly text/data section type.  */
    678698  if ((styp_flags & STYP_LIT) == STYP_LIT)
    679     {
    680       sec_flags = (SEC_LOAD | SEC_ALLOC | SEC_READONLY);
    681     }
     699    sec_flags = (SEC_LOAD | SEC_ALLOC | SEC_READONLY);
    682700#endif /* STYP_LIT */
    683 #ifdef STYP_OTHER_LOAD          /* Other loaded sections */
     701
     702#ifdef STYP_OTHER_LOAD          /* Other loaded sections.  */
    684703  if (styp_flags & STYP_OTHER_LOAD)
    685     {
    686       sec_flags = (SEC_LOAD | SEC_ALLOC);
    687     }
     704    sec_flags = (SEC_LOAD | SEC_ALLOC);
    688705#endif /* STYP_SDATA */
    689706
     
    699716#endif
    700717
    701   return sec_flags;
     718  if (flags_ptr == NULL)
     719    return FALSE;
     720
     721  * flags_ptr = sec_flags;
     722  return TRUE;
    702723}
    703724
     
    738759  if (! _bfd_coff_get_external_symbols (abfd))
    739760    return sec_flags;
    740  
     761
    741762  esymstart = esym = (bfd_byte *) obj_coff_external_syms (abfd);
    742763  esymend = esym + obj_raw_syment_count (abfd) * bfd_coff_symesz (abfd);
     
    783804             follows the $) as the comdat symbol.  */
    784805
    785           /* All 3 branches use this */
     806          /* All 3 branches use this. */
    786807          symname = _bfd_coff_internal_syment_name (abfd, &isym, buf);
    787808
     
    911932#define TARGET_UNDERSCORE 0
    912933#endif
    913               /* Is this the name we're looking for? */
     934              /* Is this the name we're looking for ? */
    914935              if (strcmp (target_name,
    915936                          symname + (TARGET_UNDERSCORE ? 1 : 0)) != 0)
     
    925946              {
    926947                char *newname;
    927 
    928                 /* This must the the second symbol with the
     948                bfd_size_type amt;
     949
     950                /* This must the second symbol with the
    929951                   section #.  It is the actual symbol name.
    930952                   Intel puts the two adjacent, but Alpha (at
    931953                   least) spreads them out.  */
    932954
    933                 section->comdat =
    934                   bfd_alloc (abfd, sizeof (struct bfd_comdat_info));
     955                amt = sizeof (struct bfd_comdat_info);
     956                section->comdat = bfd_alloc (abfd, amt);
    935957                if (section->comdat == NULL)
    936958                  abort ();
     
    939961                  (esym - esymstart) / bfd_coff_symesz (abfd);
    940962
    941                 newname = bfd_alloc (abfd, strlen (symname) + 1);
     963                amt = strlen (symname) + 1;
     964                newname = bfd_alloc (abfd, amt);
    942965                if (newname == NULL)
    943966                  abort ();
     
    968991   any purpose other than objdump?  */
    969992
    970 static flagword
    971 styp_to_sec_flags (abfd, hdr, name, section)
     993static bfd_boolean
     994styp_to_sec_flags (abfd, hdr, name, section, flags_ptr)
    972995     bfd *abfd;
    973996     PTR hdr;
    974997     const char *name;
    975998     asection *section;
     999     flagword *flags_ptr;
    9761000{
    9771001  struct internal_scnhdr *internal_s = (struct internal_scnhdr *) hdr;
    9781002  long styp_flags = internal_s->s_flags;
    9791003  flagword sec_flags;
     1004  bfd_boolean result = TRUE;
    9801005
    9811006  /* Assume read only unless IMAGE_SCN_MEM_WRITE is specified.  */
     
    9871012      long flag = styp_flags & - styp_flags;
    9881013      char * unhandled = NULL;
    989      
     1014
    9901015      styp_flags &= ~ flag;
    9911016
     
    10121037          sec_flags |= SEC_NEVER_LOAD;
    10131038          break;
    1014 #endif 
     1039#endif
    10151040        case IMAGE_SCN_MEM_READ:
    10161041          /* Ignored, assume it always to be true.  */
     
    10691094        default:
    10701095          /* Silently ignore for now.  */
    1071           break;         
     1096          break;
    10721097        }
    10731098
    1074       /* If the section flag was not handled, report it here.  This will allow
    1075          users of the BFD library to report a problem but continue executing.
    1076          Tools which need to be aware of these problems (such as the linker)
    1077          can override the default bfd_error_handler to intercept these reports.  */
     1099      /* If the section flag was not handled, report it here.  */
    10781100      if (unhandled != NULL)
    1079         (*_bfd_error_handler)
    1080           (_("%s (%s): Section flag %s (0x%x) ignored"),
    1081            bfd_get_filename (abfd), name, unhandled, flag);
     1101        {
     1102          (*_bfd_error_handler)
     1103            (_("%s (%s): Section flag %s (0x%x) ignored"),
     1104             bfd_archive_filename (abfd), name, unhandled, flag);
     1105          result = FALSE;
     1106        }
    10821107    }
    10831108
     
    10931118#endif
    10941119
    1095   return sec_flags;
     1120  if (flags_ptr)
     1121    * flags_ptr = sec_flags;
     1122
     1123  return result;
    10961124}
    10971125
     
    11251153.typedef struct
    11261154.{
    1127 .  void (*_bfd_coff_swap_aux_in) PARAMS ((
    1128 .       bfd            *abfd,
    1129 .       PTR             ext,
    1130 .       int             type,
    1131 .       int             class,
    1132 .       int             indaux,
    1133 .       int             numaux,
    1134 .       PTR             in));
    1135 .
    1136 .  void (*_bfd_coff_swap_sym_in) PARAMS ((
    1137 .       bfd            *abfd ,
    1138 .       PTR             ext,
    1139 .       PTR             in));
    1140 .
    1141 .  void (*_bfd_coff_swap_lineno_in) PARAMS ((
    1142 .       bfd            *abfd,
    1143 .       PTR            ext,
    1144 .       PTR             in));
    1145 .
    1146 
    1147 Special entry points for gas to swap out coff parts:
    1148 
    1149 . unsigned int (*_bfd_coff_swap_aux_out) PARAMS ((
    1150 .       bfd     *abfd,
    1151 .       PTR     in,
    1152 .       int     type,
    1153 .       int     class,
    1154 .       int     indaux,
    1155 .       int     numaux,
    1156 .       PTR     ext));
    1157 .
    1158 . unsigned int (*_bfd_coff_swap_sym_out) PARAMS ((
    1159 .      bfd      *abfd,
    1160 .      PTR      in,
    1161 .      PTR      ext));
    1162 .
    1163 . unsigned int (*_bfd_coff_swap_lineno_out) PARAMS ((
    1164 .       bfd     *abfd,
    1165 .       PTR     in,
    1166 .       PTR     ext));
    1167 .
    1168 . unsigned int (*_bfd_coff_swap_reloc_out) PARAMS ((
    1169 .       bfd     *abfd,
    1170 .       PTR     src,
    1171 .       PTR     dst));
    1172 .
    1173 . unsigned int (*_bfd_coff_swap_filehdr_out) PARAMS ((
    1174 .       bfd     *abfd,
    1175 .       PTR     in,
    1176 .       PTR     out));
    1177 .
    1178 . unsigned int (*_bfd_coff_swap_aouthdr_out) PARAMS ((
    1179 .       bfd     *abfd,
    1180 .       PTR     in,
    1181 .       PTR     out));
    1182 .
    1183 . unsigned int (*_bfd_coff_swap_scnhdr_out) PARAMS ((
    1184 .       bfd     *abfd,
    1185 .       PTR     in,
    1186 .       PTR     out));
    1187 .
    1188 
    1189 Special entry points for generic COFF routines to call target
    1190 dependent COFF routines:
    1191 
    1192 . unsigned int _bfd_filhsz;
    1193 . unsigned int _bfd_aoutsz;
    1194 . unsigned int _bfd_scnhsz;
    1195 . unsigned int _bfd_symesz;
    1196 . unsigned int _bfd_auxesz;
    1197 . unsigned int _bfd_relsz;
    1198 . unsigned int _bfd_linesz;
    1199 . unsigned int _bfd_filnmlen;
    1200 . boolean _bfd_coff_long_filenames;
    1201 . boolean _bfd_coff_long_section_names;
    1202 . unsigned int _bfd_coff_default_section_alignment_power;
    1203 . boolean _bfd_coff_force_symnames_in_strings;
    1204 . unsigned int _bfd_coff_debug_string_prefix_length;
    1205 . void (*_bfd_coff_swap_filehdr_in) PARAMS ((
    1206 .       bfd     *abfd,
    1207 .       PTR     ext,
    1208 .       PTR     in));
    1209 . void (*_bfd_coff_swap_aouthdr_in) PARAMS ((
    1210 .       bfd     *abfd,
    1211 .       PTR     ext,
    1212 .       PTR     in));
    1213 . void (*_bfd_coff_swap_scnhdr_in) PARAMS ((
    1214 .       bfd     *abfd,
    1215 .       PTR     ext,
    1216 .       PTR     in));
    1217 . void (*_bfd_coff_swap_reloc_in) PARAMS ((
    1218 .       bfd     *abfd,
    1219 .       PTR     ext,
    1220 .       PTR     in));
    1221 . boolean (*_bfd_coff_bad_format_hook) PARAMS ((
    1222 .       bfd     *abfd,
    1223 .       PTR     internal_filehdr));
    1224 . boolean (*_bfd_coff_set_arch_mach_hook) PARAMS ((
    1225 .       bfd     *abfd,
    1226 .       PTR     internal_filehdr));
    1227 . PTR (*_bfd_coff_mkobject_hook) PARAMS ((
    1228 .       bfd     *abfd,
    1229 .       PTR     internal_filehdr,
    1230 .       PTR     internal_aouthdr));
    1231 . flagword (*_bfd_styp_to_sec_flags_hook) PARAMS ((
    1232 .       bfd     *abfd,
    1233 .       PTR     internal_scnhdr,
    1234 .       const char *name,
    1235 .       asection *section));
    1236 . void (*_bfd_set_alignment_hook) PARAMS ((
    1237 .       bfd     *abfd,
    1238 .       asection *sec,
    1239 .       PTR     internal_scnhdr));
    1240 . boolean (*_bfd_coff_slurp_symbol_table) PARAMS ((
    1241 .       bfd     *abfd));
    1242 . boolean (*_bfd_coff_symname_in_debug) PARAMS ((
    1243 .       bfd     *abfd,
    1244 .       struct internal_syment *sym));
    1245 . boolean (*_bfd_coff_pointerize_aux_hook) PARAMS ((
    1246 .       bfd *abfd,
    1247 .       combined_entry_type *table_base,
    1248 .       combined_entry_type *symbol,
    1249 .       unsigned int indaux,
    1250 .       combined_entry_type *aux));
    1251 . boolean (*_bfd_coff_print_aux) PARAMS ((
    1252 .       bfd *abfd,
    1253 .       FILE *file,
    1254 .       combined_entry_type *table_base,
    1255 .       combined_entry_type *symbol,
    1256 .       combined_entry_type *aux,
    1257 .       unsigned int indaux));
    1258 . void (*_bfd_coff_reloc16_extra_cases) PARAMS ((
    1259 .       bfd     *abfd,
    1260 .       struct bfd_link_info *link_info,
    1261 .       struct bfd_link_order *link_order,
    1262 .       arelent *reloc,
    1263 .       bfd_byte *data,
    1264 .       unsigned int *src_ptr,
    1265 .       unsigned int *dst_ptr));
    1266 . int (*_bfd_coff_reloc16_estimate) PARAMS ((
    1267 .       bfd *abfd,
    1268 .       asection *input_section,
    1269 .       arelent *r,
    1270 .       unsigned int shrink,
    1271 .       struct bfd_link_info *link_info));
    1272 . enum coff_symbol_classification (*_bfd_coff_classify_symbol) PARAMS ((
    1273 .       bfd *abfd,
    1274 .       struct internal_syment *));
    1275 . boolean (*_bfd_coff_compute_section_file_positions) PARAMS ((
    1276 .       bfd *abfd));
    1277 . boolean (*_bfd_coff_start_final_link) PARAMS ((
    1278 .       bfd *output_bfd,
    1279 .       struct bfd_link_info *info));
    1280 . boolean (*_bfd_coff_relocate_section) PARAMS ((
    1281 .       bfd *output_bfd,
    1282 .       struct bfd_link_info *info,
    1283 .       bfd *input_bfd,
    1284 .       asection *input_section,
    1285 .       bfd_byte *contents,
    1286 .       struct internal_reloc *relocs,
    1287 .       struct internal_syment *syms,
    1288 .       asection **sections));
    1289 . reloc_howto_type *(*_bfd_coff_rtype_to_howto) PARAMS ((
    1290 .       bfd *abfd,
    1291 .       asection *sec,
    1292 .       struct internal_reloc *rel,
    1293 .       struct coff_link_hash_entry *h,
    1294 .       struct internal_syment *sym,
    1295 .       bfd_vma *addendp));
    1296 . boolean (*_bfd_coff_adjust_symndx) PARAMS ((
    1297 .       bfd *obfd,
    1298 .       struct bfd_link_info *info,
    1299 .       bfd *ibfd,
    1300 .       asection *sec,
    1301 .       struct internal_reloc *reloc,
    1302 .       boolean *adjustedp));
    1303 . boolean (*_bfd_coff_link_add_one_symbol) PARAMS ((
    1304 .       struct bfd_link_info *info,
    1305 .       bfd *abfd,
    1306 .       const char *name,
    1307 .       flagword flags,
    1308 .       asection *section,
    1309 .       bfd_vma value,
    1310 .       const char *string,
    1311 .       boolean copy,
    1312 .       boolean collect,
    1313 .       struct bfd_link_hash_entry **hashp));
    1314 .
    1315 . boolean (*_bfd_coff_link_output_has_begun) PARAMS ((
    1316 .       bfd * abfd,
    1317 .       struct coff_final_link_info * pfinfo));
    1318 . boolean (*_bfd_coff_final_link_postscript) PARAMS ((
    1319 .       bfd * abfd,
    1320 .       struct coff_final_link_info * pfinfo));
     1155.  void (*_bfd_coff_swap_aux_in)
     1156.    PARAMS ((bfd *, PTR, int, int, int, int, PTR));
     1157.
     1158.  void (*_bfd_coff_swap_sym_in)
     1159.    PARAMS ((bfd *, PTR, PTR));
     1160.
     1161.  void (*_bfd_coff_swap_lineno_in)
     1162.    PARAMS ((bfd *, PTR, PTR));
     1163.
     1164.  unsigned int (*_bfd_coff_swap_aux_out)
     1165.    PARAMS ((bfd *, PTR, int, int, int, int, PTR));
     1166.
     1167.  unsigned int (*_bfd_coff_swap_sym_out)
     1168.    PARAMS ((bfd *, PTR, PTR));
     1169.
     1170.  unsigned int (*_bfd_coff_swap_lineno_out)
     1171.    PARAMS ((bfd *, PTR, PTR));
     1172.
     1173.  unsigned int (*_bfd_coff_swap_reloc_out)
     1174.    PARAMS ((bfd *, PTR, PTR));
     1175.
     1176.  unsigned int (*_bfd_coff_swap_filehdr_out)
     1177.    PARAMS ((bfd *, PTR, PTR));
     1178.
     1179.  unsigned int (*_bfd_coff_swap_aouthdr_out)
     1180.    PARAMS ((bfd *, PTR, PTR));
     1181.
     1182.  unsigned int (*_bfd_coff_swap_scnhdr_out)
     1183.    PARAMS ((bfd *, PTR, PTR));
     1184.
     1185.  unsigned int _bfd_filhsz;
     1186.  unsigned int _bfd_aoutsz;
     1187.  unsigned int _bfd_scnhsz;
     1188.  unsigned int _bfd_symesz;
     1189.  unsigned int _bfd_auxesz;
     1190.  unsigned int _bfd_relsz;
     1191.  unsigned int _bfd_linesz;
     1192.  unsigned int _bfd_filnmlen;
     1193.  bfd_boolean _bfd_coff_long_filenames;
     1194.  bfd_boolean _bfd_coff_long_section_names;
     1195.  unsigned int _bfd_coff_default_section_alignment_power;
     1196.  bfd_boolean _bfd_coff_force_symnames_in_strings;
     1197.  unsigned int _bfd_coff_debug_string_prefix_length;
     1198.
     1199.  void (*_bfd_coff_swap_filehdr_in)
     1200.    PARAMS ((bfd *, PTR, PTR));
     1201.
     1202.  void (*_bfd_coff_swap_aouthdr_in)
     1203.    PARAMS ((bfd *, PTR, PTR));
     1204.
     1205.  void (*_bfd_coff_swap_scnhdr_in)
     1206.    PARAMS ((bfd *, PTR, PTR));
     1207.
     1208.  void (*_bfd_coff_swap_reloc_in)
     1209.    PARAMS ((bfd *abfd, PTR, PTR));
     1210.
     1211.  bfd_boolean (*_bfd_coff_bad_format_hook)
     1212.    PARAMS ((bfd *, PTR));
     1213.
     1214.  bfd_boolean (*_bfd_coff_set_arch_mach_hook)
     1215.    PARAMS ((bfd *, PTR));
     1216.
     1217.  PTR (*_bfd_coff_mkobject_hook)
     1218.    PARAMS ((bfd *, PTR, PTR));
     1219.
     1220.  bfd_boolean (*_bfd_styp_to_sec_flags_hook)
     1221.    PARAMS ((bfd *, PTR, const char *, asection *, flagword *));
     1222.
     1223.  void (*_bfd_set_alignment_hook)
     1224.    PARAMS ((bfd *, asection *, PTR));
     1225.
     1226.  bfd_boolean (*_bfd_coff_slurp_symbol_table)
     1227.    PARAMS ((bfd *));
     1228.
     1229.  bfd_boolean (*_bfd_coff_symname_in_debug)
     1230.    PARAMS ((bfd *, struct internal_syment *));
     1231.
     1232.  bfd_boolean (*_bfd_coff_pointerize_aux_hook)
     1233.    PARAMS ((bfd *, combined_entry_type *, combined_entry_type *,
     1234.            unsigned int, combined_entry_type *));
     1235.
     1236.  bfd_boolean (*_bfd_coff_print_aux)
     1237.    PARAMS ((bfd *, FILE *, combined_entry_type *, combined_entry_type *,
     1238.            combined_entry_type *, unsigned int));
     1239.
     1240.  void (*_bfd_coff_reloc16_extra_cases)
     1241.    PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *,
     1242.           bfd_byte *, unsigned int *, unsigned int *));
     1243.
     1244.  int (*_bfd_coff_reloc16_estimate)
     1245.    PARAMS ((bfd *, asection *, arelent *, unsigned int,
     1246.            struct bfd_link_info *));
     1247.
     1248.  enum coff_symbol_classification (*_bfd_coff_classify_symbol)
     1249.    PARAMS ((bfd *, struct internal_syment *));
     1250.
     1251.  bfd_boolean (*_bfd_coff_compute_section_file_positions)
     1252.    PARAMS ((bfd *));
     1253.
     1254.  bfd_boolean (*_bfd_coff_start_final_link)
     1255.    PARAMS ((bfd *, struct bfd_link_info *));
     1256.
     1257.  bfd_boolean (*_bfd_coff_relocate_section)
     1258.    PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
     1259.            struct internal_reloc *, struct internal_syment *, asection **));
     1260.
     1261.  reloc_howto_type *(*_bfd_coff_rtype_to_howto)
     1262.    PARAMS ((bfd *, asection *, struct internal_reloc *,
     1263.            struct coff_link_hash_entry *, struct internal_syment *,
     1264.            bfd_vma *));
     1265.
     1266.  bfd_boolean (*_bfd_coff_adjust_symndx)
     1267.    PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
     1268.            struct internal_reloc *, bfd_boolean *));
     1269.
     1270.  bfd_boolean (*_bfd_coff_link_add_one_symbol)
     1271.    PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword,
     1272.            asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean,
     1273.            struct bfd_link_hash_entry **));
     1274.
     1275.  bfd_boolean (*_bfd_coff_link_output_has_begun)
     1276.    PARAMS ((bfd *, struct coff_final_link_info *));
     1277.
     1278.  bfd_boolean (*_bfd_coff_final_link_postscript)
     1279.    PARAMS ((bfd *, struct coff_final_link_info *));
    13211280.
    13221281.} bfd_coff_backend_data;
    13231282.
    1324 .#define coff_backend_info(abfd) ((bfd_coff_backend_data *) (abfd)->xvec->backend_data)
     1283.#define coff_backend_info(abfd) \
     1284.  ((bfd_coff_backend_data *) (abfd)->xvec->backend_data)
    13251285.
    13261286.#define bfd_coff_swap_aux_in(a,e,t,c,ind,num,i) \
    1327       ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i))
     1287((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i))
    13281288.
    13291289.#define bfd_coff_swap_sym_in(a,e,i) \
    1330       ((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i))
     1290((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i))
    13311291.
    13321292.#define bfd_coff_swap_lineno_in(a,e,i) \
    1333       ((coff_backend_info ( a)->_bfd_coff_swap_lineno_in) (a,e,i))
     1293((coff_backend_info ( a)->_bfd_coff_swap_lineno_in) (a,e,i))
    13341294.
    13351295.#define bfd_coff_swap_reloc_out(abfd, i, o) \
    1336       ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_out) (abfd, i, o))
     1296((coff_backend_info (abfd)->_bfd_coff_swap_reloc_out) (abfd, i, o))
    13371297.
    13381298.#define bfd_coff_swap_lineno_out(abfd, i, o) \
    1339       ((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o))
     1299((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o))
    13401300.
    13411301.#define bfd_coff_swap_aux_out(a,i,t,c,ind,num,o) \
    1342       ((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o))
     1302((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o))
    13431303.
    13441304.#define bfd_coff_swap_sym_out(abfd, i,o) \
    1345       ((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o))
     1305((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o))
    13461306.
    13471307.#define bfd_coff_swap_scnhdr_out(abfd, i,o) \
    1348       ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_out) (abfd, i, o))
     1308((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_out) (abfd, i, o))
    13491309.
    13501310.#define bfd_coff_swap_filehdr_out(abfd, i,o) \
    1351       ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_out) (abfd, i, o))
     1311((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_out) (abfd, i, o))
    13521312.
    13531313.#define bfd_coff_swap_aouthdr_out(abfd, i,o) \
    1354       ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_out) (abfd, i, o))
     1314((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_out) (abfd, i, o))
    13551315.
    13561316.#define bfd_coff_filhsz(abfd) (coff_backend_info (abfd)->_bfd_filhsz)
     
    13621322.#define bfd_coff_linesz(abfd) (coff_backend_info (abfd)->_bfd_linesz)
    13631323.#define bfd_coff_filnmlen(abfd) (coff_backend_info (abfd)->_bfd_filnmlen)
    1364 .#define bfd_coff_long_filenames(abfd) (coff_backend_info (abfd)->_bfd_coff_long_filenames)
     1324.#define bfd_coff_long_filenames(abfd) \
     1325.  (coff_backend_info (abfd)->_bfd_coff_long_filenames)
    13651326.#define bfd_coff_long_section_names(abfd) \
    1366       (coff_backend_info (abfd)->_bfd_coff_long_section_names)
     1327(coff_backend_info (abfd)->_bfd_coff_long_section_names)
    13671328.#define bfd_coff_default_section_alignment_power(abfd) \
    1368 .        (coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power)
     1329.  (coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power)
    13691330.#define bfd_coff_swap_filehdr_in(abfd, i,o) \
    1370       ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o))
     1331((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o))
    13711332.
    13721333.#define bfd_coff_swap_aouthdr_in(abfd, i,o) \
    1373       ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_in) (abfd, i, o))
     1334((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_in) (abfd, i, o))
    13741335.
    13751336.#define bfd_coff_swap_scnhdr_in(abfd, i,o) \
    1376       ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_in) (abfd, i, o))
     1337((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_in) (abfd, i, o))
    13771338.
    13781339.#define bfd_coff_swap_reloc_in(abfd, i, o) \
    1379       ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_in) (abfd, i, o))
     1340((coff_backend_info (abfd)->_bfd_coff_swap_reloc_in) (abfd, i, o))
    13801341.
    13811342.#define bfd_coff_bad_format_hook(abfd, filehdr) \
    1382       ((coff_backend_info (abfd)->_bfd_coff_bad_format_hook) (abfd, filehdr))
     1343((coff_backend_info (abfd)->_bfd_coff_bad_format_hook) (abfd, filehdr))
    13831344.
    13841345.#define bfd_coff_set_arch_mach_hook(abfd, filehdr)\
    1385       ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr))
     1346((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr))
    13861347.#define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\
    1387 .        ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook) (abfd, filehdr, aouthdr))
    1388 .
    1389 .#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section)\
    1390 .        ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\
    1391 .         (abfd, scnhdr, name, section))
     1348.  ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook)\
     1349.   (abfd, filehdr, aouthdr))
     1350.
     1351.#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section, flags_ptr)\
     1352.  ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\
     1353.   (abfd, scnhdr, name, section, flags_ptr))
    13921354.
    13931355.#define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\
    1394       ((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr))
     1356((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr))
    13951357.
    13961358.#define bfd_coff_slurp_symbol_table(abfd)\
    1397       ((coff_backend_info (abfd)->_bfd_coff_slurp_symbol_table) (abfd))
     1359((coff_backend_info (abfd)->_bfd_coff_slurp_symbol_table) (abfd))
    13981360.
    13991361.#define bfd_coff_symname_in_debug(abfd, sym)\
    1400       ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym))
     1362((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym))
    14011363.
    14021364.#define bfd_coff_force_symnames_in_strings(abfd)\
    1403      (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings)
     1365(coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings)
    14041366.
    14051367.#define bfd_coff_debug_string_prefix_length(abfd)\
    1406      (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length)
     1368(coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length)
    14071369.
    14081370.#define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\
    1409 .        ((coff_backend_info (abfd)->_bfd_coff_print_aux)\
    1410 .         (abfd, file, base, symbol, aux, indaux))
    1411 .
    1412 .#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)\
    1413 .        ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\
    1414 .         (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr))
     1371.  ((coff_backend_info (abfd)->_bfd_coff_print_aux)\
     1372.   (abfd, file, base, symbol, aux, indaux))
     1373.
     1374.#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order,\
     1375.                                     reloc, data, src_ptr, dst_ptr)\
     1376.  ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\
     1377.   (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr))
    14151378.
    14161379.#define bfd_coff_reloc16_estimate(abfd, section, reloc, shrink, link_info)\
    1417       ((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\
    1418 .         (abfd, section, reloc, shrink, link_info))
     1380((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\
     1381.   (abfd, section, reloc, shrink, link_info))
    14191382.
    14201383.#define bfd_coff_classify_symbol(abfd, sym)\
    1421       ((coff_backend_info (abfd)->_bfd_coff_classify_symbol)\
    1422 .         (abfd, sym))
     1384((coff_backend_info (abfd)->_bfd_coff_classify_symbol)\
     1385.   (abfd, sym))
    14231386.
    14241387.#define bfd_coff_compute_section_file_positions(abfd)\
    1425       ((coff_backend_info (abfd)->_bfd_coff_compute_section_file_positions)\
    1426 .         (abfd))
     1388((coff_backend_info (abfd)->_bfd_coff_compute_section_file_positions)\
     1389.   (abfd))
    14271390.
    14281391.#define bfd_coff_start_final_link(obfd, info)\
    1429       ((coff_backend_info (obfd)->_bfd_coff_start_final_link)\
    1430 .         (obfd, info))
     1392((coff_backend_info (obfd)->_bfd_coff_start_final_link)\
     1393.   (obfd, info))
    14311394.#define bfd_coff_relocate_section(obfd,info,ibfd,o,con,rel,isyms,secs)\
    1432       ((coff_backend_info (ibfd)->_bfd_coff_relocate_section)\
    1433 .         (obfd, info, ibfd, o, con, rel, isyms, secs))
     1395((coff_backend_info (ibfd)->_bfd_coff_relocate_section)\
     1396.   (obfd, info, ibfd, o, con, rel, isyms, secs))
    14341397.#define bfd_coff_rtype_to_howto(abfd, sec, rel, h, sym, addendp)\
    1435       ((coff_backend_info (abfd)->_bfd_coff_rtype_to_howto)\
    1436 .         (abfd, sec, rel, h, sym, addendp))
     1398((coff_backend_info (abfd)->_bfd_coff_rtype_to_howto)\
     1399.   (abfd, sec, rel, h, sym, addendp))
    14371400.#define bfd_coff_adjust_symndx(obfd, info, ibfd, sec, rel, adjustedp)\
    1438 .        ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\
    1439 .         (obfd, info, ibfd, sec, rel, adjustedp))
    1440 .#define bfd_coff_link_add_one_symbol(info,abfd,name,flags,section,value,string,cp,coll,hashp)\
    1441 .        ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\
    1442 .         (info, abfd, name, flags, section, value, string, cp, coll, hashp))
     1401.  ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\
     1402.   (obfd, info, ibfd, sec, rel, adjustedp))
     1403.#define bfd_coff_link_add_one_symbol(info, abfd, name, flags, section,\
     1404.                                     value, string, cp, coll, hashp)\
     1405.  ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\
     1406.   (info, abfd, name, flags, section, value, string, cp, coll, hashp))
    14431407.
    14441408.#define bfd_coff_link_output_has_begun(a,p) \
    1445       ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a,p))
     1409((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a,p))
    14461410.#define bfd_coff_final_link_postscript(a,p) \
    1447       ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a,p))
     1411((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a,p))
    14481412.
    14491413*/
     
    14511415/* See whether the magic number matches.  */
    14521416
    1453 static boolean
     1417static bfd_boolean
    14541418coff_bad_format_hook (abfd, filehdr)
    14551419     bfd * abfd ATTRIBUTE_UNUSED;
     
    14591423
    14601424  if (BADMAG (*internal_f))
    1461     return false;
    1462 
    1463   /* if the optional header is NULL or not the correct size then
     1425    return FALSE;
     1426
     1427  /* If the optional header is NULL or not the correct size then
    14641428     quit; the only difference I can see between m88k dgux headers (MC88DMAGIC)
    14651429     and Intel 960 readwrite headers (I960WRMAGIC) is that the
     
    14671431
    14681432     But the mips keeps extra stuff in it's opthdr, so dont check
    1469      when doing that
    1470      */
     1433     when doing that.  */
    14711434
    14721435#if defined(M88) || defined(I960)
    14731436  if (internal_f->f_opthdr != 0 && bfd_coff_aoutsz (abfd) != internal_f->f_opthdr)
    1474     return false;
    1475 #endif
    1476 
    1477   return true;
     1437    return FALSE;
     1438#endif
     1439
     1440  return TRUE;
    14781441}
    14791442
     
    14941457    {
    14951458      const char *secname = bfd_get_section_name (abfd, section);
     1459
    14961460      if (alignment_table[i].comparison_length == (unsigned int) -1
    14971461          ? strcmp (alignment_table[i].name, secname) == 0
     
    15081472
    15091473  if (alignment_table[i].default_alignment_max != COFF_ALIGNMENT_FIELD_EMPTY
    1510       && default_alignment > alignment_table[i].default_alignment_max)
     1474#if COFF_DEFAULT_SECTION_ALIGNMENT_POWER != 0
     1475      && default_alignment > alignment_table[i].default_alignment_max
     1476#endif
     1477      )
    15111478    return;
    15121479
     
    15411508   particular implementation of COFF.  */
    15421509
    1543 static boolean
     1510static bfd_boolean
    15441511coff_new_section_hook (abfd, section)
    15451512     bfd * abfd;
     
    15471514{
    15481515  combined_entry_type *native;
     1516  bfd_size_type amt;
    15491517
    15501518  section->alignment_power = COFF_DEFAULT_SECTION_ALIGNMENT_POWER;
    15511519
    15521520#ifdef RS6000COFF_C
    1553   if (xcoff_data (abfd)->text_align_power != 0
     1521  if (bfd_xcoff_text_align_power (abfd) != 0
    15541522      && strcmp (bfd_get_section_name (abfd, section), ".text") == 0)
    1555     section->alignment_power = xcoff_data (abfd)->text_align_power;
    1556   if (xcoff_data (abfd)->data_align_power != 0
     1523    section->alignment_power = bfd_xcoff_text_align_power (abfd);
     1524  if (bfd_xcoff_data_align_power (abfd) != 0
    15571525      && strcmp (bfd_get_section_name (abfd, section), ".data") == 0)
    1558     section->alignment_power = xcoff_data (abfd)->data_align_power;
     1526    section->alignment_power = bfd_xcoff_data_align_power (abfd);
    15591527#endif
    15601528
     
    15641532     @@ The 10 is a guess at a plausible maximum number of aux entries
    15651533     (but shouldn't be a constant).  */
    1566   native = ((combined_entry_type *)
    1567             bfd_zalloc (abfd, sizeof (combined_entry_type) * 10));
     1534  amt = sizeof (combined_entry_type) * 10;
     1535  native = (combined_entry_type *) bfd_zalloc (abfd, amt);
    15681536  if (native == NULL)
    1569     return false;
     1537    return FALSE;
    15701538
    15711539  /* We don't need to set up n_name, n_value, or n_scnum in the native
     
    15841552                                     coff_section_alignment_table_size);
    15851553
    1586   return true;
     1554  return TRUE;
    15871555}
    15881556
     
    16031571
    16041572#ifdef I960
    1605   /* Extract ALIGN from 2**ALIGN stored in section header */
     1573  /* Extract ALIGN from 2**ALIGN stored in section header. */
    16061574  for (i = 0; i < 32; i++)
    16071575    if ((1 << i) >= hdr->s_align)
     
    16091577#endif
    16101578#ifdef TIC80COFF
    1611   /* TI tools puts the alignment power in bits 8-11 */
     1579  /* TI tools puts the alignment power in bits 8-11. */
    16121580  i = (hdr->s_flags >> 8) & 0xF ;
    16131581#endif
     
    16251593#ifdef COFF_WITH_PE
    16261594
    1627 /* a couple of macros to help setting the alignment power field */
     1595/* A couple of macros to help setting the alignment power field. */
    16281596#define ALIGN_SET(field,x,y) \
    16291597  if (((field) & IMAGE_SCN_ALIGN_64BYTES) == x )\
     
    16471615{
    16481616  struct internal_scnhdr *hdr = (struct internal_scnhdr *) scnhdr;
     1617  bfd_size_type amt;
    16491618
    16501619  ALIGN_SET     (hdr->s_flags, IMAGE_SCN_ALIGN_64BYTES, 6)
     
    16621631  if (coff_section_data (abfd, section) == NULL)
    16631632    {
    1664       section->used_by_bfd =
    1665         (PTR) bfd_zalloc (abfd, sizeof (struct coff_section_tdata));
     1633      amt = sizeof (struct coff_section_tdata);
     1634      section->used_by_bfd = (PTR) bfd_zalloc (abfd, amt);
    16661635      if (section->used_by_bfd == NULL)
    16671636        {
     
    16721641  if (pei_section_data (abfd, section) == NULL)
    16731642    {
    1674       coff_section_data (abfd, section)->tdata =
    1675         (PTR) bfd_zalloc (abfd, sizeof (struct pei_section_tdata));
     1643      amt = sizeof (struct pei_section_tdata);
     1644      coff_section_data (abfd, section)->tdata = (PTR) bfd_zalloc (abfd, amt);
    16761645      if (coff_section_data (abfd, section)->tdata == NULL)
    16771646        {
     
    16851654  section->lma = hdr->s_vaddr;
    16861655
    1687   /* check for extended relocs */
     1656  /* Check for extended relocs. */
    16881657  if (hdr->s_flags & IMAGE_SCN_LNK_NRELOC_OVFL)
    16891658    {
    16901659      struct external_reloc dst;
    16911660      struct internal_reloc n;
    1692       int oldpos = bfd_tell (abfd);
    1693       bfd_seek (abfd, hdr->s_relptr, 0);
    1694       if (bfd_read ((PTR) & dst, 1, bfd_coff_relsz (abfd), abfd)
     1661      file_ptr oldpos = bfd_tell (abfd);
     1662      bfd_seek (abfd, (file_ptr) hdr->s_relptr, 0);
     1663      if (bfd_bread ((PTR) &dst, (bfd_size_type) bfd_coff_relsz (abfd), abfd)
    16951664          != bfd_coff_relsz (abfd))
    16961665        return;
     
    16981667      coff_swap_reloc_in (abfd, &dst, &n);
    16991668      bfd_seek (abfd, oldpos, 0);
    1700       section->reloc_count =
    1701         hdr->s_nreloc = n.r_vaddr;
     1669      section->reloc_count = hdr->s_nreloc = n.r_vaddr;
    17021670    }
    17031671}
     
    17271695    return;
    17281696
    1729   real_sec = coff_section_from_bfd_index (abfd, hdr->s_nreloc);
     1697  real_sec = coff_section_from_bfd_index (abfd, (int) hdr->s_nreloc);
    17301698  if (real_sec == NULL)
    17311699    return;
     
    17381706      if (*ps == section)
    17391707        {
    1740           *ps = (*ps)->next;
     1708          bfd_section_list_remove (abfd, ps);
    17411709          --abfd->section_count;
    17421710          break;
     
    17561724#ifndef coff_mkobject
    17571725
    1758 static boolean coff_mkobject PARAMS ((bfd *));
    1759 
    1760 static boolean
     1726static bfd_boolean coff_mkobject PARAMS ((bfd *));
     1727
     1728static bfd_boolean
    17611729coff_mkobject (abfd)
    17621730     bfd * abfd;
    17631731{
    17641732  coff_data_type *coff;
    1765 
    1766   abfd->tdata.coff_obj_data = (struct coff_tdata *) bfd_zalloc (abfd, sizeof (coff_data_type));
     1733  bfd_size_type amt = sizeof (coff_data_type);
     1734
     1735  abfd->tdata.coff_obj_data = (struct coff_tdata *) bfd_zalloc (abfd, amt);
    17671736  if (abfd->tdata.coff_obj_data == 0)
    1768     return false;
     1737    return FALSE;
    17691738  coff = coff_data (abfd);
    17701739  coff->symbols = (coff_symbol_type *) NULL;
     
    17761745/*  make_abs_section(abfd);*/
    17771746
    1778   return true;
     1747  return TRUE;
    17791748}
    17801749#endif
    17811750
    17821751/* Create the COFF backend specific information.  */
     1752
    17831753#ifndef coff_mkobject_hook
    17841754static PTR
     
    17911761  coff_data_type *coff;
    17921762
    1793   if (coff_mkobject (abfd) == false)
     1763  if (! coff_mkobject (abfd))
    17941764    return NULL;
    17951765
     
    18301800      xcoff->xcoff64 = 0;
    18311801# endif
    1832       xcoff->full_aouthdr = true;
     1802      xcoff->full_aouthdr = TRUE;
    18331803      xcoff->toc = internal_a->o_toc;
    18341804      xcoff->sntoc = internal_a->o_sntoc;
    18351805      xcoff->snentry = internal_a->o_snentry;
    1836       xcoff->text_align_power = internal_a->o_algntext;
    1837       xcoff->data_align_power = internal_a->o_algndata;
     1806      bfd_xcoff_text_align_power (abfd) = internal_a->o_algntext;
     1807      bfd_xcoff_data_align_power (abfd) = internal_a->o_algndata;
    18381808      xcoff->modtype = internal_a->o_modtype;
    18391809      xcoff->cputype = internal_a->o_cputype;
     
    18441814
    18451815#ifdef ARM
    1846   /* Set the flags field from the COFF header read in */
     1816  /* Set the flags field from the COFF header read in. */
    18471817  if (! _bfd_coff_arm_set_private_flags (abfd, internal_f->f_flags))
    18481818    coff->flags = 0;
     
    18671837   at linking together COFF files for different architectures.  */
    18681838
    1869 static boolean
     1839static bfd_boolean
    18701840coff_set_arch_mach_hook (abfd, filehdr)
    18711841     bfd *abfd;
    18721842     PTR filehdr;
    18731843{
    1874   long machine;
     1844  unsigned long machine;
    18751845  enum bfd_architecture arch;
    18761846  struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
    18771847
     1848  /* Zero selects the default machine for an arch.  */
    18781849  machine = 0;
    18791850  switch (internal_f->f_magic)
    18801851    {
     1852#ifdef OR32_MAGIC_BIG
     1853    case OR32_MAGIC_BIG:
     1854    case OR32_MAGIC_LITTLE:
     1855      arch = bfd_arch_or32;
     1856      break;
     1857#endif
    18811858#ifdef PPCMAGIC
    18821859    case PPCMAGIC:
    18831860      arch = bfd_arch_powerpc;
    1884       machine = 0; /* what does this mean? (krk) */
    18851861      break;
    18861862#endif
     
    18911867    case LYNXCOFFMAGIC: /* shadows the m68k Lynx number below, sigh */
    18921868      arch = bfd_arch_i386;
    1893       machine = 0;
    18941869      break;
    18951870#endif
     
    18971872    case IA64MAGIC:
    18981873      arch = bfd_arch_ia64;
    1899       machine = 0;
    19001874      break;
    19011875#endif
     
    19041878    case A29K_MAGIC_LITTLE:
    19051879      arch = bfd_arch_a29k;
    1906       machine = 0;
    19071880      break;
    19081881#endif
     
    19121885    case THUMBPEMAGIC:
    19131886      arch = bfd_arch_arm;
    1914       switch (internal_f->f_flags & F_ARM_ARCHITECTURE_MASK)
     1887      machine = bfd_arm_get_mach_from_notes (abfd, ARM_NOTE_SECTION);
     1888      if (machine == bfd_mach_arm_unknown)
    19151889        {
    1916         case F_ARM_2:  machine = bfd_mach_arm_2;  break;
    1917         case F_ARM_2a: machine = bfd_mach_arm_2a; break;
    1918         case F_ARM_3:  machine = bfd_mach_arm_3;  break;
    1919         default:
    1920         case F_ARM_3M: machine = bfd_mach_arm_3M; break;
    1921         case F_ARM_4:  machine = bfd_mach_arm_4;  break;
    1922         case F_ARM_4T: machine = bfd_mach_arm_4T; break;
    1923         case F_ARM_5:  machine = bfd_mach_arm_5;  break;
     1890          switch (internal_f->f_flags & F_ARM_ARCHITECTURE_MASK)
     1891            {
     1892            case F_ARM_2:  machine = bfd_mach_arm_2;  break;
     1893            case F_ARM_2a: machine = bfd_mach_arm_2a; break;
     1894            case F_ARM_3:  machine = bfd_mach_arm_3;  break;
     1895            default:
     1896            case F_ARM_3M: machine = bfd_mach_arm_3M; break;
     1897            case F_ARM_4:  machine = bfd_mach_arm_4;  break;
     1898            case F_ARM_4T: machine = bfd_mach_arm_4T; break;
     1899              /* The COFF header does not have enough bits available
     1900                 to cover all the different ARM architectures.  So
     1901                 we interpret F_ARM_5, the highest flag value to mean
     1902                 "the highest ARM architecture known to BFD" which is
     1903                 currently the XScale.  */
     1904            case F_ARM_5:  machine = bfd_mach_arm_XScale;  break;
     1905            }
    19241906        }
    19251907      break;
     
    19611943          break;
    19621944        default:
    1963           return false;
     1945          return FALSE;
    19641946        }
    19651947      break;
     
    20091991#ifdef RS6000COFF_C
    20101992#ifdef XCOFF64
     1993    case U64_TOCMAGIC:
    20111994    case U803XTOCMAGIC:
    20121995#else
     
    20322015                bfd_byte *buf;
    20332016                struct internal_syment sym;
    2034 
    2035                 buf = (bfd_byte *) bfd_malloc (bfd_coff_symesz (abfd));
     2017                bfd_size_type amt = bfd_coff_symesz (abfd);
     2018
     2019                buf = (bfd_byte *) bfd_malloc (amt);
    20362020                if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
    2037                     || (bfd_read (buf, 1, bfd_coff_symesz (abfd), abfd)
    2038                         != bfd_coff_symesz (abfd)))
     2021                    || bfd_bread (buf, amt, abfd) != amt)
    20392022                  {
    20402023                    free (buf);
    2041                     return false;
     2024                    return FALSE;
    20422025                  }
    20432026                bfd_coff_swap_sym_in (abfd, (PTR) buf, (PTR) &sym);
     
    20552038          default:
    20562039          case 0:
    2057 #ifdef POWERMAC
    2058             /* PowerPC Macs use the same magic numbers as RS/6000
    2059                (because that's how they were bootstrapped originally),
    2060                but they are always PowerPC architecture.  */
    2061             arch = bfd_arch_powerpc;
    2062             machine = bfd_mach_ppc;
    2063 #else
    2064 #ifdef XCOFF64
    2065             arch = bfd_arch_powerpc;
    2066             machine = bfd_mach_ppc_620;
    2067 #else
    2068             arch = bfd_arch_rs6000;
    2069             machine = bfd_mach_rs6k;
    2070 #endif
    2071 #endif /* POWERMAC */
     2040            arch = bfd_xcoff_architecture (abfd);
     2041            machine = bfd_xcoff_machine (abfd);
    20722042            break;
    20732043
     
    20962066    case WE32KMAGIC:
    20972067      arch = bfd_arch_we32k;
    2098       machine = 0;
    20992068      break;
    21002069#endif
     
    21042073      arch = bfd_arch_h8300;
    21052074      machine = bfd_mach_h8300;
    2106       /* !! FIXME this probably isn't the right place for this */
     2075      /* !! FIXME this probably isn't the right place for this. */
    21072076      abfd->flags |= BFD_IS_RELAXABLE;
    21082077      break;
     
    21132082      arch = bfd_arch_h8300;
    21142083      machine = bfd_mach_h8300h;
    2115       /* !! FIXME this probably isn't the right place for this */
     2084      /* !! FIXME this probably isn't the right place for this. */
    21162085      abfd->flags |= BFD_IS_RELAXABLE;
    21172086      break;
     
    21222091      arch = bfd_arch_h8300;
    21232092      machine = bfd_mach_h8300s;
    2124       /* !! FIXME this probably isn't the right place for this */
     2093      /* !! FIXME this probably isn't the right place for this.  */
     2094      abfd->flags |= BFD_IS_RELAXABLE;
     2095      break;
     2096#endif
     2097
     2098#ifdef H8300HNMAGIC
     2099    case H8300HNMAGIC:
     2100      arch = bfd_arch_h8300;
     2101      machine = bfd_mach_h8300hn;
     2102      /* !! FIXME this probably isn't the right place for this.  */
     2103      abfd->flags |= BFD_IS_RELAXABLE;
     2104      break;
     2105#endif
     2106
     2107#ifdef H8300SNMAGIC
     2108    case H8300SNMAGIC:
     2109      arch = bfd_arch_h8300;
     2110      machine = bfd_mach_h8300sn;
     2111      /* !! FIXME this probably isn't the right place for this.  */
    21252112      abfd->flags |= BFD_IS_RELAXABLE;
    21262113      break;
     
    21342121#endif
    21352122      arch = bfd_arch_sh;
    2136       machine = 0;
    21372123      break;
    21382124#endif
     
    21412127    case MIPS_ARCH_MAGIC_WINCE:
    21422128      arch = bfd_arch_mips;
    2143       machine = 0;
    21442129      break;
    21452130#endif
     
    21482133    case H8500MAGIC:
    21492134      arch = bfd_arch_h8500;
    2150       machine = 0;
    21512135      break;
    21522136#endif
     
    21582142#endif
    21592143      arch = bfd_arch_sparc;
    2160       machine = 0;
    21612144      break;
    21622145#endif
     
    21702153#ifdef TICOFF0MAGIC
    21712154#ifdef TICOFF_TARGET_ARCH
    2172       /* this TI COFF section should be used by all new TI COFF v0 targets */
     2155      /* This TI COFF section should be used by all new TI COFF v0 targets. */
    21732156    case TICOFF0MAGIC:
    21742157      arch = TICOFF_TARGET_ARCH;
     2158      machine = TICOFF_TARGET_MACHINE_GET (internal_f->f_flags);
    21752159      break;
    21762160#endif
     
    21782162
    21792163#ifdef TICOFF1MAGIC
    2180       /* this TI COFF section should be used by all new TI COFF v1/2 targets */
    2181       /* TI COFF1 and COFF2 use the target_id field to specify which arch */
     2164      /* This TI COFF section should be used by all new TI COFF v1/2 targets. */
     2165      /* TI COFF1 and COFF2 use the target_id field to specify which arch. */
    21822166    case TICOFF1MAGIC:
    21832167    case TICOFF2MAGIC:
     
    21872171        case TI_TARGET_ID:
    21882172          arch = TICOFF_TARGET_ARCH;
     2173          machine = TICOFF_TARGET_MACHINE_GET (internal_f->f_flags);
    21892174          break;
    21902175#endif
     
    22102195      break;
    22112196#endif
    2212     default:                    /* Unreadable input file type */
     2197
     2198#ifdef W65MAGIC
     2199    case W65MAGIC:
     2200      arch = bfd_arch_w65;
     2201      break;
     2202#endif
     2203
     2204    default:                    /* Unreadable input file type.  */
    22132205      arch = bfd_arch_obscure;
    22142206      break;
     
    22162208
    22172209  bfd_default_set_arch_mach (abfd, arch, machine);
    2218   return true;
     2210  return TRUE;
    22192211}
    22202212
    22212213#ifdef SYMNAME_IN_DEBUG
    22222214
    2223 static boolean symname_in_debug_hook
     2215static bfd_boolean symname_in_debug_hook
    22242216  PARAMS ((bfd *, struct internal_syment *));
    22252217
    2226 static boolean
     2218static bfd_boolean
    22272219symname_in_debug_hook (abfd, sym)
    22282220     bfd * abfd ATTRIBUTE_UNUSED;
    22292221     struct internal_syment *sym;
    22302222{
    2231   return SYMNAME_IN_DEBUG (sym) ? true : false;
     2223  return SYMNAME_IN_DEBUG (sym) != 0;
    22322224}
    22332225
     
    22352227
    22362228#define symname_in_debug_hook \
    2237   (boolean (*) PARAMS ((bfd *, struct internal_syment *))) bfd_false
     2229  (bfd_boolean (*) PARAMS ((bfd *, struct internal_syment *))) bfd_false
    22382230
    22392231#endif
     
    22472239/* Handle the csect auxent of a C_EXT or C_HIDEXT symbol.  */
    22482240
    2249 static boolean coff_pointerize_aux_hook
     2241static bfd_boolean coff_pointerize_aux_hook
    22502242  PARAMS ((bfd *, combined_entry_type *, combined_entry_type *,
    22512243           unsigned int, combined_entry_type *));
    22522244
    2253 /*ARGSUSED*/
    2254 static boolean
     2245static bfd_boolean
    22552246coff_pointerize_aux_hook (abfd, table_base, symbol, indaux, aux)
    22562247     bfd *abfd ATTRIBUTE_UNUSED;
     
    22722263        }
    22732264
    2274       /* Return true to indicate that the caller should not do any
     2265      /* Return TRUE to indicate that the caller should not do any
    22752266         further work on this auxent.  */
    2276       return true;
    2277     }
    2278 
    2279   /* Return false to indicate that this auxent should be handled by
     2267      return TRUE;
     2268    }
     2269
     2270  /* Return FALSE to indicate that this auxent should be handled by
    22802271     the caller.  */
    2281   return false;
     2272  return FALSE;
    22822273}
    22832274
     
    22872278/* We don't want to pointerize bal entries.  */
    22882279
    2289 static boolean coff_pointerize_aux_hook
     2280static bfd_boolean coff_pointerize_aux_hook
    22902281  PARAMS ((bfd *, combined_entry_type *, combined_entry_type *,
    22912282           unsigned int, combined_entry_type *));
    22922283
    2293 /*ARGSUSED*/
    2294 static boolean
     2284static bfd_boolean
    22952285coff_pointerize_aux_hook (abfd, table_base, symbol, indaux, aux)
    22962286     bfd *abfd ATTRIBUTE_UNUSED;
     
    23002290     combined_entry_type *aux ATTRIBUTE_UNUSED;
    23012291{
    2302   /* Return true if we don't want to pointerize this aux entry, which
     2292  /* Return TRUE if we don't want to pointerize this aux entry, which
    23032293     is the case for the lastfirst aux entry for a C_LEAFPROC symbol.  */
    23042294  return (indaux == 1
     
    23152305#endif /* ! RS6000COFF_C */
    23162306
    2317 /* Print an aux entry.  This returns true if it has printed it.  */
    2318 
    2319 static boolean coff_print_aux
     2307/* Print an aux entry.  This returns TRUE if it has printed it.  */
     2308
     2309static bfd_boolean coff_print_aux
    23202310  PARAMS ((bfd *, FILE *, combined_entry_type *, combined_entry_type *,
    23212311           combined_entry_type *, unsigned int));
    23222312
    2323 static boolean
     2313static bfd_boolean
    23242314coff_print_aux (abfd, file, table_base, symbol, aux, indaux)
    23252315     bfd *abfd ATTRIBUTE_UNUSED;
     
    23402330        {
    23412331          BFD_ASSERT (! aux->fix_scnlen);
    2342           fprintf (file, "val %5ld", aux->u.auxent.x_csect.x_scnlen.l);
     2332#ifdef XCOFF64
     2333          fprintf (file, "val %5lld", aux->u.auxent.x_csect.x_scnlen.l);
     2334#else
     2335          fprintf (file, "val %5ld", (long) aux->u.auxent.x_csect.x_scnlen.l);
     2336#endif
    23432337        }
    23442338      else
     
    23462340          fprintf (file, "indx ");
    23472341          if (! aux->fix_scnlen)
    2348             fprintf (file, "%4ld", aux->u.auxent.x_csect.x_scnlen.l);
     2342#ifdef XCOFF64
     2343            fprintf (file, "%4lld", aux->u.auxent.x_csect.x_scnlen.l);
     2344#else
     2345            fprintf (file, "%4ld", (long) aux->u.auxent.x_csect.x_scnlen.l);
     2346#endif
    23492347          else
    23502348            fprintf (file, "%4ld",
     
    23602358               aux->u.auxent.x_csect.x_stab,
    23612359               (unsigned int) aux->u.auxent.x_csect.x_snstab);
    2362       return true;
    2363     }
    2364 #endif
    2365 
    2366   /* Return false to indicate that no special action was taken.  */
    2367   return false;
     2360      return TRUE;
     2361    }
     2362#endif
     2363
     2364  /* Return FALSE to indicate that no special action was taken.  */
     2365  return FALSE;
    23682366}
    23692367
     
    23882386static int compare_arelent_ptr PARAMS ((const PTR, const PTR));
    23892387
    2390 /* AUX's ld wants relocations to be sorted */
     2388/* AUX's ld wants relocations to be sorted. */
    23912389static int
    23922390compare_arelent_ptr (x, y)
     
    24042402#endif /* TARG_AUX */
    24052403
    2406 static boolean
     2404static bfd_boolean
    24072405coff_write_relocs (abfd, first_undef)
    24082406     bfd * abfd;
     
    24202418      p = s->orelocation;
    24212419#else
    2422       /* sort relocations before we write them out */
    2423       p = (arelent **) bfd_malloc (s->reloc_count * sizeof (arelent *));
    2424       if (p == NULL && s->reloc_count > 0)
    2425         return false;
    2426       memcpy (p, s->orelocation, s->reloc_count * sizeof (arelent *));
    2427       qsort (p, s->reloc_count, sizeof (arelent *), compare_arelent_ptr);
     2420      {
     2421        /* Sort relocations before we write them out.  */
     2422        bfd_size_type amt;
     2423
     2424        amt = s->reloc_count;
     2425        amt *= sizeof (arelent *);
     2426        p = (arelent **) bfd_malloc (amt);
     2427        if (p == NULL && s->reloc_count > 0)
     2428          return FALSE;
     2429        memcpy (p, s->orelocation, (size_t) amt);
     2430        qsort (p, s->reloc_count, sizeof (arelent *), compare_arelent_ptr);
     2431      }
    24282432#endif
    24292433
    24302434      if (bfd_seek (abfd, s->rel_filepos, SEEK_SET) != 0)
    2431         return false;
     2435        return FALSE;
    24322436
    24332437#ifdef COFF_WITH_PE
    2434       if (s->reloc_count > 0xffff)
     2438      if (obj_pe (abfd) && s->reloc_count >= 0xffff)
    24352439        {
    2436           /* encode real count here as first reloc */
     2440          /* Encode real count here as first reloc. */
    24372441          struct internal_reloc n;
     2442
    24382443          memset ((PTR) & n, 0, sizeof (n));
    2439           /* add one to count *this* reloc (grr) */
     2444          /* Add one to count *this* reloc (grr). */
    24402445          n.r_vaddr = s->reloc_count + 1;
    24412446          coff_swap_reloc_out (abfd, &n, &dst);
    2442           if (bfd_write ((PTR) & dst, 1, bfd_coff_relsz (abfd), abfd)
    2443               != bfd_coff_relsz (abfd))
    2444             return false;
     2447          if (bfd_bwrite ((PTR) & dst, (bfd_size_type) bfd_coff_relsz (abfd),
     2448                         abfd) != bfd_coff_relsz (abfd))
     2449            return FALSE;
    24452450        }
    24462451#endif
     
    24502455          struct internal_reloc n;
    24512456          arelent *q = p[i];
     2457
    24522458          memset ((PTR) & n, 0, sizeof (n));
    24532459
     
    24642470          if (q->sym_ptr_ptr[0]->the_bfd != abfd)
    24652471            {
    2466               int i;
     2472              int j;
    24672473              const char *sname = q->sym_ptr_ptr[0]->name;
    24682474              asymbol **outsyms = abfd->outsymbols;
    2469               for (i = first_undef; outsyms[i]; i++)
     2475
     2476              for (j = first_undef; outsyms[j]; j++)
    24702477                {
    2471                   const char *intable = outsyms[i]->name;
     2478                  const char *intable = outsyms[j]->name;
     2479
    24722480                  if (strcmp (intable, sname) == 0) {
    2473                     /* got a hit, so repoint the reloc */
    2474                     q->sym_ptr_ptr = outsyms + i;
     2481                    /* Got a hit, so repoint the reloc. */
     2482                    q->sym_ptr_ptr = outsyms + j;
    24752483                    break;
    24762484                  }
     
    24932501                if (SECTION_RELATIVE_ABSOLUTE_SYMBOL_P (q,s))
    24942502#else
    2495                 if (q->sym_ptr_ptr == bfd_abs_section_ptr->symbol_ptr_ptr)
     2503                if ((*q->sym_ptr_ptr)->section == bfd_abs_section_ptr
     2504                    && ((*q->sym_ptr_ptr)->flags & BSF_SECTION_SYM) != 0)
    24962505#endif
    24972506                  /* This is a relocation relative to the absolute symbol.  */
     
    25132522
    25142523#ifdef SELECT_RELOC
    2515           /* Work out reloc type from what is required */
     2524          /* Work out reloc type from what is required. */
    25162525          SELECT_RELOC (n, q->howto);
    25172526#else
     
    25192528#endif
    25202529          coff_swap_reloc_out (abfd, &n, &dst);
    2521           if (bfd_write ((PTR) & dst, 1, bfd_coff_relsz (abfd), abfd)
    2522               != bfd_coff_relsz (abfd))
    2523             return false;
     2530
     2531          if (bfd_bwrite ((PTR) & dst, (bfd_size_type) bfd_coff_relsz (abfd),
     2532                         abfd) != bfd_coff_relsz (abfd))
     2533            return FALSE;
    25242534        }
    25252535
     
    25302540    }
    25312541
    2532   return true;
     2542  return TRUE;
    25332543}
    25342544
    25352545/* Set flags and magic number of a coff file from architecture and machine
    2536    type.  Result is true if we can represent the arch&type, false if not.  */
    2537 
    2538 static boolean
     2546   type.  Result is TRUE if we can represent the arch&type, FALSE if not.  */
     2547
     2548static bfd_boolean
    25392549coff_set_flags (abfd, magicp, flagsp)
    25402550     bfd * abfd;
     
    25562566          break;
    25572567        default:
    2558           return false;
     2568          return FALSE;
    25592569        }
    2560       return true;
     2570      return TRUE;
    25612571#endif
    25622572#ifdef I960ROMAGIC
     
    25982608            break;
    25992609          default:
    2600             return false;
     2610            return FALSE;
    26012611          }
    26022612        *flagsp = flags;
    2603         return true;
     2613        return TRUE;
    26042614      }
    26052615      break;
     
    26092619    case bfd_arch_tic30:
    26102620      *magicp = TIC30MAGIC;
    2611       return true;
     2621      return TRUE;
    26122622#endif
    26132623
    26142624#ifdef TICOFF_DEFAULT_MAGIC
    26152625    case TICOFF_TARGET_ARCH:
    2616       /* if there's no indication of which version we want, use the default */
     2626      /* If there's no indication of which version we want, use the default. */
    26172627      if (!abfd->xvec )
    26182628        *magicp = TICOFF_DEFAULT_MAGIC;
    26192629      else
    26202630        {
    2621           /* we may want to output in a different COFF version */
     2631          /* We may want to output in a different COFF version. */
    26222632          switch (abfd->xvec->name[4])
    26232633            {
     
    26322642              break;
    26332643            default:
    2634               return false;
     2644              return FALSE;
    26352645            }
    26362646        }
    2637       return true;
     2647      TICOFF_TARGET_MACHINE_SET (flagsp, bfd_get_mach (abfd));
     2648      return TRUE;
    26382649#endif
    26392650
     
    26412652    case bfd_arch_tic80:
    26422653      *magicp = TIC80_ARCH_MAGIC;
    2643       return true;
     2654      return TRUE;
    26442655#endif
    26452656#ifdef ARMMAGIC
     
    26732684        case bfd_mach_arm_4T: * flagsp |= F_ARM_4T; break;
    26742685        case bfd_mach_arm_5:  * flagsp |= F_ARM_5;  break;
    2675           /* FIXME: we do not have F_ARM vaues greater than F_ARM_5.  */
     2686          /* FIXME: we do not have F_ARM vaues greater than F_ARM_5.
     2687             See also the comment in coff_set_arch_mach_hook().  */
    26762688        case bfd_mach_arm_5T: * flagsp |= F_ARM_5;  break;
    26772689        case bfd_mach_arm_5TE: * flagsp |= F_ARM_5; break;
    26782690        case bfd_mach_arm_XScale: * flagsp |= F_ARM_5; break;
    26792691        }
    2680       return true;
     2692      return TRUE;
    26812693#endif
    26822694#ifdef PPCMAGIC
    26832695    case bfd_arch_powerpc:
    26842696      *magicp = PPCMAGIC;
    2685       return true;
     2697      return TRUE;
    26862698      break;
    26872699#endif
     
    26932705      *magicp = LYNXCOFFMAGIC;
    26942706#endif
    2695       return true;
     2707      return TRUE;
    26962708      break;
    26972709#endif
     
    26992711    case bfd_arch_i860:
    27002712      *magicp = I860MAGIC;
    2701       return true;
     2713      return TRUE;
    27022714      break;
    27032715#endif
     
    27052717    case bfd_arch_ia64:
    27062718      *magicp = IA64MAGIC;
    2707       return true;
     2719      return TRUE;
    27082720      break;
    27092721#endif
     
    27242736      *magicp = LYNXCOFFMAGIC;
    27252737#endif
    2726       return true;
     2738      return TRUE;
    27272739      break;
    27282740#endif
     
    27312743    case bfd_arch_m88k:
    27322744      *magicp = MC88OMAGIC;
    2733       return true;
     2745      return TRUE;
    27342746      break;
    27352747#endif
     
    27402752        case bfd_mach_h8300:
    27412753          *magicp = H8300MAGIC;
    2742           return true;
     2754          return TRUE;
    27432755        case bfd_mach_h8300h:
    27442756          *magicp = H8300HMAGIC;
    2745           return true;
     2757          return TRUE;
    27462758        case bfd_mach_h8300s:
    27472759          *magicp = H8300SMAGIC;
    2748           return true;
     2760          return TRUE;
     2761        case bfd_mach_h8300hn:
     2762          *magicp = H8300HNMAGIC;
     2763          return TRUE;
     2764        case bfd_mach_h8300sn:
     2765          *magicp = H8300SNMAGIC;
     2766          return TRUE;
    27492767        }
    27502768      break;
     
    27612779        *magicp = SH_ARCH_MAGIC_LITTLE;
    27622780#endif
    2763       return true;
     2781      return TRUE;
    27642782      break;
    27652783#endif
     
    27682786    case bfd_arch_mips:
    27692787      *magicp = MIPS_ARCH_MAGIC_WINCE;
    2770       return true;
     2788      return TRUE;
    27712789      break;
    27722790#endif
     
    27792797      *magicp = LYNXCOFFMAGIC;
    27802798#endif
    2781       return true;
     2799      return TRUE;
    27822800      break;
    27832801#endif
     
    27862804    case bfd_arch_h8500:
    27872805      *magicp = H8500MAGIC;
    2788       return true;
     2806      return TRUE;
    27892807      break;
    27902808#endif
     
    27952813      else
    27962814        *magicp = A29K_MAGIC_LITTLE;
    2797       return true;
     2815      return TRUE;
    27982816      break;
    27992817#endif
     
    28022820    case bfd_arch_we32k:
    28032821      *magicp = WE32KMAGIC;
    2804       return true;
     2822      return TRUE;
    28052823      break;
    28062824#endif
     
    28112829    case bfd_arch_powerpc:
    28122830#endif
    2813 #ifdef XCOFF64
    2814       if (bfd_get_mach (abfd) == bfd_mach_ppc_620
    2815           && !strncmp (abfd->xvec->name,"aix", 3))
    2816         *magicp = U803XTOCMAGIC;
    2817       else
    2818 #else
    2819         *magicp = U802TOCMAGIC;
    2820 #endif
    2821       return true;
     2831      BFD_ASSERT (bfd_get_flavour (abfd) == bfd_target_xcoff_flavour);
     2832      *magicp = bfd_xcoff_magic_number (abfd);
     2833      return TRUE;
    28222834      break;
    28232835#endif
     
    28262838    case bfd_arch_mcore:
    28272839      * magicp = MCOREMAGIC;
    2828       return true;
     2840      return TRUE;
    28292841#endif
    28302842
     
    28322844    case bfd_arch_w65:
    28332845      *magicp = W65MAGIC;
    2834       return true;
     2846      return TRUE;
     2847#endif
     2848
     2849#ifdef OR32_MAGIC_BIG
     2850    case bfd_arch_or32:
     2851      if (bfd_big_endian (abfd))
     2852        * magicp = OR32_MAGIC_BIG;
     2853      else
     2854        * magicp = OR32_MAGIC_LITTLE;
     2855      return TRUE;
    28352856#endif
    28362857
    28372858    default:                    /* Unknown architecture.  */
    2838       /* Fall through to "return false" below, to avoid
     2859      /* Fall through to "return FALSE" below, to avoid
    28392860         "statement never reached" errors on the one below.  */
    28402861      break;
    28412862    }
    28422863
    2843   return false;
     2864  return FALSE;
    28442865}
    28452866
    2846 static boolean
     2867static bfd_boolean
    28472868coff_set_arch_mach (abfd, arch, machine)
    28482869     bfd * abfd;
     
    28542875
    28552876  if (! bfd_default_set_arch_mach (abfd, arch, machine))
    2856     return false;
    2857 
    2858   if (arch != bfd_arch_unknown &&
    2859       coff_set_flags (abfd, &dummy1, &dummy2) != true)
    2860     return false;               /* We can't represent this type */
    2861 
    2862   return true;                  /* We're easy ...  */
     2877    return FALSE;
     2878
     2879  if (arch != bfd_arch_unknown
     2880      && ! coff_set_flags (abfd, &dummy1, &dummy2))
     2881    return FALSE;               /* We can't represent this type */
     2882
     2883  return TRUE;                  /* We're easy ...  */
    28632884}
    28642885
     
    28972918#endif
    28982919
    2899 static boolean
     2920static bfd_boolean
    29002921coff_compute_section_file_positions (abfd)
    29012922     bfd * abfd;
     
    29042925  asection *previous = (asection *) NULL;
    29052926  file_ptr sofar = bfd_coff_filhsz (abfd);
    2906   boolean align_adjust;
     2927  bfd_boolean align_adjust;
    29072928#ifdef ALIGN_SECTIONS_IN_FILE
    29082929  file_ptr old_sofar;
     
    29963017       target_index values right.  */
    29973018
    2998     int count;
     3019    unsigned int count;
    29993020    asection **section_list;
    3000     int i;
     3021    unsigned int i;
    30013022    int target_index;
     3023    bfd_size_type amt;
    30023024
    30033025    count = 0;
     
    30063028
    30073029    /* We allocate an extra cell to simplify the final loop.  */
    3008     section_list = bfd_malloc (sizeof (struct asection *) * (count + 1));
     3030    amt = sizeof (struct asection *) * (count + 1);
     3031    section_list = bfd_malloc (amt);
    30093032    if (section_list == NULL)
    3010       return false;
     3033      return FALSE;
    30113034
    30123035    i = 0;
     
    30463069          current->target_index = target_index++;
    30473070      }
     3071    abfd->section_tail = &current->next;
    30483072
    30493073    free (section_list);
     
    30603084#endif /* ! COFF_IMAGE_WITH_PE */
    30613085
    3062   align_adjust = false;
     3086  align_adjust = FALSE;
    30633087  for (current = abfd->sections;
    30643088       current != (asection *) NULL;
     
    30703094      if (coff_section_data (abfd, current) == NULL)
    30713095        {
    3072           current->used_by_bfd =
    3073             (PTR) bfd_zalloc (abfd, sizeof (struct coff_section_tdata));
     3096          bfd_size_type amt = sizeof (struct coff_section_tdata);
     3097          current->used_by_bfd = (PTR) bfd_zalloc (abfd, amt);
    30743098          if (current->used_by_bfd == NULL)
    3075             return false;
     3099            return FALSE;
    30763100        }
    30773101      if (pei_section_data (abfd, current) == NULL)
    30783102        {
    3079           coff_section_data (abfd, current)->tdata =
    3080             (PTR) bfd_zalloc (abfd, sizeof (struct pei_section_tdata));
     3103          bfd_size_type amt = sizeof (struct pei_section_tdata);
     3104          coff_section_data (abfd, current)->tdata
     3105            = (PTR) bfd_zalloc (abfd, amt);
    30813106          if (coff_section_data (abfd, current)->tdata == NULL)
    3082             return false;
     3107            return FALSE;
    30833108        }
    30843109      if (pei_section_data (abfd, current)->virt_size == 0)
     
    31033128      if ((abfd->flags & EXEC_P) != 0)
    31043129        {
    3105           /* make sure this section is aligned on the right boundary - by
    3106              padding the previous section up if necessary */
     3130          /* Make sure this section is aligned on the right boundary - by
     3131             padding the previous section up if necessary. */
    31073132
    31083133          old_sofar = sofar;
    3109           sofar = BFD_ALIGN (sofar, 1 << current->alignment_power);
     3134#ifdef RS6000COFF_C
     3135          /* AIX loader checks the text section alignment of (vma - filepos)
     3136             So even though the filepos may be aligned wrt the o_algntext, for
     3137             AIX executables, this check fails. This shows up when a native
     3138             AIX executable is stripped with gnu strip because the default vma
     3139             of native is 0x10000150 but default for gnu is 0x10000140.  Gnu
     3140             stripped gnu excutable passes this check because the filepos is
     3141             0x0140.  This problem also show up with 64 bit shared objects. The
     3142             data section must also be aligned.  */
     3143          if (!strcmp (current->name, _TEXT)
     3144              || !strcmp (current->name, _DATA))
     3145            {
     3146              bfd_vma pad;
     3147              bfd_vma align;
     3148
     3149              sofar = BFD_ALIGN (sofar, 1 << current->alignment_power);
     3150
     3151              align = 1 << current->alignment_power;
     3152              pad = abs (current->vma - sofar) % align;
     3153
     3154              if (pad)
     3155                {
     3156                  pad = align - pad;
     3157                  sofar += pad;
     3158                }
     3159            }
     3160          else
     3161#else
     3162            {
     3163              sofar = BFD_ALIGN (sofar, 1 << current->alignment_power);
     3164            }
     3165#endif
    31103166          if (previous != (asection *) NULL)
    3111             {
    3112               previous->_raw_size += sofar - old_sofar;
    3113             }
     3167            previous->_raw_size += sofar - old_sofar;
    31143168        }
    31153169
     
    31333187
    31343188#ifdef ALIGN_SECTIONS_IN_FILE
    3135       /* make sure that this section is of the right size too */
     3189      /* Make sure that this section is of the right size too. */
    31363190      if ((abfd->flags & EXEC_P) == 0)
    31373191        {
     
    31583212         unaligned _raw_size.  */
    31593213      if (pei_section_data (abfd, current)->virt_size < current->_raw_size)
    3160         align_adjust = true;
     3214        align_adjust = TRUE;
    31613215#endif
    31623216
     
    31833237      b = 0;
    31843238      if (bfd_seek (abfd, sofar - 1, SEEK_SET) != 0
    3185           || bfd_write (&b, 1, 1, abfd) != 1)
    3186         return false;
     3239          || bfd_bwrite (&b, (bfd_size_type) 1, abfd) != 1)
     3240        return FALSE;
    31873241    }
    31883242
     
    31933247
    31943248  obj_relocbase (abfd) = sofar;
    3195   abfd->output_has_begun = true;
    3196 
    3197   return true;
     3249  abfd->output_has_begun = TRUE;
     3250
     3251  return TRUE;
    31983252}
    31993253
     
    32073261/* @@ Should we only be adding missing symbols, or overriding the aux
    32083262   values for existing section symbols?  */
    3209 static boolean
     3263static bfd_boolean
    32103264coff_add_missing_symbols (abfd)
    32113265     bfd *abfd;
     
    32163270  unsigned int i;
    32173271  int need_text = 1, need_data = 1, need_bss = 1, need_file = 1;
     3272  bfd_size_type amt;
    32183273
    32193274  for (i = 0; i < nsyms; i++)
    32203275    {
    32213276      coff_symbol_type *csym = coff_symbol_from (abfd, sympp[i]);
    3222       CONST char *name;
     3277      const char *name;
     3278
    32233279      if (csym)
    32243280        {
    3225           /* only do this if there is a coff representation of the input
    3226            symbol */
     3281          /* Only do this if there is a coff representation of the input
     3282             symbol. */
    32273283          if (csym->native && csym->native->u.syment.n_sclass == C_FILE)
    32283284            {
     
    32503306
    32513307  if (!need_text && !need_data && !need_bss && !need_file)
    3252     return true;
     3308    return TRUE;
    32533309  nsyms += need_text + need_data + need_bss + need_file;
    3254   sympp2 = (asymbol **) bfd_alloc (abfd, nsyms * sizeof (asymbol *));
     3310  amt = nsyms;
     3311  amt *= sizeof (asymbol *);
     3312  sympp2 = (asymbol **) bfd_alloc (abfd, amt);
    32553313  if (!sympp2)
    3256     return false;
     3314    return FALSE;
    32573315  memcpy (sympp2, sympp, i * sizeof (asymbol *));
     3316
    32583317  if (need_file)
    3259     {
    3260       /* @@ Generate fake .file symbol, in sympp2[i], and increment i.  */
    3261       abort ();
    3262     }
     3318    /* @@ Generate fake .file symbol, in sympp2[i], and increment i.  */
     3319    abort ();
     3320
    32633321  if (need_text)
    32643322    sympp2[i++] = coff_section_symbol (abfd, _TEXT);
     
    32693327  BFD_ASSERT (i == nsyms);
    32703328  bfd_set_symtab (abfd, sympp2, nsyms);
    3271   return true;
     3329  return TRUE;
    32723330}
    32733331
    32743332#endif /* 0 */
     3333
     3334#ifdef COFF_IMAGE_WITH_PE
     3335
     3336static unsigned int pelength;
     3337static unsigned int peheader;
     3338
     3339static bfd_boolean
     3340coff_read_word (abfd, value)
     3341  bfd *abfd;
     3342  unsigned int *value;
     3343{
     3344  unsigned char b[2];
     3345  int status;
     3346
     3347  status = bfd_bread (b, (bfd_size_type) 2, abfd);
     3348  if (status < 1)
     3349    {
     3350      *value = 0;
     3351      return FALSE;
     3352    }
     3353
     3354  if (status == 1)
     3355    *value = (unsigned int) b[0];
     3356  else
     3357    *value = (unsigned int) (b[0] + (b[1] << 8));
     3358
     3359  pelength += (unsigned int) status;
     3360
     3361  return TRUE;
     3362}
     3363
     3364static unsigned int
     3365coff_compute_checksum (abfd)
     3366  bfd *abfd;
     3367{
     3368  bfd_boolean more_data;
     3369  file_ptr filepos;
     3370  unsigned int value;
     3371  unsigned int total;
     3372
     3373  total = 0;
     3374  pelength = 0;
     3375  filepos = (file_ptr) 0;
     3376
     3377  do
     3378    {
     3379      if (bfd_seek (abfd, filepos, SEEK_SET) != 0)
     3380        return 0;
     3381
     3382      more_data = coff_read_word (abfd, &value);
     3383      total += value;
     3384      total = 0xffff & (total + (total >> 0x10));
     3385      filepos += 2;
     3386    }
     3387  while (more_data);
     3388
     3389  return (0xffff & (total + (total >> 0x10)));
     3390}
     3391
     3392static bfd_boolean
     3393coff_apply_checksum (abfd)
     3394  bfd *abfd;
     3395{
     3396  unsigned int computed;
     3397  unsigned int checksum = 0;
     3398
     3399  if (bfd_seek (abfd, 0x3c, SEEK_SET) != 0)
     3400    return FALSE;
     3401
     3402  if (!coff_read_word (abfd, &peheader))
     3403    return FALSE;
     3404
     3405  if (bfd_seek (abfd, peheader + 0x58, SEEK_SET) != 0)
     3406    return FALSE;
     3407
     3408  checksum = 0;
     3409  bfd_bwrite (&checksum, (bfd_size_type) 4, abfd);
     3410
     3411  if (bfd_seek (abfd, peheader, SEEK_SET) != 0)
     3412    return FALSE;
     3413
     3414  computed = coff_compute_checksum (abfd);
     3415
     3416  checksum = computed + pelength;
     3417
     3418  if (bfd_seek (abfd, peheader + 0x58, SEEK_SET) != 0)
     3419    return FALSE;
     3420
     3421  bfd_bwrite (&checksum, (bfd_size_type) 4, abfd);
     3422
     3423  return TRUE;
     3424}
     3425
     3426#endif /* COFF_IMAGE_WITH_PE */
    32753427
    32763428/* SUPPRESS 558 */
    32773429/* SUPPRESS 529 */
    3278 static boolean
     3430static bfd_boolean
    32793431coff_write_object_contents (abfd)
    32803432     bfd * abfd;
    32813433{
    32823434  asection *current;
    3283   boolean hasrelocs = false;
    3284   boolean haslinno = false;
    3285   boolean hasdebug = false;
     3435  bfd_boolean hasrelocs = FALSE;
     3436  bfd_boolean haslinno = FALSE;
     3437  bfd_boolean hasdebug = FALSE;
    32863438  file_ptr scn_base;
    32873439  file_ptr reloc_base;
     
    32903442  unsigned long reloc_size = 0, reloc_count = 0;
    32913443  unsigned long lnno_size = 0;
    3292   boolean long_section_names;
     3444  bfd_boolean long_section_names;
    32933445  asection *text_sec = NULL;
    32943446  asection *data_sec = NULL;
     
    33033455
    33043456  /* Make a pass through the symbol table to count line number entries and
    3305      put them into the correct asections */
     3457     put them into the correct asections. */
    33063458
    33073459  lnno_size = coff_count_linenumbers (abfd) * bfd_coff_linesz (abfd);
    33083460
    3309   if (abfd->output_has_begun == false)
     3461  if (! abfd->output_has_begun)
    33103462    {
    33113463      if (! coff_compute_section_file_positions (abfd))
    3312         return false;
     3464        return FALSE;
    33133465    }
    33143466
    33153467  reloc_base = obj_relocbase (abfd);
    33163468
    3317   /* Work out the size of the reloc and linno areas */
     3469  /* Work out the size of the reloc and linno areas. */
    33183470
    33193471  for (current = abfd->sections; current != NULL; current =
     
    33213473    {
    33223474#ifdef COFF_WITH_PE
    3323       /* we store the actual reloc count in the first reloc's addr */
    3324       if (current->reloc_count > 0xffff)
     3475      /* We store the actual reloc count in the first reloc's addr. */
     3476      if (obj_pe (abfd) && current->reloc_count >= 0xffff)
    33253477        reloc_count ++;
    33263478#endif
     
    33333485  sym_base = lineno_base + lnno_size;
    33343486
    3335   /* Indicate in each section->line_filepos its actual file address */
     3487  /* Indicate in each section->line_filepos its actual file address. */
    33363488  for (current = abfd->sections; current != NULL; current =
    33373489       current->next)
     
    33523504          reloc_base += current->reloc_count * bfd_coff_relsz (abfd);
    33533505#ifdef COFF_WITH_PE
    3354           /* extra reloc to hold real count */
    3355           if (current->reloc_count > 0xffff)
     3506          /* Extra reloc to hold real count. */
     3507          if (obj_pe (abfd) && current->reloc_count >= 0xffff)
    33563508            reloc_base += bfd_coff_relsz (abfd);
    33573509#endif
     
    33723524      scn_base = bfd_coff_filhsz (abfd);
    33733525#ifdef RS6000COFF_C
     3526#ifndef XCOFF64
    33743527      if (xcoff_data (abfd)->full_aouthdr)
    33753528        scn_base += bfd_coff_aoutsz (abfd);
     
    33773530        scn_base += SMALL_AOUTSZ;
    33783531#endif
     3532#endif
    33793533    }
    33803534
    33813535  if (bfd_seek (abfd, scn_base, SEEK_SET) != 0)
    3382     return false;
    3383 
    3384   long_section_names = false;
     3536    return FALSE;
     3537
     3538  long_section_names = FALSE;
    33853539  for (current = abfd->sections;
    33863540       current != NULL;
     
    33883542    {
    33893543      struct internal_scnhdr section;
    3390       boolean is_reloc_section = false;
     3544      bfd_boolean is_reloc_section = FALSE;
    33913545
    33923546#ifdef COFF_IMAGE_WITH_PE
    33933547      if (strcmp (current->name, ".reloc") == 0)
    33943548        {
    3395           is_reloc_section = true;
    3396           hasrelocs = true;
     3549          is_reloc_section = TRUE;
     3550          hasrelocs = TRUE;
    33973551          pe_data (abfd)->has_reloc_section = 1;
    33983552        }
     
    34153569            sprintf (section.s_name, "/%lu", (unsigned long) string_size);
    34163570            string_size += len + 1;
    3417             long_section_names = true;
     3571            long_section_names = TRUE;
    34183572          }
    34193573      }
     
    34463600#endif
    34473601
    3448       /*
    3449          If this section has no size or is unloadable then the scnptr
    3450          will be 0 too
    3451          */
     3602      /* If this section has no size or is unloadable then the scnptr
     3603         will be 0 too.  */
    34523604      if (current->_raw_size == 0 ||
    34533605          (current->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0)
    3454         {
    3455           section.s_scnptr = 0;
    3456         }
     3606        section.s_scnptr = 0;
    34573607      else
    3458         {
    3459           section.s_scnptr = current->filepos;
    3460         }
     3608        section.s_scnptr = current->filepos;
     3609
    34613610      section.s_relptr = current->rel_filepos;
    34623611      section.s_lnnoptr = current->line_filepos;
     
    34663615      /* In PEI, relocs come in the .reloc section.  */
    34673616      if (current->reloc_count != 0)
    3468         hasrelocs = true;
     3617        hasrelocs = TRUE;
    34693618#endif
    34703619      if (current->lineno_count != 0)
    3471         haslinno = true;
     3620        haslinno = TRUE;
    34723621      if ((current->flags & SEC_DEBUGGING) != 0
    34733622          && ! is_reloc_section)
    3474         hasdebug = true;
     3623        hasdebug = TRUE;
    34753624
    34763625#ifdef RS6000COFF_C
     
    34883637
    34893638      if (!strcmp (current->name, _TEXT))
    3490         {
    3491           text_sec = current;
    3492         }
     3639        text_sec = current;
    34933640      else if (!strcmp (current->name, _DATA))
    3494         {
    3495           data_sec = current;
    3496         }
     3641        data_sec = current;
    34973642      else if (!strcmp (current->name, _BSS))
    3498         {
    3499           bss_sec = current;
    3500         }
     3643        bss_sec = current;
    35013644
    35023645#ifdef I960
     
    35063649#endif
    35073650#ifdef TIC80COFF
    3508       /* TI COFF puts the alignment power in bits 8-11 of the flags */
     3651      /* TI COFF puts the alignment power in bits 8-11 of the flags. */
    35093652      section.s_flags |= (current->alignment_power & 0xF) << 8;
    35103653#endif
     
    35253668        {
    35263669          SCNHDR buff;
     3670          bfd_size_type amt = bfd_coff_scnhsz (abfd);
     3671
    35273672          if (coff_swap_scnhdr_out (abfd, &section, &buff) == 0
    3528               || bfd_write ((PTR) (&buff), 1, bfd_coff_scnhsz (abfd), abfd)
    3529               != bfd_coff_scnhsz (abfd))
    3530             return false;
     3673              || bfd_bwrite ((PTR) &buff, amt, abfd) != amt)
     3674            return FALSE;
    35313675        }
    35323676
     
    36273771
    36283772#ifdef RS6000COFF_C
     3773#ifndef XCOFF64
    36293774  /* XCOFF handles overflows in the reloc and line number count fields
    36303775     by creating a new section header to hold the correct values.  */
     
    36353780          struct internal_scnhdr scnhdr;
    36363781          SCNHDR buff;
     3782          bfd_size_type amt;
    36373783
    36383784          internal_f.f_nscns++;
     
    36473793          scnhdr.s_nlnno = current->target_index;
    36483794          scnhdr.s_flags = STYP_OVRFLO;
     3795          amt = bfd_coff_scnhsz (abfd);
    36493796          if (coff_swap_scnhdr_out (abfd, &scnhdr, &buff) == 0
    3650               || bfd_write ((PTR) &buff, 1, bfd_coff_scnhsz (abfd), abfd)
    3651               != bfd_coff_scnhsz (abfd))
    3652             return false;
     3797              || bfd_bwrite ((PTR) &buff, amt, abfd) != amt)
     3798            return FALSE;
    36533799        }
    36543800    }
    36553801#endif
     3802#endif
    36563803
    36573804  /* OK, now set up the filehdr...  */
     
    36593806  /* Don't include the internal abs section in the section count */
    36603807
    3661   /*
    3662      We will NOT put a fucking timestamp in the header here. Every time you
     3808  /* We will NOT put a fucking timestamp in the header here. Every time you
    36633809     put it back, I will come in and take it out again.  I'm sorry.  This
    36643810     field does not belong here.  We fill it with a 0 so it compares the
    3665      same but is not a reasonable time. -- gnu@cygnus.com
    3666      */
     3811     same but is not a reasonable time. -- gnu@cygnus.com  */
    36673812  internal_f.f_timdat = 0;
    3668 
    36693813  internal_f.f_flags = 0;
    36703814
     
    36753819      internal_f.f_opthdr = 0;
    36763820#ifdef RS6000COFF_C
     3821#ifndef XCOFF64
    36773822      if (xcoff_data (abfd)->full_aouthdr)
    36783823        internal_f.f_opthdr = bfd_coff_aoutsz (abfd);
    36793824      else
    36803825        internal_f.f_opthdr = SMALL_AOUTSZ;
     3826#endif
    36813827#endif
    36823828    }
     
    37013847
    37023848#ifdef TI_TARGET_ID
    3703   /* target id is used in TI COFF v1 and later; COFF0 won't use this field,
    3704      but it doesn't hurt to set it internally */
     3849  /* Target id is used in TI COFF v1 and later; COFF0 won't use this field,
     3850     but it doesn't hurt to set it internally. */
    37053851  internal_f.f_target_id = TI_TARGET_ID;
    37063852#endif
     
    37093855#endif
    37103856
    3711   /*
    3712      FIXME, should do something about the other byte orders and
    3713      architectures.
    3714      */
     3857  /* FIXME, should do something about the other byte orders and
     3858     architectures.  */
    37153859
    37163860#ifdef RS6000COFF_C
     
    37233867  memset (&internal_a, 0, sizeof internal_a);
    37243868
    3725   /* Set up architecture-dependent stuff */
    3726 
     3869  /* Set up architecture-dependent stuff.  */
    37273870  {
    37283871    unsigned int magic = 0;
    37293872    unsigned short flags = 0;
     3873
    37303874    coff_set_flags (abfd, &magic, &flags);
    37313875    internal_f.f_magic = magic;
     
    37363880#ifdef ULTRA3                   /* NYU's machine */
    37373881    /* FIXME: This is a bogus check.  I really want to see if there
    3738      * is a .shbss or a .shdata section, if so then set the magic
    3739      * number to indicate a shared data executable.
    3740      */
     3882       is a .shbss or a .shdata section, if so then set the magic
     3883       number to indicate a shared data executable.  */
    37413884    if (internal_f.f_nscns >= 7)
    3742       internal_a.magic = SHMAGIC; /* Shared magic */
     3885      internal_a.magic = SHMAGIC; /* Shared magic. */
    37433886    else
    37443887#endif /* ULTRA3 */
    3745       internal_a.magic = NMAGIC; /* Assume separate i/d */
     3888      internal_a.magic = NMAGIC; /* Assume separate i/d. */
    37463889#define __A_MAGIC_SET__
    37473890#endif /* A29K */
     
    38433986#endif
    38443987
     3988#ifdef OR32
     3989#define __A_MAGIC_SET__
     3990    internal_a.magic = NMAGIC; /* Assume separate i/d.  */
     3991#endif
     3992
    38453993#ifndef __A_MAGIC_SET__
    38463994#include "Your aouthdr magic number is not being set!"
     
    38534001  internal_a.vstamp = 0;
    38544002
    3855   /* Now should write relocs, strings, syms */
     4003  /* Now should write relocs, strings, syms. */
    38564004  obj_sym_filepos (abfd) = sym_base;
    38574005
     
    38614009#if 0
    38624010      if (!coff_add_missing_symbols (abfd))
    3863         return false;
     4011        return FALSE;
    38644012#endif
    38654013      if (!coff_renumber_symbols (abfd, &firstundef))
    3866         return false;
     4014        return FALSE;
    38674015      coff_mangle_symbols (abfd);
    38684016      if (! coff_write_symbols (abfd))
    3869         return false;
     4017        return FALSE;
    38704018      if (! coff_write_linenumbers (abfd))
    3871         return false;
     4019        return FALSE;
    38724020      if (! coff_write_relocs (abfd, firstundef))
    3873         return false;
     4021        return FALSE;
    38744022    }
    38754023#ifdef COFF_LONG_SECTION_NAMES
     
    38794027         table even if there are no symbols.  */
    38804028      if (! coff_write_symbols (abfd))
    3881         return false;
     4029        return FALSE;
    38824030    }
    38834031#endif
     
    38924040      b = 0;
    38934041      if (bfd_seek (abfd,
    3894                     BFD_ALIGN (sym_base, COFF_PAGE_SIZE) - 1,
     4042                    (file_ptr) BFD_ALIGN (sym_base, COFF_PAGE_SIZE) - 1,
    38954043                    SEEK_SET) != 0
    3896           || bfd_write (&b, 1, 1, abfd) != 1)
    3897         return false;
     4044          || bfd_bwrite (&b, (bfd_size_type) 1, abfd) != 1)
     4045        return FALSE;
    38984046    }
    38994047#endif
     
    39984146              break;
    39994147            case bfd_arch_powerpc:
    4000               if (bfd_get_mach (abfd) == 0)
     4148              if (bfd_get_mach (abfd) == bfd_mach_ppc)
    40014149                internal_a.o_cputype = 3;
    40024150              else
     
    40144162  /* now write them */
    40154163  if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
    4016     return false;
     4164    return FALSE;
    40174165
    40184166  {
    40194167    char * buff;
    4020     bfd_size_type amount;
    4021 
    4022     buff = bfd_malloc (bfd_coff_filhsz (abfd));
     4168    bfd_size_type amount = bfd_coff_filhsz (abfd);
     4169
     4170    buff = bfd_malloc (amount);
    40234171    if (buff == NULL)
    4024       return false;
    4025 
    4026     bfd_coff_swap_filehdr_out (abfd, (PTR) & internal_f, (PTR) buff);
    4027     amount = bfd_write ((PTR) buff, 1, bfd_coff_filhsz (abfd), abfd);
     4172      return FALSE;
     4173
     4174    bfd_coff_swap_filehdr_out (abfd, (PTR) &internal_f, (PTR) buff);
     4175    amount = bfd_bwrite ((PTR) buff, amount, abfd);
    40284176
    40294177    free (buff);
    40304178
    40314179    if (amount != bfd_coff_filhsz (abfd))
    4032       return false;
     4180      return FALSE;
    40334181  }
    40344182
     
    40364184    {
    40374185      /* Note that peicode.h fills in a PEAOUTHDR, not an AOUTHDR.
    4038          include/coff/pe.h sets AOUTSZ == sizeof (PEAOUTHDR)) */
     4186         include/coff/pe.h sets AOUTSZ == sizeof (PEAOUTHDR)). */
    40394187      char * buff;
    4040       bfd_size_type amount;
    4041 
    4042       buff = bfd_malloc (bfd_coff_aoutsz (abfd));
     4188      bfd_size_type amount = bfd_coff_aoutsz (abfd);
     4189
     4190      buff = bfd_malloc (amount);
    40434191      if (buff == NULL)
    4044         return false;
    4045 
    4046       coff_swap_aouthdr_out (abfd, (PTR) & internal_a, (PTR) buff);
    4047       amount = bfd_write ((PTR) buff, 1, bfd_coff_aoutsz (abfd), abfd);
     4192        return FALSE;
     4193
     4194      coff_swap_aouthdr_out (abfd, (PTR) &internal_a, (PTR) buff);
     4195      amount = bfd_bwrite ((PTR) buff, amount, abfd);
    40484196
    40494197      free (buff);
    40504198
    40514199      if (amount != bfd_coff_aoutsz (abfd))
    4052         return false;
     4200        return FALSE;
     4201
     4202#ifdef COFF_IMAGE_WITH_PE
     4203      if (! coff_apply_checksum (abfd))
     4204        return FALSE;
     4205#endif
    40534206    }
    40544207#ifdef RS6000COFF_C
     
    40644217      else
    40654218        size = SMALL_AOUTSZ;
    4066       if (bfd_write ((PTR) &buff, 1, size, abfd) != size)
    4067         return false;
    4068     }
    4069 #endif
    4070 
    4071   return true;
     4219      if (bfd_bwrite ((PTR) &buff, (bfd_size_type) size, abfd) != size)
     4220        return FALSE;
     4221    }
     4222#endif
     4223
     4224  return TRUE;
    40724225}
    40734226
    4074 static boolean
     4227static bfd_boolean
    40754228coff_set_section_contents (abfd, section, location, offset, count)
    40764229     bfd * abfd;
     
    40804233     bfd_size_type count;
    40814234{
    4082   if (abfd->output_has_begun == false)  /* set by bfd.c handler */
     4235  if (! abfd->output_has_begun) /* Set by bfd.c handler. */
    40834236    {
    40844237      if (! coff_compute_section_file_positions (abfd))
    4085         return false;
     4238        return FALSE;
    40864239    }
    40874240
     
    41074260      <robertl@arnet.com> (Thanks!).
    41084261
    4109       Gvran Uddeborg <gvran@uddeborg.pp.se> */
     4262      Gvran Uddeborg <gvran@uddeborg.pp.se>. */
    41104263
    41114264    if (strcmp (section->name, _LIB) == 0)
     
    41294282       see if the filepos has not been set.  */
    41304283  if (section->filepos == 0)
    4131     return true;
    4132 
    4133   if (bfd_seek (abfd, (file_ptr) (section->filepos + offset), SEEK_SET) != 0)
    4134     return false;
    4135 
    4136   if (count != 0)
    4137     {
    4138       return (bfd_write (location, 1, count, abfd) == count) ? true : false;
    4139     }
    4140   return true;
     4284    return TRUE;
     4285
     4286  if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0)
     4287    return FALSE;
     4288
     4289  if (count == 0)
     4290    return TRUE;
     4291
     4292  return bfd_bwrite (location, count, abfd) == count;
    41414293}
    41424294#if 0
    4143 static boolean
     4295static bfd_boolean
    41444296coff_close_and_cleanup (abfd)
    41454297     bfd *abfd;
     
    41504302      case bfd_archive:
    41514303        if (!_bfd_write_archive_contents (abfd))
    4152           return false;
     4304          return FALSE;
    41534305        break;
    41544306      case bfd_object:
    41554307        if (!coff_write_object_contents (abfd))
    4156           return false;
     4308          return FALSE;
    41574309        break;
    41584310      default:
    41594311        bfd_set_error (bfd_error_invalid_operation);
    4160         return false;
     4312        return FALSE;
    41614313      }
    41624314
    41634315  /* We depend on bfd_close to free all the memory on the objalloc.  */
    4164   return true;
     4316  return TRUE;
    41654317}
    41664318
     
    41684320
    41694321static PTR
    4170 buy_and_read (abfd, where, seek_direction, size)
     4322buy_and_read (abfd, where, size)
    41714323     bfd *abfd;
    41724324     file_ptr where;
    4173      int seek_direction;
    4174      size_t size;
     4325     bfd_size_type size;
    41754326{
    41764327  PTR area = (PTR) bfd_alloc (abfd, size);
    41774328  if (!area)
    41784329    return (NULL);
    4179   if (bfd_seek (abfd, where, seek_direction) != 0
    4180       || bfd_read (area, 1, size, abfd) != size)
     4330  if (bfd_seek (abfd, where, SEEK_SET) != 0
     4331      || bfd_bread (area, size, abfd) != size)
    41814332    return (NULL);
    41824333  return (area);
     
    42074358*/
    42084359
    4209 static boolean
     4360static bfd_boolean
    42104361coff_slurp_line_table (abfd, asect)
    42114362     bfd *abfd;
     
    42144365  LINENO *native_lineno;
    42154366  alent *lineno_cache;
     4367  bfd_size_type amt;
    42164368
    42174369  BFD_ASSERT (asect->lineno == (alent *) NULL);
    42184370
    4219   native_lineno = (LINENO *) buy_and_read (abfd,
    4220                                            asect->line_filepos,
    4221                                            SEEK_SET,
    4222                                            (size_t) (bfd_coff_linesz (abfd) *
    4223                                                      asect->lineno_count));
    4224   lineno_cache =
    4225     (alent *) bfd_alloc (abfd, (size_t) ((asect->lineno_count + 1) * sizeof (alent)));
     4371  amt = (bfd_size_type) bfd_coff_linesz (abfd) * asect->lineno_count;
     4372  native_lineno = (LINENO *) buy_and_read (abfd, asect->line_filepos, amt);
     4373  amt = ((bfd_size_type) asect->lineno_count + 1) * sizeof (alent);
     4374  lineno_cache = (alent *) bfd_alloc (abfd, amt);
    42264375  if (lineno_cache == NULL)
    4227     return false;
     4376    return FALSE;
    42284377  else
    42294378    {
     
    42354384        {
    42364385          struct internal_lineno dst;
     4386
    42374387          bfd_coff_swap_lineno_in (abfd, src, &dst);
    42384388          cache_ptr->line_number = dst.l_lnno;
     
    42404390          if (cache_ptr->line_number == 0)
    42414391            {
    4242               boolean warned;
    4243               long symndx;
     4392              bfd_boolean warned;
     4393              bfd_signed_vma symndx;
    42444394              coff_symbol_type *sym;
    42454395
    4246               warned = false;
     4396              warned = FALSE;
    42474397              symndx = dst.l_addr.l_symndx;
    42484398              if (symndx < 0
    4249                   || (unsigned long) symndx >= obj_raw_syment_count (abfd))
     4399                  || (bfd_vma) symndx >= obj_raw_syment_count (abfd))
    42504400                {
    42514401                  (*_bfd_error_handler)
    42524402                    (_("%s: warning: illegal symbol index %ld in line numbers"),
    4253                      bfd_get_filename (abfd), dst.l_addr.l_symndx);
     4403                     bfd_archive_filename (abfd), dst.l_addr.l_symndx);
    42544404                  symndx = 0;
    4255                   warned = true;
     4405                  warned = TRUE;
    42564406                }
    42574407              /* FIXME: We should not be casting between ints and
     
    42654415                  (*_bfd_error_handler)
    42664416                    (_("%s: warning: duplicate line number information for `%s'"),
    4267                      bfd_get_filename (abfd),
     4417                     bfd_archive_filename (abfd),
    42684418                     bfd_asymbol_name (&sym->symbol));
    42694419                }
     
    42854435  asect->lineno = lineno_cache;
    42864436  /* FIXME, free native_lineno here, or use alloca or something.  */
    4287   return true;
     4437  return TRUE;
    42884438}
    42894439
     
    42924442   symbols via coff_link_add_symbols, rather than via this routine.  */
    42934443
    4294 static boolean
     4444static bfd_boolean
    42954445coff_slurp_symbol_table (abfd)
    42964446     bfd * abfd;
     
    42994449  coff_symbol_type *cached_area;
    43004450  unsigned int *table_ptr;
    4301 
     4451  bfd_size_type amt;
    43024452  unsigned int number_of_symbols = 0;
    43034453
    43044454  if (obj_symbols (abfd))
    4305     return true;
    4306 
    4307   /* Read in the symbol table */
     4455    return TRUE;
     4456
     4457  /* Read in the symbol table. */
    43084458  if ((native_symbols = coff_get_normalized_symtab (abfd)) == NULL)
    4309     {
    4310       return (false);
    4311     }                           /* on error */
    4312 
    4313   /* Allocate enough room for all the symbols in cached form */
    4314   cached_area = ((coff_symbol_type *)
    4315                  bfd_alloc (abfd,
    4316                             (obj_raw_syment_count (abfd)
    4317                              * sizeof (coff_symbol_type))));
    4318 
     4459    return FALSE;
     4460
     4461  /* Allocate enough room for all the symbols in cached form.  */
     4462  amt = obj_raw_syment_count (abfd);
     4463  amt *= sizeof (coff_symbol_type);
     4464  cached_area = (coff_symbol_type *) bfd_alloc (abfd, amt);
    43194465  if (cached_area == NULL)
    4320     return false;
    4321   table_ptr = ((unsigned int *)
    4322                bfd_alloc (abfd,
    4323                           (obj_raw_syment_count (abfd)
    4324                            * sizeof (unsigned int))));
     4466    return FALSE;
     4467
     4468  amt = obj_raw_syment_count (abfd);
     4469  amt *= sizeof (unsigned int);
     4470  table_ptr = (unsigned int *) bfd_alloc (abfd, amt);
    43254471
    43264472  if (table_ptr == NULL)
    4327     return false;
     4473    return FALSE;
    43284474  else
    43294475    {
     
    43314477      unsigned int last_native_index = obj_raw_syment_count (abfd);
    43324478      unsigned int this_index = 0;
     4479
    43334480      while (this_index < last_native_index)
    43344481        {
     
    43434490                                                     src->u.syment.n_scnum);
    43444491          dst->symbol.flags = 0;
    4345           dst->done_lineno = false;
     4492          dst->done_lineno = FALSE;
    43464493
    43474494          switch (src->u.syment.n_sclass)
     
    43544501              dst->symbol.flags |= BSF_NOT_AT_END | BSF_FUNCTION;
    43554502#endif
    4356               /* Fall through to next case */
    4357 
     4503              /* Fall through to next case.  */
    43584504#endif
    43594505
     
    43684514#endif
    43694515#ifdef C_SYSTEM
    4370             case C_SYSTEM:      /* System Wide variable */
     4516            case C_SYSTEM:      /* System Wide variable. */
    43714517#endif
    43724518#ifdef COFF_WITH_PE
    4373             /* In PE, 0x68 (104) denotes a section symbol */
     4519            /* In PE, 0x68 (104) denotes a section symbol. */
    43744520            case C_SECTION:
    43754521            /* In PE, 0x69 (105) denotes a weak external symbol.  */
     
    44344580#ifdef COFF_WITH_PE
    44354581              if (src->u.syment.n_sclass == C_NT_WEAK)
    4436                 dst->symbol.flags = BSF_WEAK;
     4582                dst->symbol.flags |= BSF_WEAK;
     4583
    44374584              if (src->u.syment.n_sclass == C_SECTION
    44384585                  && src->u.syment.n_scnum > 0)
    4439                 {
    4440                   dst->symbol.flags = BSF_LOCAL;
    4441                 }
    4442 #endif
    4443 
     4586                dst->symbol.flags = BSF_LOCAL;
     4587#endif
    44444588              if (src->u.syment.n_sclass == C_WEAKEXT)
    4445                 dst->symbol.flags = BSF_WEAK;
     4589                dst->symbol.flags |= BSF_WEAK;
    44464590
    44474591              break;
    44484592
    4449             case C_STAT:        /* static                        */
     4593            case C_STAT:         /* Static. */
    44504594#ifdef I960
    4451             case C_LEAFSTAT:    /* static leaf procedure        */
     4595            case C_LEAFSTAT:     /* Static leaf procedure.  */
    44524596#endif
    44534597#if defined ARM
    4454             case C_THUMBSTAT:   /* Thumb static                  */
    4455             case C_THUMBLABEL:  /* Thumb label                   */
    4456             case C_THUMBSTATFUNC:/* Thumb static function        */
    4457 #endif
    4458             case C_LABEL:       /* label                        */
     4598            case C_THUMBSTAT:    /* Thumb static.  */
     4599            case C_THUMBLABEL:   /* Thumb label.  */
     4600            case C_THUMBSTATFUNC:/* Thumb static function.  */
     4601#endif
     4602            case C_LABEL:        /* Label. */
    44594603              if (src->u.syment.n_scnum == N_DEBUG)
    44604604                dst->symbol.flags = BSF_DEBUGGING;
     
    44794623              break;
    44804624
    4481             case C_MOS: /* member of structure  */
    4482             case C_EOS: /* end of structure              */
    4483 #ifdef NOTDEF                   /* C_AUTOARG has the same value */
     4625            case C_MOS:         /* Member of structure. */
     4626            case C_EOS:         /* End of structure. */
     4627#ifdef NOTDEF                   /* C_AUTOARG has the same value. */
    44844628#ifdef C_GLBLREG
    4485             case C_GLBLREG:     /* A29k-specific storage class */
    4486 #endif
    4487 #endif
    4488             case C_REGPARM:     /* register parameter            */
    4489             case C_REG: /* register variable            */
    4490               /* C_AUTOARG conflictes with TI COFF C_UEXT */
     4629            case C_GLBLREG:     /* A29k-specific storage class. */
     4630#endif
     4631#endif
     4632            case C_REGPARM:     /* Register parameter. */
     4633            case C_REG:         /* register variable. */
     4634              /* C_AUTOARG conflictes with TI COFF C_UEXT. */
    44914635#if !defined (TIC80COFF) && !defined (TICOFF)
    44924636#ifdef C_AUTOARG
    4493             case C_AUTOARG:     /* 960-specific storage class */
    4494 #endif
    4495 #endif
    4496             case C_TPDEF:       /* type definition              */
     4637            case C_AUTOARG:     /* 960-specific storage class. */
     4638#endif
     4639#endif
     4640            case C_TPDEF:       /* Type definition. */
    44974641            case C_ARG:
    4498             case C_AUTO:        /* automatic variable */
    4499             case C_FIELD:       /* bit field */
    4500             case C_ENTAG:       /* enumeration tag              */
    4501             case C_MOE: /* member of enumeration        */
    4502             case C_MOU: /* member of union              */
    4503             case C_UNTAG:       /* union tag                    */
     4642            case C_AUTO:        /* Automatic variable. */
     4643            case C_FIELD:       /* Bit field. */
     4644            case C_ENTAG:       /* Enumeration tag. */
     4645            case C_MOE:         /* Member of enumeration. */
     4646            case C_MOU:         /* Member of union. */
     4647            case C_UNTAG:       /* Union tag. */
    45044648              dst->symbol.flags = BSF_DEBUGGING;
    45054649              dst->symbol.value = (src->u.syment.n_value);
    45064650              break;
    45074651
    4508             case C_FILE:        /* file name                    */
    4509             case C_STRTAG:      /* structure tag                */
     4652            case C_FILE:        /* File name. */
     4653            case C_STRTAG:      /* Structure tag. */
    45104654#ifdef RS6000COFF_C
    45114655            case C_GSYM:
     
    45274671
    45284672#ifdef RS6000COFF_C
    4529             case C_BINCL:       /* beginning of include file     */
    4530             case C_EINCL:       /* ending of include file        */
     4673            case C_BINCL:       /* Beginning of include file.  */
     4674            case C_EINCL:       /* Ending of include file.  */
    45314675              /* The value is actually a pointer into the line numbers
    45324676                 of the file.  We locate the line number entry, and
     
    45694713#endif
    45704714
    4571             case C_BLOCK:       /* ".bb" or ".eb"                */
    4572             case C_FCN:         /* ".bf" or ".ef" (or PE ".lf")  */
    4573             case C_EFCN:        /* physical end of function      */
     4715            case C_BLOCK:       /* ".bb" or ".eb". */
     4716            case C_FCN:         /* ".bf" or ".ef" (or PE ".lf").  */
     4717            case C_EFCN:        /* Physical end of function. */
    45744718#if defined COFF_WITH_PE
    45754719              /* PE sets the symbol to a value relative to the start
     
    45934737              break;
    45944738
    4595             case C_STATLAB:     /* Static load time label */
     4739            case C_STATLAB:     /* Static load time label. */
    45964740              dst->symbol.value = src->u.syment.n_value;
    45974741              dst->symbol.flags = BSF_GLOBAL;
     
    46064750                break;
    46074751              /* Fall through.  */
    4608             case C_EXTDEF:      /* external definition          */
    4609             case C_ULABEL:      /* undefined label              */
    4610             case C_USTATIC:     /* undefined static              */
     4752            case C_EXTDEF:      /* External definition. */
     4753            case C_ULABEL:      /* Undefined label. */
     4754            case C_USTATIC:     /* Undefined static. */
    46114755#ifndef COFF_WITH_PE
    46124756            /* C_LINE in regular coff is 0x68.  NT has taken over this storage
    4613                class to represent a section symbol */
    4614             case C_LINE:        /* line # reformatted as symbol table entry */
     4757               class to represent a section symbol. */
     4758            case C_LINE:        /* line # reformatted as symbol table entry. */
    46154759              /* NT uses 0x67 for a weak symbol, not C_ALIAS.  */
    4616             case C_ALIAS:       /* duplicate tag                */
    4617 #endif
    4618               /* New storage classes for TI COFF */
     4760            case C_ALIAS:       /* Duplicate tag. */
     4761#endif
     4762              /* New storage classes for TI COFF. */
    46194763#if defined(TIC80COFF) || defined(TICOFF)
    4620             case C_UEXT:        /* Tentative external definition */
    4621 #endif
    4622             case C_EXTLAB:      /* External load time label */
    4623             case C_HIDDEN:      /* ext symbol in dmert public lib */
     4764            case C_UEXT:        /* Tentative external definition. */
     4765#endif
     4766            case C_EXTLAB:      /* External load time label. */
     4767            case C_HIDDEN:      /* Ext symbol in dmert public lib. */
    46244768            default:
    46254769              (*_bfd_error_handler)
    46264770                (_("%s: Unrecognized storage class %d for %s symbol `%s'"),
    4627                  bfd_get_filename (abfd), src->u.syment.n_sclass,
     4771                 bfd_archive_filename (abfd), src->u.syment.n_sclass,
    46284772                 dst->symbol.section->name, dst->symbol.name);
    46294773              dst->symbol.flags = BSF_DEBUGGING;
     
    46414785          dst++;
    46424786          number_of_symbols++;
    4643         }                       /* walk the native symtab */
    4644     }                           /* bfdize the native symtab */
     4787        }
     4788    }
    46454789
    46464790  obj_symbols (abfd) = cached_area;
     
    46494793  bfd_get_symcount (abfd) = number_of_symbols;
    46504794  obj_convert (abfd) = table_ptr;
    4651   /* Slurp the line tables for each section too */
     4795  /* Slurp the line tables for each section too. */
    46524796  {
    46534797    asection *p;
     4798
    46544799    p = abfd->sections;
    46554800    while (p)
     
    46594804      }
    46604805  }
    4661   return true;
     4806
     4807  return TRUE;
    46624808}                               /* coff_slurp_symbol_table() */
    46634809
     
    47564902      (*_bfd_error_handler)
    47574903        (_("warning: %s: local symbol `%s' has no section"),
    4758          bfd_get_filename (abfd),
     4904         bfd_archive_filename (abfd),
    47594905         _bfd_coff_internal_syment_name (abfd, syment, buf));
    47604906    }
     
    48114957#endif
    48124958
    4813 static boolean
     4959static bfd_boolean
    48144960coff_slurp_reloc_table (abfd, asect, symbols)
    48154961     bfd * abfd;
     
    48204966  arelent *reloc_cache;
    48214967  arelent *cache_ptr;
    4822 
    48234968  unsigned int idx;
     4969  bfd_size_type amt;
    48244970
    48254971  if (asect->relocation)
    4826     return true;
     4972    return TRUE;
    48274973  if (asect->reloc_count == 0)
    4828     return true;
     4974    return TRUE;
    48294975  if (asect->flags & SEC_CONSTRUCTOR)
    4830     return true;
     4976    return TRUE;
    48314977  if (!coff_slurp_symbol_table (abfd))
    4832     return false;
    4833   native_relocs =
    4834     (RELOC *) buy_and_read (abfd,
    4835                             asect->rel_filepos,
    4836                             SEEK_SET,
    4837                             (size_t) (bfd_coff_relsz (abfd) *
    4838                                       asect->reloc_count));
    4839   reloc_cache = (arelent *)
    4840     bfd_alloc (abfd, (size_t) (asect->reloc_count * sizeof (arelent)));
     4978    return FALSE;
     4979  amt = (bfd_size_type) bfd_coff_relsz (abfd) * asect->reloc_count;
     4980  native_relocs = (RELOC *) buy_and_read (abfd, asect->rel_filepos, amt);
     4981  amt = (bfd_size_type) asect->reloc_count * sizeof (arelent);
     4982  reloc_cache = (arelent *) bfd_alloc (abfd, amt);
    48414983
    48424984  if (reloc_cache == NULL)
    4843     return false;
     4985    return FALSE;
    48444986
    48454987  for (idx = 0; idx < asect->reloc_count; idx++)
     
    48675009              (*_bfd_error_handler)
    48685010                (_("%s: warning: illegal symbol index %ld in relocs"),
    4869                  bfd_get_filename (abfd), dst.r_symndx);
     5011                 bfd_archive_filename (abfd), dst.r_symndx);
    48705012              cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
    48715013              ptr = NULL;
     
    48895031         modified, so we have to have a negative addend to compensate.
    48905032
    4891          Note that symbols which used to be common must be left alone */
    4892 
    4893       /* Calculate any reloc addend by looking at the symbol */
     5033         Note that symbols which used to be common must be left alone. */
     5034
     5035      /* Calculate any reloc addend by looking at the symbol. */
    48945036      CALC_ADDEND (abfd, ptr, dst, cache_ptr);
    48955037
     
    48975039/* !!     cache_ptr->section = (asection *) NULL;*/
    48985040
    4899       /* Fill in the cache_ptr->howto field from dst.r_type */
     5041      /* Fill in the cache_ptr->howto field from dst.r_type. */
    49005042      RTYPE2HOWTO (cache_ptr, &dst);
    49015043#endif  /* RELOC_PROCESSING */
     
    49055047          (*_bfd_error_handler)
    49065048            (_("%s: illegal relocation type %d at address 0x%lx"),
    4907              bfd_get_filename (abfd), dst.r_type, (long) dst.r_vaddr);
     5049             bfd_archive_filename (abfd), dst.r_type, (long) dst.r_vaddr);
    49085050          bfd_set_error (bfd_error_bad_value);
    4909           return false;
     5051          return FALSE;
    49105052        }
    49115053    }
    49125054
    49135055  asect->relocation = reloc_cache;
    4914   return true;
     5056  return TRUE;
    49155057}
    49165058
     
    49655107  if (section->flags & SEC_CONSTRUCTOR)
    49665108    {
    4967       /* this section has relocs made up by us, they are not in the
    4968       file, so take them out of their chain and place them into
    4969        the data area provided */
     5109      /* This section has relocs made up by us, they are not in the
     5110        file, so take them out of their chain and place them into
     5111         the data area provided. */
    49705112      arelent_chain *chain = section->constructor_chain;
     5113
    49715114      for (count = 0; count < section->reloc_count; count++)
    49725115        {
     
    49745117          chain = chain->next;
    49755118        }
    4976 
    49775119    }
    49785120  else
     
    50455187#endif
    50465188
     5189#ifndef coff_bfd_link_hash_table_free
     5190#define coff_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
     5191#endif
     5192
    50475193/* If coff_relocate_section is defined, we can use the optimized COFF
    50485194   backend linker.  Otherwise we must continue to use the old linker.  */
     
    50685214#endif /* ! defined (coff_relocate_section) */
    50695215
     5216#define coff_bfd_link_just_syms _bfd_generic_link_just_syms
    50705217#define coff_bfd_link_split_section  _bfd_generic_link_split_section
    50715218
     
    50845231#ifndef coff_link_output_has_begun
    50855232
    5086 static boolean coff_link_output_has_begun
     5233static bfd_boolean coff_link_output_has_begun
    50875234  PARAMS ((bfd *, struct coff_final_link_info *));
    50885235
    5089 static boolean
     5236static bfd_boolean
    50905237coff_link_output_has_begun (abfd, info)
    50915238     bfd * abfd;
     
    50985245#ifndef coff_final_link_postscript
    50995246
    5100 static boolean coff_final_link_postscript
     5247static bfd_boolean coff_final_link_postscript
    51015248  PARAMS ((bfd *, struct coff_final_link_info *));
    51025249
    5103 static boolean
     5250static bfd_boolean
    51045251coff_final_link_postscript (abfd, pfinfo)
    51055252     bfd * abfd ATTRIBUTE_UNUSED;
    51065253     struct coff_final_link_info * pfinfo ATTRIBUTE_UNUSED;
    51075254{
    5108   return true;
     5255  return TRUE;
    51095256}
    51105257#endif
     
    51625309  FILHSZ, AOUTSZ, SCNHSZ, SYMESZ, AUXESZ, RELSZ, LINESZ, FILNMLEN,
    51635310#ifdef COFF_LONG_FILENAMES
    5164   true,
     5311  TRUE,
    51655312#else
    5166   false,
     5313  FALSE,
    51675314#endif
    51685315#ifdef COFF_LONG_SECTION_NAMES
    5169   true,
     5316  TRUE,
    51705317#else
    5171   false,
     5318  FALSE,
    51725319#endif
    51735320  COFF_DEFAULT_SECTION_ALIGNMENT_POWER,
    51745321#ifdef COFF_FORCE_SYMBOLS_IN_STRINGS
    5175   true,
     5322  TRUE,
    51765323#else
    5177   false,
     5324  FALSE,
    51785325#endif
    51795326#ifdef COFF_DEBUG_STRING_WIDE_PREFIX
     
    52585405#ifndef coff_bfd_gc_sections
    52595406#define coff_bfd_gc_sections                bfd_generic_gc_sections
     5407#endif
     5408
     5409#ifndef coff_bfd_merge_sections
     5410#define coff_bfd_merge_sections             bfd_generic_merge_sections
     5411#endif
     5412
     5413#ifndef coff_bfd_discard_group
     5414#define coff_bfd_discard_group              bfd_generic_discard_group
    52605415#endif
    52615416
Note: See TracChangeset for help on using the changeset viewer.