Ignore:
Timestamp:
Aug 16, 2003, 11:33:53 PM (22 years ago)
Author:
bird
Message:

Joined the port of 2.11.2 with 2.14.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/binutils/bfd/aoutx.h

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r617 r618  
    11/* BFD semi-generic back-end for a.out binaries.
    22   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000,
    3    2001
     3   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/*
     
    106106        to use the
    107107        @file{@var{XXX}.mt} file (by setting "<<bfd_target=XXX>>") when your
    108         configuration is selected.
    109 
    110 */
     108        configuration is selected.  */
    111109
    112110/* Some assumptions:
     
    121119#define KEEPIT udata.i
    122120
    123 #include <ctype.h>
    124121#include "bfd.h"
    125122#include "sysdep.h"
     123#include "safe-ctype.h"
    126124#include "bfdlink.h"
    127125
     
    132130#include "aout/ar.h"
    133131
    134 static boolean aout_get_external_symbols PARAMS ((bfd *));
    135 static boolean translate_from_native_sym_flags
     132static bfd_boolean aout_get_external_symbols
     133  PARAMS ((bfd *));
     134static bfd_boolean translate_from_native_sym_flags
    136135  PARAMS ((bfd *, aout_symbol_type *));
    137 static boolean translate_to_native_sym_flags
     136static bfd_boolean translate_to_native_sym_flags
    138137  PARAMS ((bfd *, asymbol *, struct external_nlist *));
    139 static void adjust_o_magic PARAMS ((bfd *, struct internal_exec *));
    140 static void adjust_z_magic PARAMS ((bfd *, struct internal_exec *));
    141 static void adjust_n_magic PARAMS ((bfd *, struct internal_exec *));
     138static void adjust_o_magic
     139  PARAMS ((bfd *, struct internal_exec *));
     140static void adjust_z_magic
     141  PARAMS ((bfd *, struct internal_exec *));
     142static void adjust_n_magic
     143  PARAMS ((bfd *, struct internal_exec *));
     144reloc_howto_type * NAME(aout,reloc_type_lookup)
     145  PARAMS ((bfd *, bfd_reloc_code_real_type));
    142146
    143147/*
     
    152156        address, a symbol index, and a type field. The extended records
    153157        (used on 29ks and sparcs) also have a full integer for an
    154         addend.
    155 
    156 */
     158        addend.  */
     159
    157160#ifndef CTOR_TABLE_RELOC_HOWTO
    158161#define CTOR_TABLE_RELOC_IDX 2
    159 #define CTOR_TABLE_RELOC_HOWTO(BFD) ((obj_reloc_entry_size(BFD) == RELOC_EXT_SIZE \
    160              ? howto_table_ext : howto_table_std) \
    161             + CTOR_TABLE_RELOC_IDX)
     162#define CTOR_TABLE_RELOC_HOWTO(BFD)                                     \
     163  ((obj_reloc_entry_size (BFD) == RELOC_EXT_SIZE                        \
     164    ? howto_table_ext : howto_table_std)                                \
     165   + CTOR_TABLE_RELOC_IDX)
    162166#endif
    163167
     
    191195reloc_howto_type howto_table_ext[] =
    192196{
    193   /* type           rs   size bsz  pcrel bitpos ovrf                  sf name          part_inpl readmask setmask pcdone */
    194   HOWTO(RELOC_8,      0,  0,    8,  false, 0, complain_overflow_bitfield,0,"8",        false, 0,0x000000ff, false),
    195   HOWTO(RELOC_16,     0,  1,    16, false, 0, complain_overflow_bitfield,0,"16",       false, 0,0x0000ffff, false),
    196   HOWTO(RELOC_32,     0,  2,    32, false, 0, complain_overflow_bitfield,0,"32",       false, 0,0xffffffff, false),
    197   HOWTO(RELOC_DISP8,  0,  0,    8,  true,  0, complain_overflow_signed,0,"DISP8",       false, 0,0x000000ff, false),
    198   HOWTO(RELOC_DISP16, 0,  1,    16, true,  0, complain_overflow_signed,0,"DISP16",      false, 0,0x0000ffff, false),
    199   HOWTO(RELOC_DISP32, 0,  2,    32, true,  0, complain_overflow_signed,0,"DISP32",      false, 0,0xffffffff, false),
    200   HOWTO(RELOC_WDISP30,2,  2,    30, true,  0, complain_overflow_signed,0,"WDISP30",     false, 0,0x3fffffff, false),
    201   HOWTO(RELOC_WDISP22,2,  2,    22, true,  0, complain_overflow_signed,0,"WDISP22",     false, 0,0x003fffff, false),
    202   HOWTO(RELOC_HI22,   10, 2,    22, false, 0, complain_overflow_bitfield,0,"HI22",      false, 0,0x003fffff, false),
    203   HOWTO(RELOC_22,     0,  2,    22, false, 0, complain_overflow_bitfield,0,"22",       false, 0,0x003fffff, false),
    204   HOWTO(RELOC_13,     0,  2,    13, false, 0, complain_overflow_bitfield,0,"13",       false, 0,0x00001fff, false),
    205   HOWTO(RELOC_LO10,   0,  2,    10, false, 0, complain_overflow_dont,0,"LO10",     false, 0,0x000003ff, false),
    206   HOWTO(RELOC_SFA_BASE,0, 2,    32, false, 0, complain_overflow_bitfield,0,"SFA_BASE", false, 0,0xffffffff, false),
    207   HOWTO(RELOC_SFA_OFF13,0,2,    32, false, 0, complain_overflow_bitfield,0,"SFA_OFF13",false, 0,0xffffffff, false),
    208   HOWTO(RELOC_BASE10, 0,  2,    10, false, 0, complain_overflow_dont,0,"BASE10",   false, 0,0x000003ff, false),
    209   HOWTO(RELOC_BASE13, 0,  2,    13, false, 0, complain_overflow_signed,0,"BASE13",   false, 0,0x00001fff, false),
    210   HOWTO(RELOC_BASE22, 10, 2,    22, false, 0, complain_overflow_bitfield,0,"BASE22",   false, 0,0x003fffff, false),
    211   HOWTO(RELOC_PC10,   0,  2,    10, true,  0, complain_overflow_dont,0,"PC10",  false, 0,0x000003ff, true),
    212   HOWTO(RELOC_PC22,   10,  2,   22, true,  0, complain_overflow_signed,0,"PC22", false, 0,0x003fffff, true),
    213   HOWTO(RELOC_JMP_TBL,2,  2,    30, true,  0, complain_overflow_signed,0,"JMP_TBL",     false, 0,0x3fffffff, false),
    214   HOWTO(RELOC_SEGOFF16,0, 2,    0,  false, 0, complain_overflow_bitfield,0,"SEGOFF16",  false, 0,0x00000000, false),
    215   HOWTO(RELOC_GLOB_DAT,0, 2,    0,  false, 0, complain_overflow_bitfield,0,"GLOB_DAT",  false, 0,0x00000000, false),
    216   HOWTO(RELOC_JMP_SLOT,0, 2,    0,  false, 0, complain_overflow_bitfield,0,"JMP_SLOT",  false, 0,0x00000000, false),
    217   HOWTO(RELOC_RELATIVE,0, 2,    0,  false, 0, complain_overflow_bitfield,0,"RELATIVE",  false, 0,0x00000000, false),
    218   HOWTO(0,  0, 0,    0,  false, 0, complain_overflow_dont, 0, "R_SPARC_NONE",    false,0,0x00000000,true),
    219   HOWTO(0,  0, 0,    0,  false, 0, complain_overflow_dont, 0, "R_SPARC_NONE",    false,0,0x00000000,true),
     197  /* type           rs   size bsz  pcrel bitpos ovrf                  sf name          part_inpl readmask setmask pcdone. */
     198  HOWTO(RELOC_8,      0,  0,    8,  FALSE, 0, complain_overflow_bitfield,0,"8",        FALSE, 0,0x000000ff, FALSE),
     199  HOWTO(RELOC_16,     0,  1,    16, FALSE, 0, complain_overflow_bitfield,0,"16",       FALSE, 0,0x0000ffff, FALSE),
     200  HOWTO(RELOC_32,     0,  2,    32, FALSE, 0, complain_overflow_bitfield,0,"32",       FALSE, 0,0xffffffff, FALSE),
     201  HOWTO(RELOC_DISP8,  0,  0,    8,  TRUE,  0, complain_overflow_signed,0,"DISP8",       FALSE, 0,0x000000ff, FALSE),
     202  HOWTO(RELOC_DISP16, 0,  1,    16, TRUE,  0, complain_overflow_signed,0,"DISP16",      FALSE, 0,0x0000ffff, FALSE),
     203  HOWTO(RELOC_DISP32, 0,  2,    32, TRUE,  0, complain_overflow_signed,0,"DISP32",      FALSE, 0,0xffffffff, FALSE),
     204  HOWTO(RELOC_WDISP30,2,  2,    30, TRUE,  0, complain_overflow_signed,0,"WDISP30",     FALSE, 0,0x3fffffff, FALSE),
     205  HOWTO(RELOC_WDISP22,2,  2,    22, TRUE,  0, complain_overflow_signed,0,"WDISP22",     FALSE, 0,0x003fffff, FALSE),
     206  HOWTO(RELOC_HI22,   10, 2,    22, FALSE, 0, complain_overflow_bitfield,0,"HI22",      FALSE, 0,0x003fffff, FALSE),
     207  HOWTO(RELOC_22,     0,  2,    22, FALSE, 0, complain_overflow_bitfield,0,"22",       FALSE, 0,0x003fffff, FALSE),
     208  HOWTO(RELOC_13,     0,  2,    13, FALSE, 0, complain_overflow_bitfield,0,"13",       FALSE, 0,0x00001fff, FALSE),
     209  HOWTO(RELOC_LO10,   0,  2,    10, FALSE, 0, complain_overflow_dont,0,"LO10",     FALSE, 0,0x000003ff, FALSE),
     210  HOWTO(RELOC_SFA_BASE,0, 2,    32, FALSE, 0, complain_overflow_bitfield,0,"SFA_BASE", FALSE, 0,0xffffffff, FALSE),
     211  HOWTO(RELOC_SFA_OFF13,0,2,    32, FALSE, 0, complain_overflow_bitfield,0,"SFA_OFF13",FALSE, 0,0xffffffff, FALSE),
     212  HOWTO(RELOC_BASE10, 0,  2,    10, FALSE, 0, complain_overflow_dont,0,"BASE10",   FALSE, 0,0x000003ff, FALSE),
     213  HOWTO(RELOC_BASE13, 0,  2,    13, FALSE, 0, complain_overflow_signed,0,"BASE13",   FALSE, 0,0x00001fff, FALSE),
     214  HOWTO(RELOC_BASE22, 10, 2,    22, FALSE, 0, complain_overflow_bitfield,0,"BASE22",   FALSE, 0,0x003fffff, FALSE),
     215  HOWTO(RELOC_PC10,   0,  2,    10, TRUE,  0, complain_overflow_dont,0,"PC10",  FALSE, 0,0x000003ff, TRUE),
     216  HOWTO(RELOC_PC22,   10,  2,   22, TRUE,  0, complain_overflow_signed,0,"PC22", FALSE, 0,0x003fffff, TRUE),
     217  HOWTO(RELOC_JMP_TBL,2,  2,    30, TRUE,  0, complain_overflow_signed,0,"JMP_TBL",     FALSE, 0,0x3fffffff, FALSE),
     218  HOWTO(RELOC_SEGOFF16,0, 2,    0,  FALSE, 0, complain_overflow_bitfield,0,"SEGOFF16",  FALSE, 0,0x00000000, FALSE),
     219  HOWTO(RELOC_GLOB_DAT,0, 2,    0,  FALSE, 0, complain_overflow_bitfield,0,"GLOB_DAT",  FALSE, 0,0x00000000, FALSE),
     220  HOWTO(RELOC_JMP_SLOT,0, 2,    0,  FALSE, 0, complain_overflow_bitfield,0,"JMP_SLOT",  FALSE, 0,0x00000000, FALSE),
     221  HOWTO(RELOC_RELATIVE,0, 2,    0,  FALSE, 0, complain_overflow_bitfield,0,"RELATIVE",  FALSE, 0,0x00000000, FALSE),
     222  HOWTO(0,  0, 0,    0,  FALSE, 0, complain_overflow_dont, 0, "R_SPARC_NONE",    FALSE,0,0x00000000,TRUE),
     223  HOWTO(0,  0, 0,    0,  FALSE, 0, complain_overflow_dont, 0, "R_SPARC_NONE",    FALSE,0,0x00000000,TRUE),
    220224#define RELOC_SPARC_REV32 RELOC_WDISP19
    221   HOWTO(RELOC_SPARC_REV32,    0,  2,    32, false, 0, complain_overflow_dont,0,"R_SPARC_REV32",       false, 0,0xffffffff, false),
     225  HOWTO(RELOC_SPARC_REV32,    0,  2,    32, FALSE, 0, complain_overflow_dont,0,"R_SPARC_REV32",       FALSE, 0,0xffffffff, FALSE),
    222226};
    223227
    224228/* Convert standard reloc records to "arelent" format (incl byte swap).  */
    225229
    226 reloc_howto_type howto_table_std[] = {
    227   /* type              rs size bsz  pcrel bitpos ovrf                     sf name     part_inpl readmask  setmask    pcdone */
    228 HOWTO( 0,              0,  0,   8,  false, 0, complain_overflow_bitfield,0,"8",         true, 0x000000ff,0x000000ff, false),
    229 HOWTO( 1,              0,  1,   16, false, 0, complain_overflow_bitfield,0,"16",        true, 0x0000ffff,0x0000ffff, false),
    230 HOWTO( 2,              0,  2,   32, false, 0, complain_overflow_bitfield,0,"32",        true, 0xffffffff,0xffffffff, false),
    231 HOWTO( 3,              0,  4,   64, false, 0, complain_overflow_bitfield,0,"64",        true, 0xdeaddead,0xdeaddead, false),
    232 HOWTO( 4,              0,  0,   8,  true,  0, complain_overflow_signed,  0,"DISP8",     true, 0x000000ff,0x000000ff, false),
    233 HOWTO( 5,              0,  1,   16, true,  0, complain_overflow_signed,  0,"DISP16",    true, 0x0000ffff,0x0000ffff, false),
    234 HOWTO( 6,              0,  2,   32, true,  0, complain_overflow_signed,  0,"DISP32",    true, 0xffffffff,0xffffffff, false),
    235 HOWTO( 7,              0,  4,   64, true,  0, complain_overflow_signed,  0,"DISP64",    true, 0xfeedface,0xfeedface, false),
    236 HOWTO( 8,              0,  2,    0, false, 0, complain_overflow_bitfield,0,"GOT_REL",   false,         0,0x00000000, false),
    237 HOWTO( 9,              0,  1,   16, false, 0, complain_overflow_bitfield,0,"BASE16",    false,0xffffffff,0xffffffff, false),
    238 HOWTO(10,              0,  2,   32, false, 0, complain_overflow_bitfield,0,"BASE32",    false,0xffffffff,0xffffffff, false),
     230reloc_howto_type howto_table_std[] =
     231{
     232  /* type              rs size bsz  pcrel bitpos ovrf                     sf name     part_inpl readmask  setmask    pcdone.  */
     233HOWTO ( 0,             0,  0,   8,  FALSE, 0, complain_overflow_bitfield,0,"8",         TRUE, 0x000000ff,0x000000ff, FALSE),
     234HOWTO ( 1,             0,  1,   16, FALSE, 0, complain_overflow_bitfield,0,"16",        TRUE, 0x0000ffff,0x0000ffff, FALSE),
     235HOWTO ( 2,             0,  2,   32, FALSE, 0, complain_overflow_bitfield,0,"32",        TRUE, 0xffffffff,0xffffffff, FALSE),
     236HOWTO ( 3,             0,  4,   64, FALSE, 0, complain_overflow_bitfield,0,"64",        TRUE, 0xdeaddead,0xdeaddead, FALSE),
     237HOWTO ( 4,             0,  0,   8,  TRUE,  0, complain_overflow_signed,  0,"DISP8",     TRUE, 0x000000ff,0x000000ff, FALSE),
     238HOWTO ( 5,             0,  1,   16, TRUE,  0, complain_overflow_signed,  0,"DISP16",    TRUE, 0x0000ffff,0x0000ffff, FALSE),
     239HOWTO ( 6,             0,  2,   32, TRUE,  0, complain_overflow_signed,  0,"DISP32",    TRUE, 0xffffffff,0xffffffff, FALSE),
     240HOWTO ( 7,             0,  4,   64, TRUE,  0, complain_overflow_signed,  0,"DISP64",    TRUE, 0xfeedface,0xfeedface, FALSE),
     241HOWTO ( 8,             0,  2,    0, FALSE, 0, complain_overflow_bitfield,0,"GOT_REL",   FALSE,         0,0x00000000, FALSE),
     242HOWTO ( 9,             0,  1,   16, FALSE, 0, complain_overflow_bitfield,0,"BASE16",    FALSE,0xffffffff,0xffffffff, FALSE),
     243HOWTO (10,             0,  2,   32, FALSE, 0, complain_overflow_bitfield,0,"BASE32",    FALSE,0xffffffff,0xffffffff, FALSE),
    239244EMPTY_HOWTO (-1),
    240245EMPTY_HOWTO (-1),
     
    242247EMPTY_HOWTO (-1),
    243248EMPTY_HOWTO (-1),
    244   HOWTO(16,            0,  2,    0, false, 0, complain_overflow_bitfield,0,"JMP_TABLE", false,         0,0x00000000, false),
     249  HOWTO (16,           0,  2,    0, FALSE, 0, complain_overflow_bitfield,0,"JMP_TABLE", FALSE,         0,0x00000000, FALSE),
    245250EMPTY_HOWTO (-1),
    246251EMPTY_HOWTO (-1),
     
    258263EMPTY_HOWTO (-1),
    259264EMPTY_HOWTO (-1),
    260   HOWTO(32,            0,  2,    0, false, 0, complain_overflow_bitfield,0,"RELATIVE",  false,         0,0x00000000, false),
     265  HOWTO (32,           0,  2,    0, FALSE, 0, complain_overflow_bitfield,0,"RELATIVE",  FALSE,         0,0x00000000, FALSE),
    261266EMPTY_HOWTO (-1),
    262267EMPTY_HOWTO (-1),
     
    266271EMPTY_HOWTO (-1),
    267272EMPTY_HOWTO (-1),
    268   HOWTO(40,            0,  2,    0, false, 0, complain_overflow_bitfield,0,"BASEREL",   false,         0,0x00000000, false),
     273  HOWTO (40,           0,  2,    0, FALSE, 0, complain_overflow_bitfield,0,"BASEREL",   FALSE,         0,0x00000000, FALSE),
    269274};
    270275
    271 #define TABLE_SIZE(TABLE)       (sizeof (TABLE)/sizeof (TABLE[0]))
     276#define TABLE_SIZE(TABLE)       (sizeof (TABLE) / sizeof (TABLE[0]))
    272277
    273278#ifndef IS_STAB
     
    280285     bfd_reloc_code_real_type code;
    281286{
    282 #define EXT(i,j)        case i: return &howto_table_ext[j]
    283 #define STD(i,j)        case i: return &howto_table_std[j]
     287#define EXT(i, j)       case i: return &howto_table_ext[j]
     288#define STD(i, j)       case i: return &howto_table_std[j]
    284289  int ext = obj_reloc_entry_size (abfd) == RELOC_EXT_SIZE;
     290
    285291  if (code == BFD_RELOC_CTOR)
    286292    switch (bfd_get_arch_info (abfd)->bits_per_address)
     
    293299        break;
    294300      }
     301
    295302  if (ext)
    296303    switch (code)
     
    315322      }
    316323  else
    317     /* std relocs */
     324    /* std relocs. */
    318325    switch (code)
    319326      {
     327        STD (BFD_RELOC_8, 0);
    320328        STD (BFD_RELOC_16, 1);
    321329        STD (BFD_RELOC_32, 2);
     
    371379  memset ((PTR) execp, 0, sizeof (struct internal_exec));
    372380  /* Now fill in fields in the execp, from the bytes in the raw data.  */
    373   execp->a_info   = bfd_h_get_32 (abfd, bytes->e_info);
     381  execp->a_info   = H_GET_32 (abfd, bytes->e_info);
    374382  execp->a_text   = GET_WORD (abfd, bytes->e_text);
    375383  execp->a_data   = GET_WORD (abfd, bytes->e_data);
     
    406414
    407415  /* Now fill in fields in the raw data, from the fields in the exec struct.  */
    408   bfd_h_put_32 (abfd, execp->a_info  , bytes->e_info);
     416  H_PUT_32 (abfd, execp->a_info  , bytes->e_info);
    409417  PUT_WORD (abfd, execp->a_text  , bytes->e_text);
    410418  PUT_WORD (abfd, execp->a_data  , bytes->e_data);
     
    418426/* Make all the section for an a.out file.  */
    419427
    420 boolean
     428bfd_boolean
    421429NAME(aout,make_sections) (abfd)
    422430     bfd *abfd;
     
    424432  if (obj_textsec (abfd) == (asection *) NULL
    425433      && bfd_make_section (abfd, ".text") == (asection *) NULL)
    426     return false;
     434    return FALSE;
    427435  if (obj_datasec (abfd) == (asection *) NULL
    428436      && bfd_make_section (abfd, ".data") == (asection *) NULL)
    429     return false;
     437    return FALSE;
    430438  if (obj_bsssec (abfd) == (asection *) NULL
    431439      && bfd_make_section (abfd, ".bss") == (asection *) NULL)
    432     return false;
    433   return true;
     440    return FALSE;
     441  return TRUE;
    434442}
    435443
     
    459467  struct aout_data_struct *rawptr, *oldrawptr;
    460468  const bfd_target *result;
    461 
    462   rawptr = (struct aout_data_struct  *) bfd_zalloc (abfd, sizeof (struct aout_data_struct ));
     469  bfd_size_type amt = sizeof (struct aout_data_struct);
     470
     471  rawptr = (struct aout_data_struct  *) bfd_zalloc (abfd, amt);
    463472  if (rawptr == NULL)
    464473    return 0;
     
    475484
    476485  abfd->tdata.aout_data->a.hdr = &rawptr->e;
    477   *(abfd->tdata.aout_data->a.hdr) = *execp;     /* Copy in the internal_exec struct */
     486  /* Copy in the internal_exec struct.  */
     487  *(abfd->tdata.aout_data->a.hdr) = *execp;
    478488  execp = abfd->tdata.aout_data->a.hdr;
    479489
    480   /* Set the file flags */
     490  /* Set the file flags. */
    481491  abfd->flags = BFD_NO_FLAGS;
    482492  if (execp->a_drsize || execp->a_trsize)
    483493    abfd->flags |= HAS_RELOC;
    484   /* Setting of EXEC_P has been deferred to the bottom of this function */
     494  /* Setting of EXEC_P has been deferred to the bottom of this function. */
    485495  if (execp->a_syms)
    486496    abfd->flags |= HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS;
    487   if (N_DYNAMIC(*execp))
     497  if (N_DYNAMIC (*execp))
    488498    abfd->flags |= DYNAMIC;
    489499
     
    534544
    535545  if (! NAME(aout,make_sections) (abfd))
    536     return NULL;
     546    goto error_ret;
    537547
    538548  obj_datasec (abfd)->_raw_size = execp->a_data;
     
    562572  struct exec *execp = exec_hdr (abfd);
    563573
    564   obj_textsec (abfd)->size = N_TXTSIZE(*execp);
    565   obj_textsec (abfd)->raw_size = N_TXTSIZE(*execp);
    566   /* data and bss are already filled in since they're so standard */
    567 
    568   /* The virtual memory addresses of the sections */
    569   obj_textsec (abfd)->vma = N_TXTADDR(*execp);
    570   obj_datasec (abfd)->vma = N_DATADDR(*execp);
    571   obj_bsssec  (abfd)->vma = N_BSSADDR(*execp);
    572 
    573   /* The file offsets of the sections */
    574   obj_textsec (abfd)->filepos = N_TXTOFF(*execp);
    575   obj_datasec (abfd)->filepos = N_DATOFF(*execp);
    576 
    577   /* The file offsets of the relocation info */
    578   obj_textsec (abfd)->rel_filepos = N_TRELOFF(*execp);
    579   obj_datasec (abfd)->rel_filepos = N_DRELOFF(*execp);
     574  obj_textsec (abfd)->size = N_TXTSIZE (*execp);
     575  obj_textsec (abfd)->raw_size = N_TXTSIZE (*execp);
     576  /* Data and bss are already filled in since they're so standard. */
     577
     578  /* The virtual memory addresses of the sections. */
     579  obj_textsec (abfd)->vma = N_TXTADDR (*execp);
     580  obj_datasec (abfd)->vma = N_DATADDR (*execp);
     581  obj_bsssec  (abfd)->vma = N_BSSADDR (*execp);
     582
     583  /* The file offsets of the sections. */
     584  obj_textsec (abfd)->filepos = N_TXTOFF (*execp);
     585  obj_datasec (abfd)->filepos = N_DATOFF (*execp);
     586
     587  /* The file offsets of the relocation info. */
     588  obj_textsec (abfd)->rel_filepos = N_TRELOFF (*execp);
     589  obj_datasec (abfd)->rel_filepos = N_DRELOFF (*execp);
    580590
    581591  /* The file offsets of the string table and symbol table.  */
     
    584594
    585595  /* Determine the architecture and machine type of the object file.  */
    586   switch (N_MACHTYPE (*exec_hdr (abfd))) {
    587   default:
    588     abfd->obj_arch = bfd_arch_obscure;
    589     break;
    590   }
    591 
    592   adata(abfd)->page_size = TARGET_PAGE_SIZE;
    593   adata(abfd)->segment_size = SEGMENT_SIZE;
    594   adata(abfd)->exec_bytes_size = EXEC_BYTES_SIZE;
     596  switch (N_MACHTYPE (*exec_hdr (abfd)))
     597    {
     598    default:
     599      abfd->obj_arch = bfd_arch_obscure;
     600      break;
     601    }
     602
     603  adata (abfd)->page_size = TARGET_PAGE_SIZE;
     604  adata (abfd)->segment_size = SEGMENT_SIZE;
     605  adata (abfd)->exec_bytes_size = EXEC_BYTES_SIZE;
    595606
    596607  return abfd->xvec;
     
    624635
    625636  if (execp->a_entry != 0
    626       || (execp->a_entry >= obj_textsec(abfd)->vma
    627           && execp->a_entry < obj_textsec(abfd)->vma + obj_textsec(abfd)->_raw_size))
     637      || (execp->a_entry >= obj_textsec (abfd)->vma
     638          && execp->a_entry < (obj_textsec (abfd)->vma
     639                               + obj_textsec (abfd)->_raw_size)))
    628640    abfd->flags |= EXEC_P;
    629641#ifdef STAT_FOR_EXEC
     
    641653      if (abfd->iostream != NULL
    642654          && (abfd->flags & BFD_IN_MEMORY) == 0
    643           && (fstat(fileno((FILE *) (abfd->iostream)), &stat_buf) == 0)
     655          && (fstat (fileno ((FILE *) (abfd->iostream)), &stat_buf) == 0)
    644656          && ((stat_buf.st_mode & 0111) != 0))
    645657        abfd->flags |= EXEC_P;
     
    654666      obj_datasec (abfd)->next = obj_bsssec (abfd);
    655667#endif
    656     }
    657   else
    658     {
    659       free (rawptr);
    660       abfd->tdata.aout_data = oldrawptr;
    661     }
    662   return result;
     668      return result;
     669    }
     670
     671 error_ret:
     672  bfd_release (abfd, rawptr);
     673  abfd->tdata.aout_data = oldrawptr;
     674  return NULL;
    663675}
    664676
     
    668680
    669681SYNOPSIS
    670         boolean aout_@var{size}_mkobject, (bfd *abfd);
     682        bfd_boolean aout_@var{size}_mkobject, (bfd *abfd);
    671683
    672684DESCRIPTION
     
    674686*/
    675687
    676 boolean
     688bfd_boolean
    677689NAME(aout,mkobject) (abfd)
    678690     bfd *abfd;
    679691{
    680   struct aout_data_struct  *rawptr;
     692  struct aout_data_struct *rawptr;
     693  bfd_size_type amt = sizeof (struct aout_data_struct);
    681694
    682695  bfd_set_error (bfd_error_system_call);
    683696
    684   /* Use an intermediate variable for clarity */
    685   rawptr = (struct aout_data_struct *)bfd_zalloc (abfd, sizeof (struct aout_data_struct ));
    686 
     697  rawptr = (struct aout_data_struct *) bfd_zalloc (abfd, amt);
    687698  if (rawptr == NULL)
    688     return false;
     699    return FALSE;
    689700
    690701  abfd->tdata.aout_data = rawptr;
    691702  exec_hdr (abfd) = &(rawptr->e);
    692703
    693   obj_textsec (abfd) = (asection *)NULL;
    694   obj_datasec (abfd) = (asection *)NULL;
    695   obj_bsssec (abfd) = (asection *)NULL;
    696 
    697   return true;
     704  obj_textsec (abfd) = (asection *) NULL;
     705  obj_datasec (abfd) = (asection *) NULL;
     706  obj_bsssec (abfd) = (asection *) NULL;
     707
     708  return TRUE;
    698709}
    699710
     
    721732     enum bfd_architecture arch;
    722733     unsigned long machine;
    723      boolean *unknown;
     734     bfd_boolean *unknown;
    724735{
    725736  enum machine_type arch_flags;
    726737
    727738  arch_flags = M_UNKNOWN;
    728   *unknown = true;
    729 
    730   switch (arch) {
    731   case bfd_arch_sparc:
    732     if (machine == 0
    733         || machine == bfd_mach_sparc
    734         || machine == bfd_mach_sparc_sparclite
    735         || machine == bfd_mach_sparc_sparclite_le
    736         || machine == bfd_mach_sparc_v9)
    737       arch_flags = M_SPARC;
    738     else if (machine == bfd_mach_sparc_sparclet)
    739       arch_flags = M_SPARCLET;
    740     break;
    741 
    742   case bfd_arch_m68k:
    743     switch (machine) {
    744     case 0:               arch_flags = M_68010; break;
    745     case bfd_mach_m68000: arch_flags = M_UNKNOWN; *unknown = false; break;
    746     case bfd_mach_m68010: arch_flags = M_68010; break;
    747     case bfd_mach_m68020: arch_flags = M_68020; break;
    748     default:              arch_flags = M_UNKNOWN; break;
    749     }
    750     break;
    751 
    752   case bfd_arch_i386:
    753     if (machine == 0)   arch_flags = M_386;
    754     break;
    755 
    756   case bfd_arch_a29k:
    757     if (machine == 0)   arch_flags = M_29K;
    758     break;
    759 
    760   case bfd_arch_arm:
    761     if (machine == 0)   arch_flags = M_ARM;
    762     break;
    763 
    764   case bfd_arch_mips:
    765     switch (machine) {
    766     case 0:
    767     case bfd_mach_mips3000:
    768     case bfd_mach_mips3900:
    769       arch_flags = M_MIPS1;
     739  *unknown = TRUE;
     740
     741  switch (arch)
     742    {
     743    case bfd_arch_sparc:
     744      if (machine == 0
     745          || machine == bfd_mach_sparc
     746          || machine == bfd_mach_sparc_sparclite
     747          || machine == bfd_mach_sparc_sparclite_le
     748          || machine == bfd_mach_sparc_v9)
     749        arch_flags = M_SPARC;
     750      else if (machine == bfd_mach_sparc_sparclet)
     751        arch_flags = M_SPARCLET;
    770752      break;
    771     case bfd_mach_mips6000:
    772       arch_flags = M_MIPS2;
     753
     754    case bfd_arch_m68k:
     755      switch (machine)
     756        {
     757        case 0:               arch_flags = M_68010; break;
     758        case bfd_mach_m68000: arch_flags = M_UNKNOWN; *unknown = FALSE; break;
     759        case bfd_mach_m68010: arch_flags = M_68010; break;
     760        case bfd_mach_m68020: arch_flags = M_68020; break;
     761        default:              arch_flags = M_UNKNOWN; break;
     762        }
    773763      break;
    774     case bfd_mach_mips4000:
    775     case bfd_mach_mips4010:
    776     case bfd_mach_mips4100:
    777     case bfd_mach_mips4300:
    778     case bfd_mach_mips4400:
    779     case bfd_mach_mips4600:
    780     case bfd_mach_mips4650:
    781     case bfd_mach_mips8000:
    782     case bfd_mach_mips10000:
    783     case bfd_mach_mips12000:
    784     case bfd_mach_mips16:
    785     case bfd_mach_mips32:
    786     case bfd_mach_mips32_4k:
    787     case bfd_mach_mips5:
    788     case bfd_mach_mips64:
    789     case bfd_mach_mips_sb1:
    790       /* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc.  */
    791       arch_flags = M_MIPS2;
     764
     765    case bfd_arch_i386:
     766      if (machine == 0
     767          || machine == bfd_mach_i386_i386
     768          || machine == bfd_mach_i386_i386_intel_syntax)
     769        arch_flags = M_386;
    792770      break;
     771
     772    case bfd_arch_a29k:
     773      if (machine == 0)
     774        arch_flags = M_29K;
     775      break;
     776
     777    case bfd_arch_arm:
     778      if (machine == 0)
     779        arch_flags = M_ARM;
     780      break;
     781
     782    case bfd_arch_mips:
     783      switch (machine)
     784        {
     785        case 0:
     786        case bfd_mach_mips3000:
     787        case bfd_mach_mips3900:
     788          arch_flags = M_MIPS1;
     789          break;
     790        case bfd_mach_mips6000:
     791          arch_flags = M_MIPS2;
     792          break;
     793        case bfd_mach_mips4000:
     794        case bfd_mach_mips4010:
     795        case bfd_mach_mips4100:
     796        case bfd_mach_mips4300:
     797        case bfd_mach_mips4400:
     798        case bfd_mach_mips4600:
     799        case bfd_mach_mips4650:
     800        case bfd_mach_mips8000:
     801        case bfd_mach_mips10000:
     802        case bfd_mach_mips12000:
     803        case bfd_mach_mips16:
     804        case bfd_mach_mipsisa32:
     805        case bfd_mach_mipsisa32r2:
     806        case bfd_mach_mips5:
     807        case bfd_mach_mipsisa64:
     808        case bfd_mach_mips_sb1:
     809          /* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc.  */
     810          arch_flags = M_MIPS2;
     811          break;
     812        default:
     813          arch_flags = M_UNKNOWN;
     814          break;
     815        }
     816      break;
     817
     818    case bfd_arch_ns32k:
     819      switch (machine)
     820        {
     821        case 0:         arch_flags = M_NS32532; break;
     822        case 32032:     arch_flags = M_NS32032; break;
     823        case 32532:     arch_flags = M_NS32532; break;
     824        default:        arch_flags = M_UNKNOWN; break;
     825        }
     826      break;
     827
     828    case bfd_arch_vax:
     829      *unknown = FALSE;
     830      break;
     831
     832    case bfd_arch_cris:
     833      if (machine == 0 || machine == 255)
     834        arch_flags = M_CRIS;
     835      break;
     836
    793837    default:
    794838      arch_flags = M_UNKNOWN;
    795       break;
    796     }
    797     break;
    798 
    799   case bfd_arch_ns32k:
    800     switch (machine) {
    801     case 0:             arch_flags = M_NS32532; break;
    802     case 32032:         arch_flags = M_NS32032; break;
    803     case 32532:         arch_flags = M_NS32532; break;
    804     default:            arch_flags = M_UNKNOWN; break;
    805     }
    806     break;
    807 
    808   case bfd_arch_vax:
    809     *unknown = false;
    810     break;
    811 
    812   case bfd_arch_cris:
    813     if (machine == 0 || machine == 255) arch_flags = M_CRIS;
    814     break;
    815 
    816   default:
    817     arch_flags = M_UNKNOWN;
    818   }
     839    }
    819840
    820841  if (arch_flags != M_UNKNOWN)
    821     *unknown = false;
     842    *unknown = FALSE;
    822843
    823844  return arch_flags;
     
    829850
    830851SYNOPSIS
    831         boolean aout_@var{size}_set_arch_mach,
     852        bfd_boolean aout_@var{size}_set_arch_mach,
    832853         (bfd *,
    833854          enum bfd_architecture arch,
     
    840861*/
    841862
    842 boolean
     863bfd_boolean
    843864NAME(aout,set_arch_mach) (abfd, arch, machine)
    844865     bfd *abfd;
     
    847868{
    848869  if (! bfd_default_set_arch_mach (abfd, arch, machine))
    849     return false;
     870    return FALSE;
    850871
    851872  if (arch != bfd_arch_unknown)
    852873    {
    853       boolean unknown;
     874      bfd_boolean unknown;
    854875
    855876      NAME(aout,machine_type) (arch, machine, &unknown);
    856877      if (unknown)
    857         return false;
    858     }
    859 
    860   /* Determine the size of a relocation entry */
    861   switch (arch) {
    862   case bfd_arch_sparc:
    863   case bfd_arch_a29k:
    864   case bfd_arch_mips:
    865     obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;
    866     break;
    867   default:
    868     obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
    869     break;
    870   }
    871 
    872   return (*aout_backend_info(abfd)->set_sizes) (abfd);
     878        return FALSE;
     879    }
     880
     881  /* Determine the size of a relocation entry.  */
     882  switch (arch)
     883    {
     884    case bfd_arch_sparc:
     885    case bfd_arch_a29k:
     886    case bfd_arch_mips:
     887      obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;
     888      break;
     889    default:
     890      obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
     891      break;
     892    }
     893
     894  return (*aout_backend_info (abfd)->set_sizes) (abfd);
    873895}
    874896
     
    883905
    884906  /* Text.  */
    885   obj_textsec(abfd)->filepos = pos;
    886   if (!obj_textsec(abfd)->user_set_vma)
    887     obj_textsec(abfd)->vma = vma;
     907  obj_textsec (abfd)->filepos = pos;
     908  if (!obj_textsec (abfd)->user_set_vma)
     909    obj_textsec (abfd)->vma = vma;
    888910  else
    889     vma = obj_textsec(abfd)->vma;
    890 
    891   pos += obj_textsec(abfd)->_raw_size;
    892   vma += obj_textsec(abfd)->_raw_size;
     911    vma = obj_textsec (abfd)->vma;
     912
     913  pos += obj_textsec (abfd)->_raw_size;
     914  vma += obj_textsec (abfd)->_raw_size;
    893915
    894916  /* Data.  */
    895   if (!obj_datasec(abfd)->user_set_vma)
    896     {
    897 #if 0       /* ?? Does alignment in the file image really matter? */
    898       pad = align_power (vma, obj_datasec(abfd)->alignment_power) - vma;
     917  if (!obj_datasec (abfd)->user_set_vma)
     918    {
     919#if 0       /* ?? Does alignment in the file image really matter?  */
     920      pad = align_power (vma, obj_datasec (abfd)->alignment_power) - vma;
    899921#endif
    900       obj_textsec(abfd)->_raw_size += pad;
     922      obj_textsec (abfd)->_raw_size += pad;
    901923      pos += pad;
    902924      vma += pad;
    903       obj_datasec(abfd)->vma = vma;
     925      obj_datasec (abfd)->vma = vma;
    904926    }
    905927  else
    906     vma = obj_datasec(abfd)->vma;
    907   obj_datasec(abfd)->filepos = pos;
    908   pos += obj_datasec(abfd)->_raw_size;
    909   vma += obj_datasec(abfd)->_raw_size;
     928    vma = obj_datasec (abfd)->vma;
     929  obj_datasec (abfd)->filepos = pos;
     930  pos += obj_datasec (abfd)->_raw_size;
     931  vma += obj_datasec (abfd)->_raw_size;
    910932
    911933  /* BSS.  */
    912   if (!obj_bsssec(abfd)->user_set_vma)
     934  if (!obj_bsssec (abfd)->user_set_vma)
    913935    {
    914936#if 0
    915       pad = align_power (vma, obj_bsssec(abfd)->alignment_power) - vma;
     937      pad = align_power (vma, obj_bsssec (abfd)->alignment_power) - vma;
    916938#endif
    917       obj_datasec(abfd)->_raw_size += pad;
     939      obj_datasec (abfd)->_raw_size += pad;
    918940      pos += pad;
    919941      vma += pad;
    920       obj_bsssec(abfd)->vma = vma;
     942      obj_bsssec (abfd)->vma = vma;
    921943    }
    922944  else
    923945    {
    924       /* The VMA of the .bss section is set by the the VMA of the
     946      /* The VMA of the .bss section is set by the VMA of the
    925947         .data section plus the size of the .data section.  We may
    926948         need to add padding bytes to make this true.  */
     
    932954        }
    933955    }
    934   obj_bsssec(abfd)->filepos = pos;
     956  obj_bsssec (abfd)->filepos = pos;
    935957
    936958  /* Fix up the exec header.  */
    937   execp->a_text = obj_textsec(abfd)->_raw_size;
    938   execp->a_data = obj_datasec(abfd)->_raw_size;
    939   execp->a_bss = obj_bsssec(abfd)->_raw_size;
     959  execp->a_text = obj_textsec (abfd)->_raw_size;
     960  execp->a_data = obj_datasec (abfd)->_raw_size;
     961  execp->a_bss = obj_bsssec (abfd)->_raw_size;
    940962  N_SET_MAGIC (*execp, OMAGIC);
    941963}
     
    948970  bfd_size_type data_pad, text_pad;
    949971  file_ptr text_end;
    950   CONST struct aout_backend_data *abdp;
     972  const struct aout_backend_data *abdp;
    951973  int ztih;                     /* Nonzero if text includes exec header.  */
    952974
     
    957979          && (abdp->text_includes_header
    958980              || obj_aout_subformat (abfd) == q_magic_format));
    959   obj_textsec(abfd)->filepos = (ztih
    960                                 ? adata(abfd).exec_bytes_size
    961                                 : adata(abfd).zmagic_disk_block_size);
    962   if (! obj_textsec(abfd)->user_set_vma)
     981  obj_textsec (abfd)->filepos = (ztih
     982                                 ? adata (abfd).exec_bytes_size
     983                                 : adata (abfd).zmagic_disk_block_size);
     984  if (! obj_textsec (abfd)->user_set_vma)
    963985    {
    964986      /* ?? Do we really need to check for relocs here?  */
    965       obj_textsec(abfd)->vma = ((abfd->flags & HAS_RELOC)
    966                                 ? 0
    967                                 : (ztih
    968                                    ? (abdp->default_text_vma
    969                                       + adata(abfd).exec_bytes_size)
    970                                    : abdp->default_text_vma));
     987      obj_textsec (abfd)->vma = ((abfd->flags & HAS_RELOC)
     988                                 ? 0
     989                                 : (ztih
     990                                    ? (abdp->default_text_vma
     991                                       + adata (abfd).exec_bytes_size)
     992                                    : abdp->default_text_vma));
    971993      text_pad = 0;
    972994    }
     
    9991021      text_end += obj_textsec (abfd)->filepos;
    10001022    }
    1001   obj_textsec(abfd)->_raw_size += text_pad;
     1023  obj_textsec (abfd)->_raw_size += text_pad;
    10021024  text_end += text_pad;
    10031025
    10041026  /* Data.  */
    1005   if (!obj_datasec(abfd)->user_set_vma)
     1027  if (!obj_datasec (abfd)->user_set_vma)
    10061028    {
    10071029      bfd_vma vma;
    1008       vma = obj_textsec(abfd)->vma + obj_textsec(abfd)->_raw_size;
    1009       obj_datasec(abfd)->vma = BFD_ALIGN (vma, adata(abfd).segment_size);
     1030      vma = obj_textsec (abfd)->vma + obj_textsec (abfd)->_raw_size;
     1031      obj_datasec (abfd)->vma = BFD_ALIGN (vma, adata (abfd).segment_size);
    10101032    }
    10111033  if (abdp && abdp->zmagic_mapped_contiguous)
    10121034    {
    1013       text_pad = (obj_datasec(abfd)->vma
    1014                   - obj_textsec(abfd)->vma
    1015                   - obj_textsec(abfd)->_raw_size);
    1016       obj_textsec(abfd)->_raw_size += text_pad;
    1017     }
    1018   obj_datasec(abfd)->filepos = (obj_textsec(abfd)->filepos
    1019                                 + obj_textsec(abfd)->_raw_size);
     1035      asection * text = obj_textsec (abfd);
     1036      asection * data = obj_datasec (abfd);
     1037
     1038      text_pad = data->vma - (text->vma + text->_raw_size);
     1039      /* Only pad the text section if the data
     1040         section is going to be placed after it.  */
     1041      if (text_pad > 0)
     1042        text->_raw_size += text_pad;
     1043    }
     1044  obj_datasec (abfd)->filepos = (obj_textsec (abfd)->filepos
     1045                                 + obj_textsec (abfd)->_raw_size);
    10201046
    10211047  /* Fix up exec header while we're at it.  */
    1022   execp->a_text = obj_textsec(abfd)->_raw_size;
     1048  execp->a_text = obj_textsec (abfd)->_raw_size;
    10231049  if (ztih && (!abdp || (abdp && !abdp->exec_header_not_counted)))
    1024     execp->a_text += adata(abfd).exec_bytes_size;
     1050    execp->a_text += adata (abfd).exec_bytes_size;
    10251051  if (obj_aout_subformat (abfd) == q_magic_format)
    10261052    N_SET_MAGIC (*execp, QMAGIC);
     
    10291055
    10301056  /* Spec says data section should be rounded up to page boundary.  */
    1031   obj_datasec(abfd)->_raw_size
    1032     = align_power (obj_datasec(abfd)->_raw_size,
    1033                    obj_bsssec(abfd)->alignment_power);
    1034   execp->a_data = BFD_ALIGN (obj_datasec(abfd)->_raw_size,
    1035                              adata(abfd).page_size);
    1036   data_pad = execp->a_data - obj_datasec(abfd)->_raw_size;
     1057  obj_datasec (abfd)->_raw_size
     1058    = align_power (obj_datasec (abfd)->_raw_size,
     1059                   obj_bsssec (abfd)->alignment_power);
     1060  execp->a_data = BFD_ALIGN (obj_datasec (abfd)->_raw_size,
     1061                             adata (abfd).page_size);
     1062  data_pad = execp->a_data - obj_datasec (abfd)->_raw_size;
    10371063
    10381064  /* BSS.  */
    1039   if (!obj_bsssec(abfd)->user_set_vma)
    1040     obj_bsssec(abfd)->vma = (obj_datasec(abfd)->vma
    1041                              + obj_datasec(abfd)->_raw_size);
     1065  if (!obj_bsssec (abfd)->user_set_vma)
     1066    obj_bsssec (abfd)->vma = (obj_datasec (abfd)->vma
     1067                              + obj_datasec (abfd)->_raw_size);
    10421068  /* If the BSS immediately follows the data section and extra space
    10431069     in the page is left after the data section, fudge data
     
    10471073     could have explicitly set the BSS vma to immediately follow
    10481074     the data section.)  */
    1049   if (align_power (obj_bsssec(abfd)->vma, obj_bsssec(abfd)->alignment_power)
    1050       == obj_datasec(abfd)->vma + obj_datasec(abfd)->_raw_size)
    1051     execp->a_bss = (data_pad > obj_bsssec(abfd)->_raw_size) ? 0 :
    1052       obj_bsssec(abfd)->_raw_size - data_pad;
     1075  if (align_power (obj_bsssec (abfd)->vma, obj_bsssec (abfd)->alignment_power)
     1076      == obj_datasec (abfd)->vma + obj_datasec (abfd)->_raw_size)
     1077    execp->a_bss = (data_pad > obj_bsssec (abfd)->_raw_size
     1078                    ? 0 : obj_bsssec (abfd)->_raw_size - data_pad);
    10531079  else
    1054     execp->a_bss = obj_bsssec(abfd)->_raw_size;
     1080    execp->a_bss = obj_bsssec (abfd)->_raw_size;
    10551081}
    10561082
     
    10601086     struct internal_exec *execp;
    10611087{
    1062   file_ptr pos = adata(abfd).exec_bytes_size;
     1088  file_ptr pos = adata (abfd).exec_bytes_size;
    10631089  bfd_vma vma = 0;
    10641090  int pad;
    10651091
    10661092  /* Text.  */
    1067   obj_textsec(abfd)->filepos = pos;
    1068   if (!obj_textsec(abfd)->user_set_vma)
    1069     obj_textsec(abfd)->vma = vma;
     1093  obj_textsec (abfd)->filepos = pos;
     1094  if (!obj_textsec (abfd)->user_set_vma)
     1095    obj_textsec (abfd)->vma = vma;
    10701096  else
    1071     vma = obj_textsec(abfd)->vma;
    1072   pos += obj_textsec(abfd)->_raw_size;
    1073   vma += obj_textsec(abfd)->_raw_size;
     1097    vma = obj_textsec (abfd)->vma;
     1098  pos += obj_textsec (abfd)->_raw_size;
     1099  vma += obj_textsec (abfd)->_raw_size;
    10741100
    10751101  /* Data.  */
    1076   obj_datasec(abfd)->filepos = pos;
    1077   if (!obj_datasec(abfd)->user_set_vma)
    1078     obj_datasec(abfd)->vma = BFD_ALIGN (vma, adata(abfd).segment_size);
    1079   vma = obj_datasec(abfd)->vma;
     1102  obj_datasec (abfd)->filepos = pos;
     1103  if (!obj_datasec (abfd)->user_set_vma)
     1104    obj_datasec (abfd)->vma = BFD_ALIGN (vma, adata (abfd).segment_size);
     1105  vma = obj_datasec (abfd)->vma;
    10801106
    10811107  /* Since BSS follows data immediately, see if it needs alignment.  */
    1082   vma += obj_datasec(abfd)->_raw_size;
    1083   pad = align_power (vma, obj_bsssec(abfd)->alignment_power) - vma;
    1084   obj_datasec(abfd)->_raw_size += pad;
    1085   pos += obj_datasec(abfd)->_raw_size;
     1108  vma += obj_datasec (abfd)->_raw_size;
     1109  pad = align_power (vma, obj_bsssec (abfd)->alignment_power) - vma;
     1110  obj_datasec (abfd)->_raw_size += pad;
     1111  pos += obj_datasec (abfd)->_raw_size;
    10861112
    10871113  /* BSS.  */
    1088   if (!obj_bsssec(abfd)->user_set_vma)
    1089     obj_bsssec(abfd)->vma = vma;
     1114  if (!obj_bsssec (abfd)->user_set_vma)
     1115    obj_bsssec (abfd)->vma = vma;
    10901116  else
    1091     vma = obj_bsssec(abfd)->vma;
     1117    vma = obj_bsssec (abfd)->vma;
    10921118
    10931119  /* Fix up exec header.  */
    1094   execp->a_text = obj_textsec(abfd)->_raw_size;
    1095   execp->a_data = obj_datasec(abfd)->_raw_size;
    1096   execp->a_bss = obj_bsssec(abfd)->_raw_size;
     1120  execp->a_text = obj_textsec (abfd)->_raw_size;
     1121  execp->a_data = obj_datasec (abfd)->_raw_size;
     1122  execp->a_bss = obj_bsssec (abfd)->_raw_size;
    10971123  N_SET_MAGIC (*execp, NMAGIC);
    10981124}
    10991125
    1100 boolean
     1126bfd_boolean
    11011127NAME(aout,adjust_sizes_and_vmas) (abfd, text_size, text_end)
    11021128     bfd *abfd;
     
    11071133
    11081134  if (! NAME(aout,make_sections) (abfd))
    1109     return false;
    1110 
    1111   if (adata(abfd).magic != undecided_magic)
    1112     return true;
    1113 
    1114   obj_textsec(abfd)->_raw_size =
    1115     align_power(obj_textsec(abfd)->_raw_size,
    1116                 obj_textsec(abfd)->alignment_power);
     1135    return FALSE;
     1136
     1137  if (adata (abfd).magic != undecided_magic)
     1138    return TRUE;
     1139
     1140  obj_textsec (abfd)->_raw_size =
     1141    align_power (obj_textsec (abfd)->_raw_size,
     1142                 obj_textsec (abfd)->alignment_power);
    11171143
    11181144  *text_size = obj_textsec (abfd)->_raw_size;
     
    11351161  if (abfd->flags & D_PAGED)
    11361162    /* Whether or not WP_TEXT is set -- let D_PAGED override.  */
    1137     adata(abfd).magic = z_magic;
     1163    adata (abfd).magic = z_magic;
    11381164  else if (abfd->flags & WP_TEXT)
    1139     adata(abfd).magic = n_magic;
     1165    adata (abfd).magic = n_magic;
    11401166  else
    1141     adata(abfd).magic = o_magic;
     1167    adata (abfd).magic = o_magic;
    11421168
    11431169#ifdef BFD_AOUT_DEBUG /* requires gcc2 */
     
    11451171  fprintf (stderr, "%s text=<%x,%x,%x> data=<%x,%x,%x> bss=<%x,%x,%x>\n",
    11461172           ({ char *str;
    1147               switch (adata(abfd).magic) {
    1148               case n_magic: str = "NMAGIC"; break;
    1149               case o_magic: str = "OMAGIC"; break;
    1150               case z_magic: str = "ZMAGIC"; break;
    1151               default: abort ();
    1152               }
     1173              switch (adata (abfd).magic)
     1174                {
     1175                case n_magic: str = "NMAGIC"; break;
     1176                case o_magic: str = "OMAGIC"; break;
     1177                case z_magic: str = "ZMAGIC"; break;
     1178                default: abort ();
     1179                }
    11531180              str;
    11541181            }),
    1155            obj_textsec(abfd)->vma, obj_textsec(abfd)->_raw_size,
    1156                 obj_textsec(abfd)->alignment_power,
    1157            obj_datasec(abfd)->vma, obj_datasec(abfd)->_raw_size,
    1158                 obj_datasec(abfd)->alignment_power,
    1159            obj_bsssec(abfd)->vma, obj_bsssec(abfd)->_raw_size,
    1160                 obj_bsssec(abfd)->alignment_power);
     1182           obj_textsec (abfd)->vma, obj_textsec (abfd)->_raw_size,
     1183                obj_textsec (abfd)->alignment_power,
     1184           obj_datasec (abfd)->vma, obj_datasec (abfd)->_raw_size,
     1185                obj_datasec (abfd)->alignment_power,
     1186           obj_bsssec (abfd)->vma, obj_bsssec (abfd)->_raw_size,
     1187                obj_bsssec (abfd)->alignment_power);
    11611188#endif
    11621189#endif
    11631190
    1164   switch (adata(abfd).magic)
     1191  switch (adata (abfd).magic)
    11651192    {
    11661193    case o_magic:
     
    11791206#ifdef BFD_AOUT_DEBUG
    11801207  fprintf (stderr, "       text=<%x,%x,%x> data=<%x,%x,%x> bss=<%x,%x>\n",
    1181            obj_textsec(abfd)->vma, obj_textsec(abfd)->_raw_size,
    1182                 obj_textsec(abfd)->filepos,
    1183            obj_datasec(abfd)->vma, obj_datasec(abfd)->_raw_size,
    1184                 obj_datasec(abfd)->filepos,
    1185            obj_bsssec(abfd)->vma, obj_bsssec(abfd)->_raw_size);
     1208           obj_textsec (abfd)->vma, obj_textsec (abfd)->_raw_size,
     1209                obj_textsec (abfd)->filepos,
     1210           obj_datasec (abfd)->vma, obj_datasec (abfd)->_raw_size,
     1211                obj_datasec (abfd)->filepos,
     1212           obj_bsssec (abfd)->vma, obj_bsssec (abfd)->_raw_size);
    11861213#endif
    11871214
    1188   return true;
     1215  return TRUE;
    11891216}
    11901217
     
    11941221
    11951222SYNOPSIS
    1196         boolean aout_@var{size}_new_section_hook,
     1223        bfd_boolean aout_@var{size}_new_section_hook,
    11971224           (bfd *abfd,
    11981225            asection *newsect));
     
    12021229        request.
    12031230*/
    1204 boolean
     1231bfd_boolean
    12051232NAME(aout,new_section_hook) (abfd, newsect)
    12061233     bfd *abfd;
    12071234     asection *newsect;
    12081235{
    1209   /* align to double at least */
    1210   newsect->alignment_power = bfd_get_arch_info(abfd)->section_align_power;
     1236  /* Align to double at least. */
     1237  newsect->alignment_power = bfd_get_arch_info (abfd)->section_align_power;
    12111238
    12121239  if (bfd_get_format (abfd) == bfd_object)
    1213   {
    1214     if (obj_textsec(abfd) == NULL && !strcmp(newsect->name, ".text")) {
    1215         obj_textsec(abfd)= newsect;
    1216         newsect->target_index = N_TEXT;
    1217         return true;
    1218       }
    1219 
    1220     if (obj_datasec(abfd) == NULL && !strcmp(newsect->name, ".data")) {
    1221         obj_datasec(abfd) = newsect;
    1222         newsect->target_index = N_DATA;
    1223         return true;
    1224       }
    1225 
    1226     if (obj_bsssec(abfd) == NULL && !strcmp(newsect->name, ".bss")) {
    1227         obj_bsssec(abfd) = newsect;
    1228         newsect->target_index = N_BSS;
    1229         return true;
    1230       }
    1231 
    1232   }
    1233 
    1234   /* We allow more than three sections internally */
    1235   return true;
    1236 }
    1237 
    1238 boolean
     1240    {
     1241      if (obj_textsec (abfd) == NULL && !strcmp (newsect->name, ".text"))
     1242        {
     1243          obj_textsec (abfd)= newsect;
     1244          newsect->target_index = N_TEXT;
     1245          return TRUE;
     1246        }
     1247
     1248      if (obj_datasec (abfd) == NULL && !strcmp (newsect->name, ".data"))
     1249        {
     1250          obj_datasec (abfd) = newsect;
     1251          newsect->target_index = N_DATA;
     1252          return TRUE;
     1253        }
     1254
     1255      if (obj_bsssec (abfd) == NULL && !strcmp (newsect->name, ".bss"))
     1256        {
     1257          obj_bsssec (abfd) = newsect;
     1258          newsect->target_index = N_BSS;
     1259          return TRUE;
     1260        }
     1261    }
     1262
     1263  /* We allow more than three sections internally.  */
     1264  return TRUE;
     1265}
     1266
     1267bfd_boolean
    12391268NAME(aout,set_section_contents) (abfd, section, location, offset, count)
    12401269     bfd *abfd;
     
    12501279    {
    12511280      if (! NAME(aout,adjust_sizes_and_vmas) (abfd, &text_size, &text_end))
    1252         return false;
     1281        return FALSE;
    12531282    }
    12541283
     
    12561285    {
    12571286      bfd_set_error (bfd_error_no_contents);
    1258       return false;
     1287      return FALSE;
    12591288    }
    12601289
     
    12621291      && section != obj_datasec (abfd))
    12631292    {
    1264       (*_bfd_error_handler)
    1265         (_("%s: can not represent section `%s' in a.out object file format"),
    1266          bfd_get_filename (abfd), bfd_get_section_name (abfd, section));
    1267       bfd_set_error (bfd_error_nonrepresentable_section);
    1268       return false;
     1293      if (aout_section_merge_with_text_p (abfd, section))
     1294        section->filepos = obj_textsec (abfd)->filepos +
     1295                           (section->vma - obj_textsec (abfd)->vma);
     1296      else
     1297        {
     1298          (*_bfd_error_handler)
     1299           (_("%s: can not represent section `%s' in a.out object file format"),
     1300             bfd_get_filename (abfd), bfd_get_section_name (abfd, section));
     1301          bfd_set_error (bfd_error_nonrepresentable_section);
     1302          return FALSE;
     1303        }
    12691304    }
    12701305
     
    12721307    {
    12731308      if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0
    1274           || bfd_write (location, 1, count, abfd) != count)
    1275         return false;
    1276     }
    1277 
    1278   return true;
     1309          || bfd_bwrite (location, count, abfd) != count)
     1310        return FALSE;
     1311    }
     1312
     1313  return TRUE;
    12791314}
    12801315
     
    12821317/* Read the external symbols from an a.out file.  */
    12831318
    1284 static boolean
     1319static bfd_boolean
    12851320aout_get_external_symbols (abfd)
    12861321     bfd *abfd;
     
    12901325      bfd_size_type count;
    12911326      struct external_nlist *syms;
     1327      bfd_size_type amt;
    12921328
    12931329      count = exec_hdr (abfd)->a_syms / EXTERNAL_NLIST_SIZE;
    12941330
    12951331#ifdef USE_MMAP
    1296       if (bfd_get_file_window (abfd,
    1297                                obj_sym_filepos (abfd), exec_hdr (abfd)->a_syms,
    1298                                &obj_aout_sym_window (abfd), true) == false)
    1299         return false;
     1332      if (! bfd_get_file_window (abfd, obj_sym_filepos (abfd),
     1333                                exec_hdr (abfd)->a_syms,
     1334                                 &obj_aout_sym_window (abfd), TRUE))
     1335        return FALSE;
    13001336      syms = (struct external_nlist *) obj_aout_sym_window (abfd).data;
    13011337#else
     
    13041340         possible to free them.  */
    13051341      syms = ((struct external_nlist *)
    1306               bfd_malloc ((size_t) count * EXTERNAL_NLIST_SIZE));
     1342              bfd_malloc (count * EXTERNAL_NLIST_SIZE));
    13071343      if (syms == (struct external_nlist *) NULL && count != 0)
    1308         return false;
    1309 
     1344        return FALSE;
     1345
     1346      amt = exec_hdr (abfd)->a_syms;
    13101347      if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
    1311           || (bfd_read (syms, 1, exec_hdr (abfd)->a_syms, abfd)
    1312               != exec_hdr (abfd)->a_syms))
     1348          || bfd_bread (syms, amt, abfd) != amt)
    13131349        {
    13141350          free (syms);
    1315           return false;
     1351          return FALSE;
    13161352        }
    13171353#endif
     
    13271363      bfd_size_type stringsize;
    13281364      char *strings;
     1365      bfd_size_type amt = BYTES_IN_WORD;
    13291366
    13301367      /* Get the size of the strings.  */
    13311368      if (bfd_seek (abfd, obj_str_filepos (abfd), SEEK_SET) != 0
    1332           || (bfd_read ((PTR) string_chars, BYTES_IN_WORD, 1, abfd)
    1333               != BYTES_IN_WORD))
    1334         return false;
     1369          || bfd_bread ((PTR) string_chars, amt, abfd) != amt)
     1370        return FALSE;
    13351371      stringsize = GET_WORD (abfd, string_chars);
    13361372
    13371373#ifdef USE_MMAP
    1338       if (bfd_get_file_window (abfd, obj_str_filepos (abfd), stringsize,
    1339                                &obj_aout_string_window (abfd), true) == false)
    1340         return false;
     1374      if (! bfd_get_file_window (abfd, obj_str_filepos (abfd), stringsize,
     1375                                 &obj_aout_string_window (abfd), TRUE))
     1376        return FALSE;
    13411377      strings = (char *) obj_aout_string_window (abfd).data;
    13421378#else
    1343       strings = (char *) bfd_malloc ((size_t) stringsize + 1);
     1379      strings = (char *) bfd_malloc (stringsize + 1);
    13441380      if (strings == NULL)
    1345         return false;
     1381        return FALSE;
    13461382
    13471383      /* Skip space for the string count in the buffer for convenience
    13481384         when using indexes.  */
    1349       if (bfd_read (strings + BYTES_IN_WORD, 1, stringsize - BYTES_IN_WORD,
    1350                     abfd)
    1351           != stringsize - BYTES_IN_WORD)
     1385      amt = stringsize - BYTES_IN_WORD;
     1386      if (bfd_bread (strings + BYTES_IN_WORD, amt, abfd) != amt)
    13521387        {
    13531388          free (strings);
    1354           return false;
     1389          return FALSE;
    13551390        }
    13561391#endif
     
    13651400    }
    13661401
    1367   return true;
     1402  return TRUE;
    13681403}
    13691404
     
    13731408   symbol->flags and symbol->section, and adjusting symbol->value.  */
    13741409
    1375 static boolean
     1410static bfd_boolean
    13761411translate_from_native_sym_flags (abfd, cache_ptr)
    13771412     bfd *abfd;
     
    13861421
    13871422      /* This is a debugging symbol.  */
    1388 
    13891423      cache_ptr->symbol.flags = BSF_DEBUGGING;
    13901424
     
    14111445      cache_ptr->symbol.value -= sec->vma;
    14121446
    1413       return true;
     1447      return TRUE;
    14141448    }
    14151449
     
    14801514        arelent_chain *reloc;
    14811515        asection *into_section;
     1516        bfd_size_type amt;
    14821517
    14831518        /* This is a set symbol.  The name of the symbol is the name
     
    14961531            char *copy;
    14971532
    1498             copy = bfd_alloc (abfd, strlen (cache_ptr->symbol.name) + 1);
     1533            amt = strlen (cache_ptr->symbol.name) + 1;
     1534            copy = bfd_alloc (abfd, amt);
    14991535            if (copy == NULL)
    1500               return false;
     1536              return FALSE;
    15011537
    15021538            strcpy (copy, cache_ptr->symbol.name);
    15031539            section = bfd_make_section (abfd, copy);
    15041540            if (section == NULL)
    1505               return false;
     1541              return FALSE;
    15061542          }
    15071543
    1508         reloc = (arelent_chain *) bfd_alloc (abfd, sizeof (arelent_chain));
     1544        amt = sizeof (arelent_chain);
     1545        reloc = (arelent_chain *) bfd_alloc (abfd, amt);
    15091546        if (reloc == NULL)
    1510           return false;
     1547          return FALSE;
    15111548
    15121549        /* Build a relocation entry for the constructor.  */
     
    15511588        section->_raw_size += BYTES_IN_WORD;
    15521589
    1553         reloc->relent.howto = CTOR_TABLE_RELOC_HOWTO(abfd);
     1590        reloc->relent.howto = CTOR_TABLE_RELOC_HOWTO (abfd);
    15541591
    15551592#endif /* 0 */
     
    16331670    }
    16341671
    1635   return true;
     1672  return TRUE;
    16361673}
    16371674
    16381675/* Set the fields of SYM_POINTER according to CACHE_PTR.  */
    16391676
    1640 static boolean
     1677static bfd_boolean
    16411678translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer)
    16421679     bfd *abfd;
     
    16641701         cache_ptr->name != NULL ? cache_ptr->name : _("*unknown*"));
    16651702      bfd_set_error (bfd_error_nonrepresentable_section);
    1666       return false;
     1703      return FALSE;
    16671704    }
    16681705
     
    16891726  else
    16901727    {
    1691       (*_bfd_error_handler)
    1692         (_("%s: can not represent section `%s' in a.out object file format"),
    1693          bfd_get_filename (abfd), bfd_get_section_name (abfd, sec));
    1694       bfd_set_error (bfd_error_nonrepresentable_section);
    1695       return false;
    1696     }
    1697 
    1698   /* Turn the symbol from section relative to absolute again */
     1728      if (aout_section_merge_with_text_p (abfd, sec))
     1729        sym_pointer->e_type[0] |= N_TEXT;
     1730      else
     1731        {
     1732          (*_bfd_error_handler)
     1733           (_("%s: can not represent section `%s' in a.out object file format"),
     1734             bfd_get_filename (abfd), bfd_get_section_name (abfd, sec));
     1735          bfd_set_error (bfd_error_nonrepresentable_section);
     1736          return FALSE;
     1737        }
     1738    }
     1739
     1740  /* Turn the symbol from section relative to absolute again.  */
    16991741  value += sec->vma + off;
    17001742
     
    17121754    {
    17131755      int type = ((aout_symbol_type *) cache_ptr)->type;
     1756
    17141757      switch (type)
    17151758        {
     
    17381781    }
    17391782
    1740   PUT_WORD(abfd, value, sym_pointer->e_value);
    1741 
    1742   return true;
     1783  PUT_WORD (abfd, value, sym_pointer->e_value);
     1784
     1785  return TRUE;
    17431786}
    17441787
     
    17501793     bfd *abfd;
    17511794{
    1752   aout_symbol_type  *new =
    1753     (aout_symbol_type *)bfd_zalloc (abfd, sizeof (aout_symbol_type));
     1795  bfd_size_type amt = sizeof (aout_symbol_type);
     1796  aout_symbol_type *new = (aout_symbol_type *) bfd_zalloc (abfd, amt);
    17541797  if (!new)
    17551798    return NULL;
     
    17611804/* Translate a set of internal symbols into external symbols.  */
    17621805
    1763 boolean
     1806bfd_boolean
    17641807NAME(aout,translate_symbol_table) (abfd, in, ext, count, str, strsize, dynamic)
    17651808     bfd *abfd;
     
    17691812     char *str;
    17701813     bfd_size_type strsize;
    1771      boolean dynamic;
     1814     bfd_boolean dynamic;
    17721815{
    17731816  struct external_nlist *ext_end;
     
    17911834        in->symbol.name = str + x;
    17921835      else
    1793         return false;
     1836        return FALSE;
    17941837
    17951838      in->symbol.value = GET_SWORD (abfd,  ext->e_value);
    1796       in->desc = bfd_h_get_16 (abfd, ext->e_desc);
    1797       in->other = bfd_h_get_8 (abfd, ext->e_other);
    1798       in->type = bfd_h_get_8 (abfd,  ext->e_type);
     1839      in->desc = H_GET_16 (abfd, ext->e_desc);
     1840      in->other = H_GET_8 (abfd, ext->e_other);
     1841      in->type = H_GET_8 (abfd,  ext->e_type);
    17991842      in->symbol.udata.p = NULL;
    18001843
    18011844      if (! translate_from_native_sym_flags (abfd, in))
    1802         return false;
     1845        return FALSE;
    18031846
    18041847      if (dynamic)
     
    18061849    }
    18071850
    1808   return true;
     1851  return TRUE;
    18091852}
    18101853
     
    18131856   hold them all plus all the cached symbol entries.  */
    18141857
    1815 boolean
     1858bfd_boolean
    18161859NAME(aout,slurp_symbol_table) (abfd)
    18171860     bfd *abfd;
     
    18191862  struct external_nlist *old_external_syms;
    18201863  aout_symbol_type *cached;
    1821   size_t cached_size;
    1822 
    1823   /* If there's no work to be done, don't do any */
     1864  bfd_size_type cached_size;
     1865
     1866  /* If there's no work to be done, don't do any. */
    18241867  if (obj_aout_symbols (abfd) != (aout_symbol_type *) NULL)
    1825     return true;
     1868    return TRUE;
    18261869
    18271870  old_external_syms = obj_aout_external_syms (abfd);
    18281871
    18291872  if (! aout_get_external_symbols (abfd))
    1830     return false;
    1831 
    1832   cached_size = (obj_aout_external_sym_count (abfd)
    1833                  * sizeof (aout_symbol_type));
    1834   cached = (aout_symbol_type *) bfd_malloc (cached_size);
     1873    return FALSE;
     1874
     1875  cached_size = obj_aout_external_sym_count (abfd);
     1876  cached_size *= sizeof (aout_symbol_type);
     1877  cached = (aout_symbol_type *) bfd_zmalloc (cached_size);
    18351878  if (cached == NULL && cached_size != 0)
    1836     return false;
    1837   if (cached_size != 0)
    1838     memset (cached, 0, cached_size);
     1879    return FALSE;
    18391880
    18401881  /* Convert from external symbol information to internal.  */
     
    18451886          obj_aout_external_strings (abfd),
    18461887          obj_aout_external_string_size (abfd),
    1847           false)))
     1888          FALSE)))
    18481889    {
    18491890      free (cached);
    1850       return false;
     1891      return FALSE;
    18511892    }
    18521893
     
    18701911    }
    18711912
    1872   return true;
     1913  return TRUE;
    18731914}
    18741915
     
    18841925
    18851926static bfd_size_type add_to_stringtab
    1886   PARAMS ((bfd *, struct bfd_strtab_hash *, const char *, boolean));
    1887 static boolean emit_stringtab PARAMS ((bfd *, struct bfd_strtab_hash *));
     1927  PARAMS ((bfd *, struct bfd_strtab_hash *, const char *, bfd_boolean));
     1928static bfd_boolean emit_stringtab
     1929  PARAMS ((bfd *, struct bfd_strtab_hash *));
    18881930
    18891931/* Get the index of a string in a strtab, adding it if it is not
     
    18951937     struct bfd_strtab_hash *tab;
    18961938     const char *str;
    1897      boolean copy;
    1898 {
    1899   boolean hash;
     1939     bfd_boolean copy;
     1940{
     1941  bfd_boolean hash;
    19001942  bfd_size_type index;
    19011943
     
    19061948  /* Don't hash if BFD_TRADITIONAL_FORMAT is set, because SunOS dbx
    19071949     doesn't understand a hashed string table.  */
    1908   hash = true;
     1950  hash = TRUE;
    19091951  if ((abfd->flags & BFD_TRADITIONAL_FORMAT) != 0)
    1910     hash = false;
     1952    hash = FALSE;
    19111953
    19121954  index = _bfd_stringtab_add (tab, str, hash, copy);
     
    19251967   file.  */
    19261968
    1927 static boolean
     1969static bfd_boolean
    19281970emit_stringtab (abfd, tab)
    19291971     register bfd *abfd;
     
    19311973{
    19321974  bfd_byte buffer[BYTES_IN_WORD];
     1975  bfd_size_type amt = BYTES_IN_WORD;
    19331976
    19341977  /* The string table starts with the size.  */
    19351978  PUT_WORD (abfd, _bfd_stringtab_size (tab) + BYTES_IN_WORD, buffer);
    1936   if (bfd_write ((PTR) buffer, 1, BYTES_IN_WORD, abfd) != BYTES_IN_WORD)
    1937     return false;
     1979  if (bfd_bwrite ((PTR) buffer, amt, abfd) != amt)
     1980    return FALSE;
    19381981
    19391982  return _bfd_stringtab_emit (abfd, tab);
     
    19411984
    19421985
    1943 boolean
     1986bfd_boolean
    19441987NAME(aout,write_syms) (abfd)
    19451988     bfd *abfd;
     
    19511994  strtab = _bfd_stringtab_init ();
    19521995  if (strtab == NULL)
    1953     return false;
     1996    return FALSE;
    19541997
    19551998  for (count = 0; count < bfd_get_symcount (abfd); count++)
     
    19582001      bfd_size_type indx;
    19592002      struct external_nlist nsp;
    1960 
    1961       indx = add_to_stringtab (abfd, strtab, g->name, false);
     2003      bfd_size_type amt;
     2004
     2005      indx = add_to_stringtab (abfd, strtab, g->name, FALSE);
    19622006      if (indx == (bfd_size_type) -1)
    19632007        goto error_return;
    19642008      PUT_WORD (abfd, indx, (bfd_byte *) nsp.e_strx);
    19652009
    1966       if (bfd_asymbol_flavour(g) == abfd->xvec->flavour)
     2010      if (bfd_asymbol_flavour (g) == abfd->xvec->flavour)
    19672011        {
    1968           bfd_h_put_16(abfd, aout_symbol(g)->desc,  nsp.e_desc);
    1969           bfd_h_put_8(abfd, aout_symbol(g)->other, nsp.e_other);
    1970           bfd_h_put_8(abfd, aout_symbol(g)->type,  nsp.e_type);
     2012          H_PUT_16 (abfd, aout_symbol (g)->desc,  nsp.e_desc);
     2013          H_PUT_8  (abfd, aout_symbol (g)->other, nsp.e_other);
     2014          H_PUT_8  (abfd, aout_symbol (g)->type,  nsp.e_type);
    19712015        }
    19722016      else
    19732017        {
    1974           bfd_h_put_16(abfd,0, nsp.e_desc);
    1975           bfd_h_put_8(abfd, 0, nsp.e_other);
    1976           bfd_h_put_8(abfd, 0, nsp.e_type);
     2018          H_PUT_16 (abfd, 0, nsp.e_desc);
     2019          H_PUT_8  (abfd, 0, nsp.e_other);
     2020          H_PUT_8  (abfd, 0, nsp.e_type);
    19772021        }
    19782022
     
    19802024        goto error_return;
    19812025
    1982       if (bfd_write((PTR)&nsp,1,EXTERNAL_NLIST_SIZE, abfd)
    1983           != EXTERNAL_NLIST_SIZE)
     2026      amt = EXTERNAL_NLIST_SIZE;
     2027      if (bfd_bwrite ((PTR) &nsp, amt, abfd) != amt)
    19842028        goto error_return;
    19852029
     
    19942038  _bfd_stringtab_free (strtab);
    19952039
    1996   return true;
     2040  return TRUE;
    19972041
    19982042error_return:
    19992043  _bfd_stringtab_free (strtab);
    2000   return false;
     2044  return FALSE;
    20012045}
    20022046
     
    20132057      return -1;
    20142058
    2015     for (symbase = obj_aout_symbols(abfd); counter++ < bfd_get_symcount (abfd);)
    2016       *(location++) = (asymbol *) ( symbase++);
     2059    for (symbase = obj_aout_symbols (abfd);
     2060         counter++ < bfd_get_symcount (abfd);
     2061         )
     2062      *(location++) = (asymbol *) (symbase++);
    20172063    *location++ =0;
    20182064    return bfd_get_symcount (abfd);
     
    20202066
    20212067
    2022 /* Standard reloc stuff */
     2068/* Standard reloc stuff. */
    20232069/* Output standard relocation information to a file in target byte order.  */
    20242070
     
    20402086  asection *output_section = sym->section->output_section;
    20412087
    2042   PUT_WORD(abfd, g->address, natptr->r_address);
    2043 
    2044   r_length = g->howto->size ;   /* Size as a power of two */
    2045   r_pcrel  = (int) g->howto->pc_relative; /* Relative to PC? */
     2088  PUT_WORD (abfd, g->address, natptr->r_address);
     2089
     2090  r_length = g->howto->size ;   /* Size as a power of two. */
     2091  r_pcrel  = (int) g->howto->pc_relative; /* Relative to PC?  */
    20462092  /* XXX This relies on relocs coming from a.out files.  */
    20472093  r_baserel = (g->howto->type & 8) != 0;
     
    20542100#endif
    20552101
    2056   /* name was clobbered by aout_write_syms to be symbol index */
     2102  /* Name was clobbered by aout_write_syms to be symbol index. */
    20572103
    20582104  /* If this relocation is relative to a symbol then set the
     
    20612107     Absolute symbols can come in in two ways, either as an offset
    20622108     from the abs section, or as a symbol which has an abs value.
    2063      check for that here
    2064      */
     2109     check for that here.  */
    20652110
    20662111  if (bfd_is_com_section (output_section)
     
    20692114    {
    20702115      if (bfd_abs_section_ptr->symbol == sym)
    2071       {
    2072         /* Whoops, looked like an abs symbol, but is really an offset
    2073            from the abs section */
    2074         r_index = N_ABS;
    2075         r_extern = 0;
    2076        }
     2116        {
     2117          /* Whoops, looked like an abs symbol, but is
     2118             really an offset from the abs section. */
     2119          r_index = N_ABS;
     2120          r_extern = 0;
     2121        }
    20772122      else
    2078       {
    2079         /* Fill in symbol */
    2080         r_extern = 1;
    2081         r_index = (*(g->sym_ptr_ptr))->KEEPIT;
    2082 
    2083       }
     2123        {
     2124          /* Fill in symbol.  */
     2125          r_extern = 1;
     2126          r_index = (*(g->sym_ptr_ptr))->KEEPIT;
     2127        }
    20842128    }
    20852129  else
    20862130    {
    2087       /* Just an ordinary section */
     2131      /* Just an ordinary section. */
    20882132      r_extern = 0;
    20892133      r_index  = output_section->target_index;
    20902134    }
    20912135
    2092   /* now the fun stuff */
    2093   if (bfd_header_big_endian (abfd)) {
     2136  /* Now the fun stuff.  */
     2137  if (bfd_header_big_endian (abfd))
     2138    {
    20942139      natptr->r_index[0] = r_index >> 16;
    20952140      natptr->r_index[1] = r_index >> 8;
    20962141      natptr->r_index[2] = r_index;
    2097       natptr->r_type[0] =
    2098        (r_extern?    RELOC_STD_BITS_EXTERN_BIG: 0)
    2099         | (r_pcrel?     RELOC_STD_BITS_PCREL_BIG: 0)
    2100          | (r_baserel?   RELOC_STD_BITS_BASEREL_BIG: 0)
    2101           | (r_jmptable?  RELOC_STD_BITS_JMPTABLE_BIG: 0)
    2102            | (r_relative?  RELOC_STD_BITS_RELATIVE_BIG: 0)
    2103             | (r_length <<  RELOC_STD_BITS_LENGTH_SH_BIG);
    2104     } else {
    2105         natptr->r_index[2] = r_index >> 16;
    2106         natptr->r_index[1] = r_index >> 8;
    2107         natptr->r_index[0] = r_index;
    2108         natptr->r_type[0] =
    2109          (r_extern?    RELOC_STD_BITS_EXTERN_LITTLE: 0)
    2110           | (r_pcrel?     RELOC_STD_BITS_PCREL_LITTLE: 0)
    2111            | (r_baserel?   RELOC_STD_BITS_BASEREL_LITTLE: 0)
    2112             | (r_jmptable?  RELOC_STD_BITS_JMPTABLE_LITTLE: 0)
    2113              | (r_relative?  RELOC_STD_BITS_RELATIVE_LITTLE: 0)
    2114               | (r_length <<  RELOC_STD_BITS_LENGTH_SH_LITTLE);
    2115       }
    2116 }
    2117 
    2118 /* Extended stuff */
     2142      natptr->r_type[0] = ((r_extern ? RELOC_STD_BITS_EXTERN_BIG : 0)
     2143                           | (r_pcrel ? RELOC_STD_BITS_PCREL_BIG : 0)
     2144                           | (r_baserel ? RELOC_STD_BITS_BASEREL_BIG : 0)
     2145                           | (r_jmptable ? RELOC_STD_BITS_JMPTABLE_BIG : 0)
     2146                           | (r_relative ? RELOC_STD_BITS_RELATIVE_BIG : 0)
     2147                           | (r_length << RELOC_STD_BITS_LENGTH_SH_BIG));
     2148    }
     2149  else
     2150    {
     2151      natptr->r_index[2] = r_index >> 16;
     2152      natptr->r_index[1] = r_index >> 8;
     2153      natptr->r_index[0] = r_index;
     2154      natptr->r_type[0] = ((r_extern ? RELOC_STD_BITS_EXTERN_LITTLE : 0)
     2155                           | (r_pcrel ? RELOC_STD_BITS_PCREL_LITTLE : 0)
     2156                           | (r_baserel ? RELOC_STD_BITS_BASEREL_LITTLE : 0)
     2157                           | (r_jmptable ? RELOC_STD_BITS_JMPTABLE_LITTLE : 0)
     2158                           | (r_relative ? RELOC_STD_BITS_RELATIVE_LITTLE : 0)
     2159                           | (r_length << RELOC_STD_BITS_LENGTH_SH_LITTLE));
     2160    }
     2161}
     2162
     2163/* Extended stuff. */
    21192164/* Output extended relocation information to a file in target byte order.  */
    21202165
     
    21312176  int r_extern;
    21322177  unsigned int r_type;
    2133   unsigned int r_addend;
     2178  bfd_vma r_addend;
    21342179  asymbol *sym = *(g->sym_ptr_ptr);
    21352180  asection *output_section = sym->section->output_section;
     
    21492194     from the abs section, or as a symbol which has an abs value.
    21502195     check for that here.  */
    2151 
    21522196  if (bfd_is_abs_section (bfd_get_section (sym)))
    21532197    {
     
    21662210  else
    21672211    {
    2168       /* Just an ordinary section */
     2212      /* Just an ordinary section. */
    21692213      r_extern = 0;
    21702214      r_index = output_section->target_index;
    21712215    }
    21722216
    2173   /* now the fun stuff */
    2174   if (bfd_header_big_endian (abfd)) {
    2175     natptr->r_index[0] = r_index >> 16;
    2176     natptr->r_index[1] = r_index >> 8;
    2177     natptr->r_index[2] = r_index;
    2178     natptr->r_type[0] =
    2179       ((r_extern? RELOC_EXT_BITS_EXTERN_BIG: 0)
    2180        | (r_type << RELOC_EXT_BITS_TYPE_SH_BIG));
    2181   } else {
    2182     natptr->r_index[2] = r_index >> 16;
    2183     natptr->r_index[1] = r_index >> 8;
    2184     natptr->r_index[0] = r_index;
    2185     natptr->r_type[0] =
    2186      (r_extern? RELOC_EXT_BITS_EXTERN_LITTLE: 0)
    2187       | (r_type << RELOC_EXT_BITS_TYPE_SH_LITTLE);
    2188   }
     2217  /* Now the fun stuff.  */
     2218  if (bfd_header_big_endian (abfd))
     2219    {
     2220      natptr->r_index[0] = r_index >> 16;
     2221      natptr->r_index[1] = r_index >> 8;
     2222      natptr->r_index[2] = r_index;
     2223      natptr->r_type[0] = ((r_extern ? RELOC_EXT_BITS_EXTERN_BIG : 0)
     2224                           | (r_type << RELOC_EXT_BITS_TYPE_SH_BIG));
     2225    }
     2226  else
     2227    {
     2228      natptr->r_index[2] = r_index >> 16;
     2229      natptr->r_index[1] = r_index >> 8;
     2230      natptr->r_index[0] = r_index;
     2231      natptr->r_type[0] = ((r_extern ? RELOC_EXT_BITS_EXTERN_LITTLE : 0)
     2232                           | (r_type << RELOC_EXT_BITS_TYPE_SH_LITTLE));
     2233    }
    21892234
    21902235  PUT_WORD (abfd, r_addend, natptr->r_addend);
     
    21972242   Aout keeps all it's symbols based from zero, so the symbol would
    21982243   contain 60. This macro subs the base of each section from the value
    2199    to give the true offset from the section */
    2200 
    2201 #define MOVE_ADDRESS(ad)                                                \
    2202   if (r_extern) {                                                       \
    2203    /* undefined symbol */                                               \
    2204      cache_ptr->sym_ptr_ptr = symbols + r_index;                        \
    2205      cache_ptr->addend = ad;                                            \
    2206      } else {                                                           \
    2207     /* defined, section relative. replace symbol with pointer to        \
    2208        symbol which points to section  */                               \
    2209     switch (r_index) {                                                  \
    2210     case N_TEXT:                                                        \
    2211     case N_TEXT | N_EXT:                                                \
    2212       cache_ptr->sym_ptr_ptr  = obj_textsec(abfd)->symbol_ptr_ptr;      \
    2213       cache_ptr->addend = ad  - su->textsec->vma;                       \
    2214       break;                                                            \
    2215     case N_DATA:                                                        \
    2216     case N_DATA | N_EXT:                                                \
    2217       cache_ptr->sym_ptr_ptr  = obj_datasec(abfd)->symbol_ptr_ptr;      \
    2218       cache_ptr->addend = ad - su->datasec->vma;                        \
    2219       break;                                                            \
    2220     case N_BSS:                                                         \
    2221     case N_BSS | N_EXT:                                                 \
    2222       cache_ptr->sym_ptr_ptr  = obj_bsssec(abfd)->symbol_ptr_ptr;       \
    2223       cache_ptr->addend = ad - su->bsssec->vma;                         \
    2224       break;                                                            \
    2225     default:                                                            \
    2226     case N_ABS:                                                         \
    2227     case N_ABS | N_EXT:                                                 \
    2228      cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;      \
     2244   to give the true offset from the section.  */
     2245
     2246#define MOVE_ADDRESS(ad)                                                \
     2247  if (r_extern)                                                         \
     2248    {                                                                   \
     2249      /* Undefined symbol.  */                                          \
     2250      cache_ptr->sym_ptr_ptr = symbols + r_index;                       \
    22292251      cache_ptr->addend = ad;                                           \
    2230       break;                                                            \
    22312252    }                                                                   \
    2232   }                                                                     \
     2253   else                                                                 \
     2254    {                                                                   \
     2255      /* Defined, section relative.  Replace symbol with pointer to     \
     2256         symbol which points to section.  */                            \
     2257      switch (r_index)                                                  \
     2258        {                                                               \
     2259        case N_TEXT:                                                    \
     2260        case N_TEXT | N_EXT:                                            \
     2261          cache_ptr->sym_ptr_ptr = obj_textsec (abfd)->symbol_ptr_ptr;  \
     2262          cache_ptr->addend = ad - su->textsec->vma;                    \
     2263          break;                                                        \
     2264        case N_DATA:                                                    \
     2265        case N_DATA | N_EXT:                                            \
     2266          cache_ptr->sym_ptr_ptr = obj_datasec (abfd)->symbol_ptr_ptr;  \
     2267          cache_ptr->addend = ad - su->datasec->vma;                    \
     2268          break;                                                        \
     2269        case N_BSS:                                                     \
     2270        case N_BSS | N_EXT:                                             \
     2271          cache_ptr->sym_ptr_ptr = obj_bsssec (abfd)->symbol_ptr_ptr;   \
     2272          cache_ptr->addend = ad - su->bsssec->vma;                     \
     2273          break;                                                        \
     2274        default:                                                        \
     2275        case N_ABS:                                                     \
     2276        case N_ABS | N_EXT:                                             \
     2277          cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; \
     2278          cache_ptr->addend = ad;                                       \
     2279          break;                                                        \
     2280        }                                                               \
     2281    }
    22332282
    22342283void
     
    22472296  cache_ptr->address = (GET_SWORD (abfd, bytes->r_address));
    22482297
    2249   /* now the fun stuff */
    2250   if (bfd_header_big_endian (abfd)) {
    2251     r_index =  (bytes->r_index[0] << 16)
    2252              | (bytes->r_index[1] << 8)
    2253              |  bytes->r_index[2];
    2254     r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_BIG));
    2255     r_type   =       (bytes->r_type[0] & RELOC_EXT_BITS_TYPE_BIG)
    2256                                       >> RELOC_EXT_BITS_TYPE_SH_BIG;
    2257   } else {
    2258     r_index =  (bytes->r_index[2] << 16)
    2259              | (bytes->r_index[1] << 8)
    2260              |  bytes->r_index[0];
    2261     r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_LITTLE));
    2262     r_type   =       (bytes->r_type[0] & RELOC_EXT_BITS_TYPE_LITTLE)
    2263                                       >> RELOC_EXT_BITS_TYPE_SH_LITTLE;
    2264   }
     2298  /* Now the fun stuff.  */
     2299  if (bfd_header_big_endian (abfd))
     2300    {
     2301      r_index = (((unsigned int) bytes->r_index[0] << 16)
     2302                 | ((unsigned int) bytes->r_index[1] << 8)
     2303                 | bytes->r_index[2]);
     2304      r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_BIG));
     2305      r_type = ((bytes->r_type[0] & RELOC_EXT_BITS_TYPE_BIG)
     2306                >> RELOC_EXT_BITS_TYPE_SH_BIG);
     2307    }
     2308  else
     2309    {
     2310      r_index =  (((unsigned int) bytes->r_index[2] << 16)
     2311                  | ((unsigned int) bytes->r_index[1] << 8)
     2312                  | bytes->r_index[0]);
     2313      r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_LITTLE));
     2314      r_type = ((bytes->r_type[0] & RELOC_EXT_BITS_TYPE_LITTLE)
     2315                >> RELOC_EXT_BITS_TYPE_SH_LITTLE);
     2316    }
    22652317
    22662318  cache_ptr->howto =  howto_table_ext + r_type;
     
    22692321     regardless of the setting of r_extern.  r_extern just reflects
    22702322     whether the symbol the reloc is against is local or global.  */
    2271   if (r_type == RELOC_BASE10
    2272       || r_type == RELOC_BASE13
    2273       || r_type == RELOC_BASE22)
     2323  if (r_type == (unsigned int) RELOC_BASE10
     2324      || r_type == (unsigned int) RELOC_BASE13
     2325      || r_type == (unsigned int) RELOC_BASE22)
    22742326    r_extern = 1;
    22752327
     
    22822334    }
    22832335
    2284   MOVE_ADDRESS(GET_SWORD(abfd, bytes->r_addend));
     2336  MOVE_ADDRESS (GET_SWORD (abfd, bytes->r_addend));
    22852337}
    22862338
     
    23012353  unsigned int howto_idx;
    23022354
    2303   cache_ptr->address = bfd_h_get_32 (abfd, bytes->r_address);
    2304 
    2305   /* now the fun stuff */
    2306   if (bfd_header_big_endian (abfd)) {
    2307     r_index =  (bytes->r_index[0] << 16)
    2308       | (bytes->r_index[1] << 8)
    2309         |  bytes->r_index[2];
    2310     r_extern  = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_BIG));
    2311     r_pcrel   = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_BIG));
    2312     r_baserel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_BASEREL_BIG));
    2313     r_jmptable= (0 != (bytes->r_type[0] & RELOC_STD_BITS_JMPTABLE_BIG));
    2314     r_relative= (0 != (bytes->r_type[0] & RELOC_STD_BITS_RELATIVE_BIG));
    2315     r_length  =       (bytes->r_type[0] & RELOC_STD_BITS_LENGTH_BIG)
    2316                         >> RELOC_STD_BITS_LENGTH_SH_BIG;
    2317   } else {
    2318     r_index =  (bytes->r_index[2] << 16)
    2319       | (bytes->r_index[1] << 8)
    2320         |  bytes->r_index[0];
    2321     r_extern  = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE));
    2322     r_pcrel   = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE));
    2323     r_baserel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_BASEREL_LITTLE));
    2324     r_jmptable= (0 != (bytes->r_type[0] & RELOC_STD_BITS_JMPTABLE_LITTLE));
    2325     r_relative= (0 != (bytes->r_type[0] & RELOC_STD_BITS_RELATIVE_LITTLE));
    2326     r_length  =       (bytes->r_type[0] & RELOC_STD_BITS_LENGTH_LITTLE)
    2327                         >> RELOC_STD_BITS_LENGTH_SH_LITTLE;
    2328   }
    2329 
    2330   howto_idx = r_length + 4 * r_pcrel + 8 * r_baserel
    2331               + 16 * r_jmptable + 32 * r_relative;
     2355  cache_ptr->address = H_GET_32 (abfd, bytes->r_address);
     2356
     2357  /* Now the fun stuff.  */
     2358  if (bfd_header_big_endian (abfd))
     2359    {
     2360      r_index = (((unsigned int) bytes->r_index[0] << 16)
     2361                 | ((unsigned int) bytes->r_index[1] << 8)
     2362                 | bytes->r_index[2]);
     2363      r_extern  = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_BIG));
     2364      r_pcrel   = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_BIG));
     2365      r_baserel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_BASEREL_BIG));
     2366      r_jmptable= (0 != (bytes->r_type[0] & RELOC_STD_BITS_JMPTABLE_BIG));
     2367      r_relative= (0 != (bytes->r_type[0] & RELOC_STD_BITS_RELATIVE_BIG));
     2368      r_length  = ((bytes->r_type[0] & RELOC_STD_BITS_LENGTH_BIG)
     2369                   >> RELOC_STD_BITS_LENGTH_SH_BIG);
     2370    }
     2371  else
     2372    {
     2373      r_index = (((unsigned int) bytes->r_index[2] << 16)
     2374                 | ((unsigned int) bytes->r_index[1] << 8)
     2375                 | bytes->r_index[0]);
     2376      r_extern  = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE));
     2377      r_pcrel   = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE));
     2378      r_baserel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_BASEREL_LITTLE));
     2379      r_jmptable= (0 != (bytes->r_type[0] & RELOC_STD_BITS_JMPTABLE_LITTLE));
     2380      r_relative= (0 != (bytes->r_type[0] & RELOC_STD_BITS_RELATIVE_LITTLE));
     2381      r_length  = ((bytes->r_type[0] & RELOC_STD_BITS_LENGTH_LITTLE)
     2382                   >> RELOC_STD_BITS_LENGTH_SH_LITTLE);
     2383    }
     2384
     2385  howto_idx = (r_length + 4 * r_pcrel + 8 * r_baserel
     2386               + 16 * r_jmptable + 32 * r_relative);
    23322387  BFD_ASSERT (howto_idx < TABLE_SIZE (howto_table_std));
    23332388  cache_ptr->howto =  howto_table_std + howto_idx;
     
    23482403    }
    23492404
    2350   MOVE_ADDRESS(0);
     2405  MOVE_ADDRESS (0);
    23512406}
    23522407
    23532408/* Read and swap the relocs for a section.  */
    23542409
    2355 boolean
     2410bfd_boolean
    23562411NAME(aout,slurp_reloc_table) (abfd, asect, symbols)
    23572412     bfd *abfd;
     
    23592414     asymbol **symbols;
    23602415{
    2361   unsigned int count;
     2416  bfd_size_type count;
    23622417  bfd_size_type reloc_size;
    23632418  PTR relocs;
     
    23662421  unsigned int counter = 0;
    23672422  arelent *cache_ptr;
     2423  bfd_size_type amt;
    23682424
    23692425  if (asect->relocation)
    2370     return true;
     2426    return TRUE;
    23712427
    23722428  if (asect->flags & SEC_CONSTRUCTOR)
    2373     return true;
     2429    return TRUE;
    23742430
    23752431  if (asect == obj_datasec (abfd))
    2376     reloc_size = exec_hdr(abfd)->a_drsize;
     2432    reloc_size = exec_hdr (abfd)->a_drsize;
    23772433  else if (asect == obj_textsec (abfd))
    2378     reloc_size = exec_hdr(abfd)->a_trsize;
     2434    reloc_size = exec_hdr (abfd)->a_trsize;
    23792435  else if (asect == obj_bsssec (abfd))
    23802436    reloc_size = 0;
     
    23822438    {
    23832439      bfd_set_error (bfd_error_invalid_operation);
    2384       return false;
     2440      return FALSE;
    23852441    }
    23862442
    23872443  if (bfd_seek (abfd, asect->rel_filepos, SEEK_SET) != 0)
    2388     return false;
     2444    return FALSE;
    23892445
    23902446  each_size = obj_reloc_entry_size (abfd);
     
    23922448  count = reloc_size / each_size;
    23932449
    2394   reloc_cache = (arelent *) bfd_malloc ((size_t) (count * sizeof (arelent)));
     2450  amt = count * sizeof (arelent);
     2451  reloc_cache = (arelent *) bfd_zmalloc (amt);
    23952452  if (reloc_cache == NULL && count != 0)
    2396     return false;
    2397   memset (reloc_cache, 0, count * sizeof (arelent));
    2398 
    2399   relocs = bfd_malloc ((size_t) reloc_size);
     2453    return FALSE;
     2454
     2455  relocs = bfd_malloc (reloc_size);
    24002456  if (relocs == NULL && reloc_size != 0)
    24012457    {
    24022458      free (reloc_cache);
    2403       return false;
    2404     }
    2405 
    2406   if (bfd_read (relocs, 1, reloc_size, abfd) != reloc_size)
     2459      return FALSE;
     2460    }
     2461
     2462  if (bfd_bread (relocs, reloc_size, abfd) != reloc_size)
    24072463    {
    24082464      free (relocs);
    24092465      free (reloc_cache);
    2410       return false;
     2466      return FALSE;
    24112467    }
    24122468
     
    24142470  if (each_size == RELOC_EXT_SIZE)
    24152471    {
    2416       register struct reloc_ext_external *rptr =
    2417         (struct reloc_ext_external *) relocs;
     2472      struct reloc_ext_external *rptr = (struct reloc_ext_external *) relocs;
    24182473
    24192474      for (; counter < count; counter++, rptr++, cache_ptr++)
    24202475        MY_swap_ext_reloc_in (abfd, rptr, cache_ptr, symbols,
    2421                               bfd_get_symcount (abfd));
     2476                              (bfd_size_type) bfd_get_symcount (abfd));
    24222477    }
    24232478  else
    24242479    {
    2425       register struct reloc_std_external *rptr =
    2426         (struct reloc_std_external *) relocs;
     2480      struct reloc_std_external *rptr = (struct reloc_std_external *) relocs;
    24272481
    24282482      for (; counter < count; counter++, rptr++, cache_ptr++)
    24292483        MY_swap_std_reloc_in (abfd, rptr, cache_ptr, symbols,
    2430                               bfd_get_symcount (abfd));
     2484                              (bfd_size_type) bfd_get_symcount (abfd));
    24312485    }
    24322486
     
    24362490  asect->reloc_count = cache_ptr - reloc_cache;
    24372491
    2438   return true;
     2492  return TRUE;
    24392493}
    24402494
    24412495/* Write out a relocation section into an object file.  */
    24422496
    2443 boolean
     2497bfd_boolean
    24442498NAME(aout,squirt_out_relocs) (abfd, section)
    24452499     bfd *abfd;
     
    24512505
    24522506  unsigned int count = section->reloc_count;
    2453   size_t natsize;
     2507  bfd_size_type natsize;
    24542508
    24552509  if (count == 0 || section->orelocation == NULL)
    2456     return true;
     2510    return TRUE;
    24572511
    24582512  each_size = obj_reloc_entry_size (abfd);
    2459   natsize = each_size * count;
     2513  natsize = (bfd_size_type) each_size * count;
    24602514  native = (unsigned char *) bfd_zalloc (abfd, natsize);
    24612515  if (!native)
    2462     return false;
     2516    return FALSE;
    24632517
    24642518  generic = section->orelocation;
     
    24772531           count != 0;
    24782532           --count, natptr += each_size, ++generic)
    2479         MY_swap_std_reloc_out(abfd, *generic, (struct reloc_std_external *)natptr);
    2480     }
    2481 
    2482   if ( bfd_write ((PTR) native, 1, natsize, abfd) != natsize) {
    2483     bfd_release(abfd, native);
    2484     return false;
    2485   }
     2533        MY_swap_std_reloc_out (abfd, *generic,
     2534                               (struct reloc_std_external *) natptr);
     2535    }
     2536
     2537  if (bfd_bwrite ((PTR) native, natsize, abfd) != natsize)
     2538    {
     2539      bfd_release (abfd, native);
     2540      return FALSE;
     2541    }
    24862542  bfd_release (abfd, native);
    24872543
    2488   return true;
    2489 }
    2490 
    2491 /* This is stupid.  This function should be a boolean predicate */
     2544  return TRUE;
     2545}
     2546
     2547/* This is stupid.  This function should be a boolean predicate.  */
     2548
    24922549long
    24932550NAME(aout,canonicalize_reloc) (abfd, section, relptr, symbols)
     
    25092566    return -1;
    25102567
    2511   if (section->flags & SEC_CONSTRUCTOR) {
    2512     arelent_chain *chain = section->constructor_chain;
    2513     for (count = 0; count < section->reloc_count; count ++) {
    2514       *relptr ++ = &chain->relent;
    2515       chain = chain->next;
    2516     }
    2517   }
    2518   else {
    2519     tblptr = section->relocation;
    2520 
    2521     for (count = 0; count++ < section->reloc_count;)
    2522       {
    2523         *relptr++ = tblptr++;
    2524       }
    2525   }
     2568  if (section->flags & SEC_CONSTRUCTOR)
     2569    {
     2570      arelent_chain *chain = section->constructor_chain;
     2571      for (count = 0; count < section->reloc_count; count ++)
     2572        {
     2573          *relptr ++ = &chain->relent;
     2574          chain = chain->next;
     2575        }
     2576    }
     2577  else
     2578    {
     2579      tblptr = section->relocation;
     2580
     2581      for (count = 0; count++ < section->reloc_count; )
     2582        {
     2583          *relptr++ = tblptr++;
     2584        }
     2585    }
    25262586  *relptr = 0;
    25272587
     
    25342594     sec_ptr asect;
    25352595{
    2536   if (bfd_get_format (abfd) != bfd_object) {
    2537     bfd_set_error (bfd_error_invalid_operation);
    2538     return -1;
    2539   }
    2540   if (asect->flags & SEC_CONSTRUCTOR) {
     2596  if (bfd_get_format (abfd) != bfd_object)
     2597    {
     2598      bfd_set_error (bfd_error_invalid_operation);
     2599      return -1;
     2600    }
     2601
     2602  if (asect->flags & SEC_CONSTRUCTOR)
    25412603    return (sizeof (arelent *) * (asect->reloc_count+1));
    2542   }
    25432604
    25442605  if (asect == obj_datasec (abfd))
    25452606    return (sizeof (arelent *)
    2546             * ((exec_hdr(abfd)->a_drsize / obj_reloc_entry_size (abfd))
     2607            * ((exec_hdr (abfd)->a_drsize / obj_reloc_entry_size (abfd))
    25472608               + 1));
    25482609
    25492610  if (asect == obj_textsec (abfd))
    25502611    return (sizeof (arelent *)
    2551             * ((exec_hdr(abfd)->a_trsize / obj_reloc_entry_size (abfd))
     2612            * ((exec_hdr (abfd)->a_trsize / obj_reloc_entry_size (abfd))
    25522613               + 1));
    25532614
     
    25732634}
    25742635
    2575  alent *
     2636alent *
    25762637NAME(aout,get_lineno) (ignore_abfd, ignore_symbol)
    25772638     bfd *ignore_abfd ATTRIBUTE_UNUSED;
     
    25912652  if (ret->type == '?')
    25922653    {
    2593       int type_code = aout_symbol(symbol)->type & 0xff;
     2654      int type_code = aout_symbol (symbol)->type & 0xff;
    25942655      const char *stab_name = bfd_get_stab_name (type_code);
    25952656      static char buf[10];
     
    26022663      ret->type = '-';
    26032664      ret->stab_type = type_code;
    2604       ret->stab_other = (unsigned) (aout_symbol(symbol)->other & 0xff);
    2605       ret->stab_desc = (unsigned) (aout_symbol(symbol)->desc & 0xffff);
     2665      ret->stab_other = (unsigned) (aout_symbol (symbol)->other & 0xff);
     2666      ret->stab_desc = (unsigned) (aout_symbol (symbol)->desc & 0xffff);
    26062667      ret->stab_name = stab_name;
    26072668    }
     
    26092670
    26102671void
    2611 NAME(aout,print_symbol) (ignore_abfd, afile, symbol, how)
    2612      bfd *ignore_abfd ATTRIBUTE_UNUSED;
     2672NAME(aout,print_symbol) (abfd, afile, symbol, how)
     2673     bfd *abfd;
    26132674     PTR afile;
    26142675     asymbol *symbol;
     
    26172678  FILE *file = (FILE *)afile;
    26182679
    2619   switch (how) {
    2620   case bfd_print_symbol_name:
    2621     if (symbol->name)
    2622       fprintf (file,"%s", symbol->name);
    2623     break;
    2624   case bfd_print_symbol_more:
    2625     fprintf (file,"%4x %2x %2x",(unsigned) (aout_symbol(symbol)->desc & 0xffff),
    2626             (unsigned) (aout_symbol(symbol)->other & 0xff),
    2627             (unsigned) (aout_symbol(symbol)->type));
    2628     break;
    2629   case bfd_print_symbol_all:
    2630     {
    2631    CONST char *section_name = symbol->section->name;
    2632 
    2633       bfd_print_symbol_vandf((PTR)file,symbol);
    2634 
    2635       fprintf (file," %-5s %04x %02x %02x",
    2636               section_name,
    2637               (unsigned) (aout_symbol(symbol)->desc & 0xffff),
    2638               (unsigned) (aout_symbol(symbol)->other & 0xff),
    2639               (unsigned) (aout_symbol(symbol)->type  & 0xff));
     2680  switch (how)
     2681    {
     2682    case bfd_print_symbol_name:
    26402683      if (symbol->name)
    2641         fprintf (file," %s", symbol->name);
    2642     }
    2643     break;
    2644   }
     2684        fprintf (file,"%s", symbol->name);
     2685      break;
     2686    case bfd_print_symbol_more:
     2687      fprintf (file,"%4x %2x %2x",
     2688               (unsigned) (aout_symbol (symbol)->desc & 0xffff),
     2689               (unsigned) (aout_symbol (symbol)->other & 0xff),
     2690               (unsigned) (aout_symbol (symbol)->type));
     2691      break;
     2692    case bfd_print_symbol_all:
     2693      {
     2694        const char *section_name = symbol->section->name;
     2695
     2696        bfd_print_symbol_vandf (abfd, (PTR)file, symbol);
     2697
     2698        fprintf (file," %-5s %04x %02x %02x",
     2699                 section_name,
     2700                 (unsigned) (aout_symbol (symbol)->desc & 0xffff),
     2701                 (unsigned) (aout_symbol (symbol)->other & 0xff),
     2702                 (unsigned) (aout_symbol (symbol)->type & 0xff));
     2703        if (symbol->name)
     2704          fprintf (file," %s", symbol->name);
     2705      }
     2706      break;
     2707    }
    26452708}
    26462709
     
    26572720NAME(aout,read_minisymbols) (abfd, dynamic, minisymsp, sizep)
    26582721     bfd *abfd;
    2659      boolean dynamic;
     2722     bfd_boolean dynamic;
    26602723     PTR *minisymsp;
    26612724     unsigned int *sizep;
     
    26932756NAME(aout,minisymbol_to_symbol) (abfd, dynamic, minisym, sym)
    26942757     bfd *abfd;
    2695      boolean dynamic;
     2758     bfd_boolean dynamic;
    26962759     const PTR minisym;
    26972760     asymbol *sym;
     
    27112774          obj_aout_external_strings (abfd),
    27122775          obj_aout_external_string_size (abfd),
    2713           false)))
     2776          FALSE)))
    27142777    return NULL;
    27152778
     
    27172780}
    27182781
    2719 /*
    2720  provided a BFD, a section and an offset into the section, calculate
    2721  and return the name of the source file and the line nearest to the
    2722  wanted location.
    2723 */
    2724 
    2725 boolean
     2782/* Provided a BFD, a section and an offset into the section, calculate
     2783   and return the name of the source file and the line nearest to the
     2784   wanted location.  */
     2785
     2786bfd_boolean
    27262787NAME(aout,find_nearest_line)
    27272788     (abfd, section, symbols, offset, filename_ptr, functionname_ptr, line_ptr)
     
    27302791     asymbol **symbols;
    27312792     bfd_vma offset;
    2732      CONST char **filename_ptr;
    2733      CONST char **functionname_ptr;
     2793     const char **filename_ptr;
     2794     const char **functionname_ptr;
    27342795     unsigned int *line_ptr;
    27352796{
    2736   /* Run down the file looking for the filename, function and linenumber */
     2797  /* Run down the file looking for the filename, function and linenumber. */
    27372798  asymbol **p;
    2738   CONST char *directory_name = NULL;
    2739   CONST char *main_file_name = NULL;
    2740   CONST char *current_file_name = NULL;
    2741   CONST char *line_file_name = NULL; /* Value of current_file_name at line number.  */
    2742   CONST char *line_directory_name = NULL; /* Value of directory_name at line number.  */
     2799  const char *directory_name = NULL;
     2800  const char *main_file_name = NULL;
     2801  const char *current_file_name = NULL;
     2802  const char *line_file_name = NULL; /* Value of current_file_name at line number.  */
     2803  const char *line_directory_name = NULL; /* Value of directory_name at line number.  */
    27432804  bfd_vma low_line_vma = 0;
    27442805  bfd_vma low_func_vma = 0;
    27452806  asymbol *func = 0;
    2746   size_t filelen, funclen;
     2807  bfd_size_type filelen, funclen;
    27472808  char *buf;
    27482809
     
    27502811  *functionname_ptr = 0;
    27512812  *line_ptr = 0;
    2752   if (symbols != (asymbol **)NULL) {
    2753     for (p = symbols; *p; p++) {
    2754       aout_symbol_type  *q = (aout_symbol_type *) (*p);
    2755     next:
    2756       switch (q->type){
    2757       case N_TEXT:
    2758         /* If this looks like a file name symbol, and it comes after
    2759            the line number we have found so far, but before the
    2760            offset, then we have probably not found the right line
    2761            number.  */
    2762         if (q->symbol.value <= offset
    2763             && ((q->symbol.value > low_line_vma
    2764                  && (line_file_name != NULL
    2765                      || *line_ptr != 0))
    2766                 || (q->symbol.value > low_func_vma
    2767                     && func != NULL)))
    2768           {
    2769             const char *symname;
    2770 
    2771             symname = q->symbol.name;
    2772             if (strcmp (symname + strlen (symname) - 2, ".o") == 0)
     2813
     2814  if (symbols != (asymbol **)NULL)
     2815    {
     2816      for (p = symbols; *p; p++)
     2817        {
     2818          aout_symbol_type  *q = (aout_symbol_type *) (*p);
     2819        next:
     2820          switch (q->type)
     2821            {
     2822            case N_TEXT:
     2823              /* If this looks like a file name symbol, and it comes after
     2824                 the line number we have found so far, but before the
     2825                 offset, then we have probably not found the right line
     2826                 number.  */
     2827              if (q->symbol.value <= offset
     2828                  && ((q->symbol.value > low_line_vma
     2829                       && (line_file_name != NULL
     2830                           || *line_ptr != 0))
     2831                      || (q->symbol.value > low_func_vma
     2832                          && func != NULL)))
     2833                {
     2834                  const char *symname;
     2835
     2836                  symname = q->symbol.name;
     2837                  if (strcmp (symname + strlen (symname) - 2, ".o") == 0)
     2838                    {
     2839                      if (q->symbol.value > low_line_vma)
     2840                        {
     2841                          *line_ptr = 0;
     2842                          line_file_name = NULL;
     2843                        }
     2844                      if (q->symbol.value > low_func_vma)
     2845                        func = NULL;
     2846                    }
     2847                }
     2848              break;
     2849
     2850            case N_SO:
     2851              /* If this symbol is less than the offset, but greater than
     2852                 the line number we have found so far, then we have not
     2853                 found the right line number.  */
     2854              if (q->symbol.value <= offset)
     2855                {
     2856                  if (q->symbol.value > low_line_vma)
     2857                    {
     2858                      *line_ptr = 0;
     2859                      line_file_name = NULL;
     2860                    }
     2861                  if (q->symbol.value > low_func_vma)
     2862                    func = NULL;
     2863                }
     2864
     2865              main_file_name = current_file_name = q->symbol.name;
     2866              /* Look ahead to next symbol to check if that too is an N_SO.  */
     2867              p++;
     2868              if (*p == NULL)
     2869                break;
     2870              q = (aout_symbol_type *) (*p);
     2871              if (q->type != (int)N_SO)
     2872                goto next;
     2873
     2874              /* Found a second N_SO  First is directory; second is filename.  */
     2875              directory_name = current_file_name;
     2876              main_file_name = current_file_name = q->symbol.name;
     2877              if (obj_textsec (abfd) != section)
     2878                goto done;
     2879              break;
     2880            case N_SOL:
     2881              current_file_name = q->symbol.name;
     2882              break;
     2883
     2884            case N_SLINE:
     2885
     2886            case N_DSLINE:
     2887            case N_BSLINE:
     2888              /* We'll keep this if it resolves nearer than the one we have
     2889                 already.  */
     2890              if (q->symbol.value >= low_line_vma
     2891                  && q->symbol.value <= offset)
     2892                {
     2893                  *line_ptr = q->desc;
     2894                  low_line_vma = q->symbol.value;
     2895                  line_file_name = current_file_name;
     2896                  line_directory_name = directory_name;
     2897                }
     2898              break;
     2899            case N_FUN:
    27732900              {
    2774                 if (q->symbol.value > low_line_vma)
     2901                /* We'll keep this if it is nearer than the one we have already.  */
     2902                if (q->symbol.value >= low_func_vma &&
     2903                    q->symbol.value <= offset)
    27752904                  {
    2776                     *line_ptr = 0;
    2777                     line_file_name = NULL;
     2905                    low_func_vma = q->symbol.value;
     2906                    func = (asymbol *)q;
    27782907                  }
    2779                 if (q->symbol.value > low_func_vma)
    2780                   func = NULL;
     2908                else if (q->symbol.value > offset)
     2909                  goto done;
    27812910              }
    2782           }
    2783         break;
    2784 
    2785       case N_SO:
    2786         /* If this symbol is less than the offset, but greater than
    2787            the line number we have found so far, then we have not
    2788            found the right line number.  */
    2789         if (q->symbol.value <= offset)
    2790           {
    2791             if (q->symbol.value > low_line_vma)
    2792               {
    2793                 *line_ptr = 0;
    2794                 line_file_name = NULL;
    2795               }
    2796             if (q->symbol.value > low_func_vma)
    2797               func = NULL;
    2798           }
    2799 
    2800         main_file_name = current_file_name = q->symbol.name;
    2801         /* Look ahead to next symbol to check if that too is an N_SO.  */
    2802         p++;
    2803         if (*p == NULL)
    2804           break;
    2805         q = (aout_symbol_type *) (*p);
    2806         if (q->type != (int)N_SO)
    2807           goto next;
    2808 
    2809         /* Found a second N_SO  First is directory; second is filename.  */
    2810         directory_name = current_file_name;
    2811         main_file_name = current_file_name = q->symbol.name;
    2812         if (obj_textsec(abfd) != section)
    2813           goto done;
    2814         break;
    2815       case N_SOL:
    2816         current_file_name = q->symbol.name;
    2817         break;
    2818 
    2819       case N_SLINE:
    2820 
    2821       case N_DSLINE:
    2822       case N_BSLINE:
    2823         /* We'll keep this if it resolves nearer than the one we have
    2824            already.  */
    2825         if (q->symbol.value >= low_line_vma
    2826             && q->symbol.value <= offset)
    2827           {
    2828             *line_ptr = q->desc;
    2829             low_line_vma = q->symbol.value;
    2830             line_file_name = current_file_name;
    2831             line_directory_name = directory_name;
    2832           }
    2833         break;
    2834       case N_FUN:
    2835         {
    2836           /* We'll keep this if it is nearer than the one we have already */
    2837           if (q->symbol.value >= low_func_vma &&
    2838               q->symbol.value <= offset) {
    2839             low_func_vma = q->symbol.value;
    2840             func = (asymbol *)q;
    2841           }
    2842           else if (q->symbol.value > offset)
    2843             goto done;
     2911              break;
     2912            }
    28442913        }
    2845         break;
    2846       }
    2847     }
    2848   }
     2914    }
    28492915
    28502916 done:
     
    28612927  else
    28622928    filelen = strlen (directory_name) + strlen (main_file_name);
     2929
    28632930  if (func == NULL)
    28642931    funclen = 0;
     
    28682935  if (adata (abfd).line_buf != NULL)
    28692936    free (adata (abfd).line_buf);
     2937
    28702938  if (filelen + funclen == 0)
    28712939    adata (abfd).line_buf = buf = NULL;
     
    28752943      adata (abfd).line_buf = buf;
    28762944      if (buf == NULL)
    2877         return false;
     2945        return FALSE;
    28782946    }
    28792947
     
    28932961    {
    28942962      const char *function = func->name;
    2895       char *p;
     2963      char *colon;
    28962964
    28972965      /* The caller expects a symbol name.  We actually have a
     
    29052973          strcpy (buf + 1, function);
    29062974        }
    2907       /* Have to remove : stuff */
    2908       p = strchr (buf, ':');
    2909       if (p != NULL)
    2910         *p = '\0';
     2975      /* Have to remove : stuff. */
     2976      colon = strchr (buf, ':');
     2977      if (colon != NULL)
     2978        *colon = '\0';
    29112979      *functionname_ptr = buf;
    29122980    }
    29132981
    2914   return true;
     2982  return TRUE;
    29152983}
    29162984
     
    29182986NAME(aout,sizeof_headers) (abfd, execable)
    29192987     bfd *abfd;
    2920      boolean execable ATTRIBUTE_UNUSED;
    2921 {
    2922   return adata(abfd).exec_bytes_size;
     2988     bfd_boolean execable ATTRIBUTE_UNUSED;
     2989{
     2990  return adata (abfd).exec_bytes_size;
    29232991}
    29242992
     
    29262994   read it again later if we need it.  */
    29272995
    2928 boolean
     2996bfd_boolean
    29292997NAME(aout,bfd_free_cached_info) (abfd)
    29302998     bfd *abfd;
     
    29343002  if (bfd_get_format (abfd) != bfd_object
    29353003      || abfd->tdata.aout_data == NULL)
    2936     return true;
     3004    return TRUE;
    29373005
    29383006#define BFCI_FREE(x) if (x != NULL) { free (x); x = NULL; }
     
    29513019#undef BFCI_FREE
    29523020
    2953   return true;
     3021  return TRUE;
    29543022}
    29553023
     
    29573025/* a.out link code.  */
    29583026
    2959 static boolean aout_link_add_object_symbols
     3027static bfd_boolean aout_link_add_object_symbols
    29603028  PARAMS ((bfd *, struct bfd_link_info *));
    2961 static boolean aout_link_check_archive_element
    2962   PARAMS ((bfd *, struct bfd_link_info *, boolean *));
    2963 static boolean aout_link_free_symbols PARAMS ((bfd *));
    2964 static boolean aout_link_check_ar_symbols
    2965   PARAMS ((bfd *, struct bfd_link_info *, boolean *pneeded));
    2966 static boolean aout_link_add_symbols
     3029static bfd_boolean aout_link_check_archive_element
     3030  PARAMS ((bfd *, struct bfd_link_info *, bfd_boolean *));
     3031static bfd_boolean aout_link_free_symbols
     3032  PARAMS ((bfd *));
     3033static bfd_boolean aout_link_check_ar_symbols
     3034  PARAMS ((bfd *, struct bfd_link_info *, bfd_boolean *pneeded));
     3035static bfd_boolean aout_link_add_symbols
    29673036  PARAMS ((bfd *, struct bfd_link_info *));
    29683037
     
    29923061    {
    29933062      /* Set local fields.  */
    2994       ret->written = false;
     3063      ret->written = FALSE;
    29953064      ret->indx = -1;
    29963065    }
     
    30013070/* Initialize an a.out link hash table.  */
    30023071
    3003 boolean
     3072bfd_boolean
    30043073NAME(aout,link_hash_table_init) (table, abfd, newfunc)
    30053074     struct aout_link_hash_table *table;
    30063075     bfd *abfd;
    3007      struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *,
    3008                                                 struct bfd_hash_table *,
    3009                                                 const char *));
     3076     struct bfd_hash_entry *(*newfunc)
     3077       PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *,
     3078                const char *));
    30103079{
    30113080  return _bfd_link_hash_table_init (&table->root, abfd, newfunc);
     
    30193088{
    30203089  struct aout_link_hash_table *ret;
    3021 
    3022   ret = ((struct aout_link_hash_table *)
    3023          bfd_alloc (abfd, sizeof (struct aout_link_hash_table)));
     3090  bfd_size_type amt = sizeof (struct aout_link_hash_table);
     3091
     3092  ret = (struct aout_link_hash_table *) bfd_malloc (amt);
    30243093  if (ret == NULL)
    30253094    return (struct bfd_link_hash_table *) NULL;
     3095
    30263096  if (! NAME(aout,link_hash_table_init) (ret, abfd,
    30273097                                         NAME(aout,link_hash_newfunc)))
     
    30363106   appropriate.  */
    30373107
    3038 boolean
     3108bfd_boolean
    30393109NAME(aout,link_add_symbols) (abfd, info)
    30403110     bfd *abfd;
     
    30503120    default:
    30513121      bfd_set_error (bfd_error_wrong_format);
    3052       return false;
     3122      return FALSE;
    30533123    }
    30543124}
     
    30563126/* Add symbols from an a.out object file.  */
    30573127
    3058 static boolean
     3128static bfd_boolean
    30593129aout_link_add_object_symbols (abfd, info)
    30603130     bfd *abfd;
     
    30623132{
    30633133  if (! aout_get_external_symbols (abfd))
    3064     return false;
     3134    return FALSE;
    30653135  if (! aout_link_add_symbols (abfd, info))
    3066     return false;
     3136    return FALSE;
    30673137  if (! info->keep_memory)
    30683138    {
    30693139      if (! aout_link_free_symbols (abfd))
    3070         return false;
    3071     }
    3072   return true;
     3140        return FALSE;
     3141    }
     3142  return TRUE;
    30733143}
    30743144
     
    30783148   _bfd_generic_link_add_archive_symbols.  */
    30793149
    3080 static boolean
     3150static bfd_boolean
    30813151aout_link_check_archive_element (abfd, info, pneeded)
    30823152     bfd *abfd;
    30833153     struct bfd_link_info *info;
    3084      boolean *pneeded;
     3154     bfd_boolean *pneeded;
    30853155{
    30863156  if (! aout_get_external_symbols (abfd))
    3087     return false;
     3157    return FALSE;
    30883158
    30893159  if (! aout_link_check_ar_symbols (abfd, info, pneeded))
    3090     return false;
     3160    return FALSE;
    30913161
    30923162  if (*pneeded)
    30933163    {
    30943164      if (! aout_link_add_symbols (abfd, info))
    3095         return false;
     3165        return FALSE;
    30963166    }
    30973167
     
    30993169    {
    31003170      if (! aout_link_free_symbols (abfd))
    3101         return false;
    3102     }
    3103 
    3104   return true;
     3171        return FALSE;
     3172    }
     3173
     3174  return TRUE;
    31053175}
    31063176
    31073177/* Free up the internal symbols read from an a.out file.  */
    31083178
    3109 static boolean
     3179static bfd_boolean
    31103180aout_link_free_symbols (abfd)
    31113181     bfd *abfd;
     
    31293199      obj_aout_external_strings (abfd) = (char *) NULL;
    31303200    }
    3131   return true;
     3201  return TRUE;
    31323202}
    31333203
     
    31393209   (unless there is some other reason to include it).  */
    31403210
    3141 static boolean
     3211static bfd_boolean
    31423212aout_link_check_ar_symbols (abfd, info, pneeded)
    31433213     bfd *abfd;
    31443214     struct bfd_link_info *info;
    3145      boolean *pneeded;
     3215     bfd_boolean *pneeded;
    31463216{
    31473217  register struct external_nlist *p;
     
    31493219  char *strings;
    31503220
    3151   *pneeded = false;
     3221  *pneeded = FALSE;
    31523222
    31533223  /* Look through all the symbols.  */
     
    31573227  for (; p < pend; p++)
    31583228    {
    3159       int type = bfd_h_get_8 (abfd, p->e_type);
     3229      int type = H_GET_8 (abfd, p->e_type);
    31603230      const char *name;
    31613231      struct bfd_link_hash_entry *h;
     
    31793249
    31803250      name = strings + GET_WORD (abfd, p->e_strx);
    3181       h = bfd_link_hash_lookup (info->hash, name, false, false, true);
     3251      h = bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, TRUE);
    31823252
    31833253      /* We are only interested in symbols that are currently
     
    32043274          /* This object file defines this symbol.  We must link it
    32053275             in.  This is true regardless of whether the current
    3206              definition of the symbol is undefined or common.  If the
    3207              current definition is common, we have a case in which we
    3208              have already seen an object file including
     3276             definition of the symbol is undefined or common.
     3277
     3278             If the current definition is common, we have a case in
     3279             which we have already seen an object file including:
    32093280                 int a;
    3210              and this object file from the archive includes
     3281             and this object file from the archive includes:
    32113282                 int a = 5;
    3212              In such a case we must include this object file.
     3283             In such a case, whether to include this object is target
     3284             dependant for backward compatability.
    32133285
    32143286             FIXME: The SunOS 4.1.3 linker will pull in the archive
    32153287             element if the symbol is defined in the .data section,
    32163288             but not if it is defined in the .text section.  That
    3217              seems a bit crazy to me, and I haven't implemented it.
    3218              However, it might be correct.  */
     3289             seems a bit crazy to me, and it has not been implemented
     3290             yet.  However, it might be correct.  */
     3291          if (h->type == bfd_link_hash_common)
     3292            {
     3293              int skip = 0;
     3294
     3295              switch (info->common_skip_ar_aymbols)
     3296                {
     3297                case bfd_link_common_skip_text:
     3298                  skip = (type == (N_TEXT | N_EXT));
     3299                  break;
     3300                case bfd_link_common_skip_data:
     3301                  skip = (type == (N_DATA | N_EXT));
     3302                  break;
     3303                default:
     3304                case bfd_link_common_skip_all:
     3305                  skip = 1;
     3306                  break;
     3307                }
     3308
     3309              if (skip)
     3310                continue;
     3311            }
     3312
    32193313          if (! (*info->callbacks->add_archive_element) (info, abfd, name))
    3220             return false;
    3221           *pneeded = true;
    3222           return true;
     3314            return FALSE;
     3315          *pneeded = TRUE;
     3316          return TRUE;
    32233317        }
    32243318
     
    32473341                                                                     abfd,
    32483342                                                                     name))
    3249                         return false;
    3250                       *pneeded = true;
    3251                       return true;
     3343                        return FALSE;
     3344                      *pneeded = TRUE;
     3345                      return TRUE;
    32523346                    }
    32533347                  /* Turn the current link symbol into a common
     
    32583352                                  sizeof (struct bfd_link_hash_common_entry)));
    32593353                  if (h->u.c.p == NULL)
    3260                     return false;
     3354                    return FALSE;
    32613355
    32623356                  h->u.c.size = value;
     
    32953389            {
    32963390              if (! (*info->callbacks->add_archive_element) (info, abfd, name))
    3297                 return false;
    3298               *pneeded = true;
    3299               return true;
     3391                return FALSE;
     3392              *pneeded = TRUE;
     3393              return TRUE;
    33003394            }
    33013395        }
     
    33033397
    33043398  /* We do not need this object file.  */
    3305   return true;
     3399  return TRUE;
    33063400}
    33073401
    33083402/* Add all symbols from an object file to the hash table.  */
    33093403
    3310 static boolean
     3404static bfd_boolean
    33113405aout_link_add_symbols (abfd, info)
    33123406     bfd *abfd;
    33133407     struct bfd_link_info *info;
    33143408{
    3315   boolean (*add_one_symbol) PARAMS ((struct bfd_link_info *, bfd *,
    3316                                      const char *, flagword, asection *,
    3317                                      bfd_vma, const char *, boolean,
    3318                                      boolean,
    3319                                      struct bfd_link_hash_entry **));
     3409  bfd_boolean (*add_one_symbol)
     3410    PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, asection *,
     3411             bfd_vma, const char *, bfd_boolean, bfd_boolean,
     3412             struct bfd_link_hash_entry **));
    33203413  struct external_nlist *syms;
    33213414  bfd_size_type sym_count;
    33223415  char *strings;
    3323   boolean copy;
     3416  bfd_boolean copy;
    33243417  struct aout_link_hash_entry **sym_hash;
    33253418  register struct external_nlist *p;
    33263419  struct external_nlist *pend;
     3420  bfd_size_type amt;
    33273421
    33283422  syms = obj_aout_external_syms (abfd);
     
    33303424  strings = obj_aout_external_strings (abfd);
    33313425  if (info->keep_memory)
    3332     copy = false;
     3426    copy = FALSE;
    33333427  else
    3334     copy = true;
     3428    copy = TRUE;
    33353429
    33363430  if (aout_backend_info (abfd)->add_dynamic_symbols != NULL)
     
    33383432      if (! ((*aout_backend_info (abfd)->add_dynamic_symbols)
    33393433             (abfd, info, &syms, &sym_count, &strings)))
    3340         return false;
     3434        return FALSE;
    33413435    }
    33423436
     
    33453439     table, but keeping the list is more efficient.  Perhaps this
    33463440     should be conditional on info->keep_memory.  */
    3347   sym_hash = ((struct aout_link_hash_entry **)
    3348               bfd_alloc (abfd,
    3349                          ((size_t) sym_count
    3350                           * sizeof (struct aout_link_hash_entry *))));
     3441  amt = sym_count * sizeof (struct aout_link_hash_entry *);
     3442  sym_hash = (struct aout_link_hash_entry **) bfd_alloc (abfd, amt);
    33513443  if (sym_hash == NULL && sym_count != 0)
    3352     return false;
     3444    return FALSE;
    33533445  obj_aout_sym_hashes (abfd) = sym_hash;
    33543446
     
    33703462      *sym_hash = NULL;
    33713463
    3372       type = bfd_h_get_8 (abfd, p->e_type);
     3464      type = H_GET_8 (abfd, p->e_type);
    33733465
    33743466      /* Ignore debugging symbols.  */
     
    35073599
    35083600      if (! ((*add_one_symbol)
    3509              (info, abfd, name, flags, section, value, string, copy, false,
     3601             (info, abfd, name, flags, section, value, string, copy, FALSE,
    35103602              (struct bfd_link_hash_entry **) sym_hash)))
    3511         return false;
     3603        return FALSE;
    35123604
    35133605      /* Restrict the maximum alignment of a common symbol based on
     
    35353627    }
    35363628
    3537   return true;
     3629  return TRUE;
    35383630}
    35393631
     
    35663658/* Look up an entry in an the header file hash table.  */
    35673659
    3568 #define aout_link_includes_lookup(table, string, create, copy) \
    3569   ((struct aout_link_includes_entry *) \
     3660#define aout_link_includes_lookup(table, string, create, copy)          \
     3661  ((struct aout_link_includes_entry *)                                  \
    35703662   bfd_hash_lookup (&(table)->root, (string), (create), (copy)))
    35713663
     
    35993691static struct bfd_hash_entry *aout_link_includes_newfunc
    36003692  PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
    3601 static boolean aout_link_input_bfd
     3693static bfd_boolean aout_link_input_bfd
    36023694  PARAMS ((struct aout_final_link_info *, bfd *input_bfd));
    3603 static boolean aout_link_write_symbols
     3695static bfd_boolean aout_link_write_symbols
    36043696  PARAMS ((struct aout_final_link_info *, bfd *input_bfd));
    3605 static boolean aout_link_write_other_symbol
     3697static bfd_boolean aout_link_write_other_symbol
    36063698  PARAMS ((struct aout_link_hash_entry *, PTR));
    3607 static boolean aout_link_input_section
     3699static bfd_boolean aout_link_input_section
    36083700  PARAMS ((struct aout_final_link_info *, bfd *input_bfd,
    36093701           asection *input_section, file_ptr *reloff_ptr,
    36103702           bfd_size_type rel_size));
    3611 static boolean aout_link_input_section_std
     3703static bfd_boolean aout_link_input_section_std
    36123704  PARAMS ((struct aout_final_link_info *, bfd *input_bfd,
    36133705           asection *input_section, struct reloc_std_external *,
    36143706           bfd_size_type rel_size, bfd_byte *contents));
    3615 static boolean aout_link_input_section_ext
     3707static bfd_boolean aout_link_input_section_ext
    36163708  PARAMS ((struct aout_final_link_info *, bfd *input_bfd,
    36173709           asection *input_section, struct reloc_ext_external *,
     
    36193711static INLINE asection *aout_reloc_index_to_section
    36203712  PARAMS ((bfd *, int));
    3621 static boolean aout_link_reloc_link_order
     3713static bfd_boolean aout_link_reloc_link_order
    36223714  PARAMS ((struct aout_final_link_info *, asection *,
    36233715           struct bfd_link_order *));
     
    36623754   the output section.  */
    36633755
    3664 boolean
     3756bfd_boolean
    36653757NAME(aout,final_link) (abfd, info, callback)
    36663758     bfd *abfd;
     
    36693761{
    36703762  struct aout_final_link_info aout_info;
    3671   boolean includes_hash_initialized = false;
     3763  bfd_boolean includes_hash_initialized = FALSE;
    36723764  register bfd *sub;
    36733765  bfd_size_type trsize, drsize;
    3674   size_t max_contents_size;
    3675   size_t max_relocs_size;
    3676   size_t max_sym_count;
     3766  bfd_size_type max_contents_size;
     3767  bfd_size_type max_relocs_size;
     3768  bfd_size_type max_sym_count;
    36773769  bfd_size_type text_size;
    36783770  file_ptr text_end;
    36793771  register struct bfd_link_order *p;
    36803772  asection *o;
    3681   boolean have_link_order_relocs;
     3773  bfd_boolean have_link_order_relocs;
    36823774
    36833775  if (info->shared)
     
    36953787                               251))
    36963788    goto error_return;
    3697   includes_hash_initialized = true;
     3789  includes_hash_initialized = TRUE;
    36983790
    36993791  /* Figure out the largest section size.  Also, if generating
     
    37063798  for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
    37073799    {
    3708       size_t sz;
     3800      bfd_size_type sz;
    37093801
    37103802      if (info->relocateable)
     
    38183910
    38193911    h = aout_link_hash_lookup (aout_hash_table (info), "__DYNAMIC",
    3820                                false, false, false);
     3912                               FALSE, FALSE, FALSE);
    38213913    if (h != NULL)
    38223914      aout_link_write_other_symbol (h, &aout_info);
     
    38453937     whether we have already handled it.  */
    38463938  for (sub = info->input_bfds; sub != (bfd *) NULL; sub = sub->link_next)
    3847     sub->output_has_begun = false;
     3939    sub->output_has_begun = FALSE;
    38483940
    38493941  /* Mark all sections which are to be included in the link.  This
     
    38543946    {
    38553947      for (p = o->link_order_head; p != NULL; p = p->next)
    3856         {
    3857           if (p->type == bfd_indirect_link_order)
    3858             p->u.indirect.section->linker_mark = true;
    3859         }
    3860     }
    3861 
    3862   have_link_order_relocs = false;
     3948        if (p->type == bfd_indirect_link_order)
     3949          p->u.indirect.section->linker_mark = TRUE;
     3950    }
     3951
     3952  have_link_order_relocs = FALSE;
    38633953  for (o = abfd->sections; o != (asection *) NULL; o = o->next)
    38643954    {
     
    38783968                  if (! aout_link_input_bfd (&aout_info, input_bfd))
    38793969                    goto error_return;
    3880                   input_bfd->output_has_begun = true;
     3970                  input_bfd->output_has_begun = TRUE;
    38813971                }
    38823972            }
     
    38853975            {
    38863976              /* These are handled below.  */
    3887               have_link_order_relocs = true;
     3977              have_link_order_relocs = TRUE;
    38883978            }
    38893979          else
     
    39454035    {
    39464036      bfd_hash_table_free (&aout_info.includes.root);
    3947       includes_hash_initialized = false;
     4037      includes_hash_initialized = FALSE;
    39484038    }
    39494039
     
    39754065    {
    39764066      bfd_byte b;
     4067      file_ptr pos;
    39774068
    39784069      b = 0;
    3979       if (bfd_seek (abfd,
    3980                     (obj_datasec (abfd)->filepos
    3981                      + exec_hdr (abfd)->a_data
    3982                      - 1),
    3983                     SEEK_SET) != 0
    3984           || bfd_write (&b, 1, 1, abfd) != 1)
     4070      pos = obj_datasec (abfd)->filepos + exec_hdr (abfd)->a_data - 1;
     4071      if (bfd_seek (abfd, pos, SEEK_SET) != 0
     4072          || bfd_bwrite (&b, (bfd_size_type) 1, abfd) != 1)
    39854073        goto error_return;
    39864074    }
    39874075
    3988   return true;
     4076  return TRUE;
    39894077
    39904078 error_return:
     
    39994087  if (includes_hash_initialized)
    40004088    bfd_hash_table_free (&aout_info.includes.root);
    4001   return false;
     4089  return FALSE;
    40024090}
    40034091
    40044092/* Link an a.out input BFD into the output file.  */
    40054093
    4006 static boolean
     4094static bfd_boolean
    40074095aout_link_input_bfd (finfo, input_bfd)
    40084096     struct aout_final_link_info *finfo;
     
    40224110
    40234111  /* Get the symbols.  We probably have them already, unless
    4024      finfo->info->keep_memory is false.  */
     4112     finfo->info->keep_memory is FALSE.  */
    40254113  if (! aout_get_external_symbols (input_bfd))
    4026     return false;
     4114    return FALSE;
    40274115
    40284116  sym_count = obj_aout_external_sym_count (input_bfd);
     
    40314119     is placed into finfo->symbol_map.  */
    40324120  if (! aout_link_write_symbols (finfo, input_bfd))
    4033     return false;
     4121    return FALSE;
    40344122
    40354123  /* Relocate and write out the sections.  These functions use the
     
    40434131                                     &finfo->treloff,
    40444132                                     exec_hdr (input_bfd)->a_trsize))
    4045         return false;
     4133        return FALSE;
    40464134    }
    40474135  if (obj_datasec (input_bfd)->linker_mark)
     
    40514139                                     &finfo->dreloff,
    40524140                                     exec_hdr (input_bfd)->a_drsize))
    4053         return false;
     4141        return FALSE;
    40544142    }
    40554143
     
    40604148    {
    40614149      if (! aout_link_free_symbols (input_bfd))
    4062         return false;
    4063     }
    4064 
    4065   return true;
     4150        return FALSE;
     4151    }
     4152
     4153  return TRUE;
    40664154}
    40674155
     
    40694157   symbol indices into a symbol_map.  */
    40704158
    4071 static boolean
     4159static bfd_boolean
    40724160aout_link_write_symbols (finfo, input_bfd)
    40734161     struct aout_final_link_info *finfo;
     
    40854173  struct aout_link_hash_entry **sym_hash;
    40864174  int *symbol_map;
    4087   boolean pass;
    4088   boolean skip_next;
     4175  bfd_boolean pass;
     4176  bfd_boolean skip_next;
    40894177
    40904178  output_bfd = finfo->output_bfd;
     
    41004188      && (strip != strip_some
    41014189          || bfd_hash_lookup (finfo->info->keep_hash, input_bfd->filename,
    4102                               false, false) != NULL)
     4190                              FALSE, FALSE) != NULL)
    41034191      && discard != discard_all)
    41044192    {
    4105       bfd_h_put_8 (output_bfd, N_TEXT, outsym->e_type);
    4106       bfd_h_put_8 (output_bfd, 0, outsym->e_other);
    4107       bfd_h_put_16 (output_bfd, (bfd_vma) 0, outsym->e_desc);
     4193      H_PUT_8 (output_bfd, N_TEXT, outsym->e_type);
     4194      H_PUT_8 (output_bfd, 0, outsym->e_other);
     4195      H_PUT_16 (output_bfd, 0, outsym->e_desc);
    41084196      strtab_index = add_to_stringtab (output_bfd, finfo->strtab,
    4109                                        input_bfd->filename, false);
     4197                                       input_bfd->filename, FALSE);
    41104198      if (strtab_index == (bfd_size_type) -1)
    4111         return false;
     4199        return FALSE;
    41124200      PUT_WORD (output_bfd, strtab_index, outsym->e_strx);
    41134201      PUT_WORD (output_bfd,
     
    41204208    }
    41214209
    4122   pass = false;
    4123   skip_next = false;
     4210  pass = FALSE;
     4211  skip_next = FALSE;
    41244212  sym = obj_aout_external_syms (input_bfd);
    41254213  sym_end = sym + sym_count;
    41264214  sym_hash = obj_aout_sym_hashes (input_bfd);
    41274215  symbol_map = finfo->symbol_map;
    4128   memset (symbol_map, 0, sym_count * sizeof *symbol_map);
     4216  memset (symbol_map, 0, (size_t) sym_count * sizeof *symbol_map);
    41294217  for (; sym < sym_end; sym++, sym_hash++, symbol_map++)
    41304218    {
     
    41324220      int type;
    41334221      struct aout_link_hash_entry *h;
    4134       boolean skip;
     4222      bfd_boolean skip;
    41354223      asection *symsec;
    41364224      bfd_vma val = 0;
    4137       boolean copy;
     4225      bfd_boolean copy;
    41384226
    41394227      /* We set *symbol_map to 0 above for all symbols.  If it has
     
    41494237      *symbol_map = -1;
    41504238
    4151       type = bfd_h_get_8 (input_bfd, sym->e_type);
     4239      type = H_GET_8 (input_bfd, sym->e_type);
    41524240      name = strings + GET_WORD (input_bfd, sym->e_strx);
    41534241
     
    41594247             indirect or warning symbol.  */
    41604248          val = GET_WORD (input_bfd, sym->e_value);
    4161           pass = false;
     4249          pass = FALSE;
    41624250        }
    41634251      else if (skip_next)
     
    41664254             symbol that we have changed to no longer be an indirect
    41674255             symbol.  */
    4168           skip_next = false;
     4256          skip_next = FALSE;
    41694257          continue;
    41704258        }
     
    41814269          /* Use the name from the hash table, in case the symbol was
    41824270             wrapped.  */
    4183           if (h != NULL)
     4271          if (h != NULL
     4272              && h->root.type != bfd_link_hash_warning)
    41844273            name = h->root.root.string;
    41854274
     
    42034292          /* If the symbol has already been written out, skip it.  */
    42044293          if (h != (struct aout_link_hash_entry *) NULL
    4205               && h->root.type != bfd_link_hash_warning
    42064294              && h->written)
    42074295            {
    42084296              if ((type & N_TYPE) == N_INDR
    42094297                  || type == N_WARNING)
    4210                 skip_next = true;
     4298                skip_next = TRUE;
    42114299              *symbol_map = h->indx;
    42124300              continue;
     
    42144302
    42154303          /* See if we are stripping this symbol.  */
    4216           skip = false;
     4304          skip = FALSE;
    42174305          switch (strip)
    42184306            {
     
    42214309            case strip_debugger:
    42224310              if (IS_STAB(type))
    4223                 skip = true;
     4311                skip = TRUE;
    42244312              break;
    42254313            case strip_some:
    4226               if (bfd_hash_lookup (finfo->info->keep_hash, name, false, false)
     4314              if (bfd_hash_lookup (finfo->info->keep_hash, name, FALSE, FALSE)
    42274315                  == NULL)
    4228                 skip = true;
     4316                skip = TRUE;
    42294317              break;
    42304318            case strip_all:
    4231               skip = true;
     4319              skip = TRUE;
    42324320              break;
    42334321            }
     
    42354323            {
    42364324              if (h != (struct aout_link_hash_entry *) NULL)
    4237                 h->written = true;
     4325                h->written = TRUE;
    42384326              continue;
    42394327            }
     
    42644352                 the correct definition so the debugger will
    42654353                 understand it.  */
    4266               pass = true;
     4354              pass = TRUE;
    42674355              val = GET_WORD (input_bfd, sym->e_value);
    42684356              symsec = NULL;
     
    42854373                 which is the target of the indirection.  */
    42864374              if ((type & N_TYPE) == N_INDR)
    4287                 skip_next = true;
     4375                skip_next = TRUE;
    42884376
    42894377              symsec = NULL;
     
    43774465          if (h != (struct aout_link_hash_entry *) NULL)
    43784466            {
    4379               h->written = true;
     4467              h->written = TRUE;
    43804468              h->indx = obj_aout_external_sym_count (output_bfd);
    43814469            }
     
    43884476                {
    43894477                case discard_none:
     4478                case discard_sec_merge:
    43904479                  break;
    43914480                case discard_l:
    43924481                  if (!IS_STAB(type)
    43934482                      && bfd_is_local_label_name (input_bfd, name))
    4394                     skip = true;
     4483                    skip = TRUE;
    43954484                  break;
    43964485                case discard_all:
    4397                   skip = true;
     4486                  skip = TRUE;
    43984487                  break;
    43994488                }
    44004489              if (skip)
    44014490                {
    4402                   pass = false;
     4491                  pass = FALSE;
    44034492                  continue;
    44044493                }
     
    44114500             numbers in types (the first number after an open
    44124501             parenthesis).  */
    4413           if (type == N_BINCL)
     4502          if (type == (int) N_BINCL)
    44144503            {
    44154504              struct external_nlist *incl_sym;
     
    44244513                  int incl_type;
    44254514
    4426                   incl_type = bfd_h_get_8 (input_bfd, incl_sym->e_type);
    4427                   if (incl_type == N_EINCL)
     4515                  incl_type = H_GET_8 (input_bfd, incl_sym->e_type);
     4516                  if (incl_type == (int) N_EINCL)
    44284517                    {
    44294518                      if (nest == 0)
     
    44314520                      --nest;
    44324521                    }
    4433                   else if (incl_type == N_BINCL)
     4522                  else if (incl_type == (int) N_BINCL)
    44344523                    ++nest;
    44354524                  else if (nest == 0)
     
    44454534                              /* Skip the file number.  */
    44464535                              ++s;
    4447                               while (isdigit ((unsigned char) *s))
     4536                              while (ISDIGIT (*s))
    44484537                                ++s;
    44494538                              --s;
     
    44564545                 same value, then replace this one with an N_EXCL
    44574546                 symbol.  */
    4458               copy = ! finfo->info->keep_memory;
     4547              copy = (bfd_boolean) (! finfo->info->keep_memory);
    44594548              incl_entry = aout_link_includes_lookup (&finfo->includes,
    4460                                                       name, true, copy);
     4549                                                      name, TRUE, copy);
    44614550              if (incl_entry == NULL)
    4462                 return false;
     4551                return FALSE;
    44634552              for (t = incl_entry->totals; t != NULL; t = t->next)
    44644553                if (t->total == val)
     
    44724561                                          sizeof *t));
    44734562                  if (t == NULL)
    4474                     return false;
     4563                    return FALSE;
    44754564                  t->total = val;
    44764565                  t->next = incl_entry->totals;
     
    44844573                     it to be an N_EXCL entry, and mark all the
    44854574                     included symbols to prevent outputting them.  */
    4486                   type = N_EXCL;
     4575                  type = (int) N_EXCL;
    44874576
    44884577                  nest = 0;
     
    44934582                      int incl_type;
    44944583
    4495                       incl_type = bfd_h_get_8 (input_bfd, incl_sym->e_type);
    4496                       if (incl_type == N_EINCL)
     4584                      incl_type = H_GET_8 (input_bfd, incl_sym->e_type);
     4585                      if (incl_type == (int) N_EINCL)
    44974586                        {
    44984587                          if (nest == 0)
     
    45034592                          --nest;
    45044593                        }
    4505                       else if (incl_type == N_BINCL)
     4594                      else if (incl_type == (int) N_BINCL)
    45064595                        ++nest;
    45074596                      else if (nest == 0)
     
    45144603      /* Copy this symbol into the list of symbols we are going to
    45154604         write out.  */
    4516       bfd_h_put_8 (output_bfd, type, outsym->e_type);
    4517       bfd_h_put_8 (output_bfd, bfd_h_get_8 (input_bfd, sym->e_other),
    4518                    outsym->e_other);
    4519       bfd_h_put_16 (output_bfd, bfd_h_get_16 (input_bfd, sym->e_desc),
    4520                     outsym->e_desc);
    4521       copy = false;
     4605      H_PUT_8 (output_bfd, type, outsym->e_type);
     4606      H_PUT_8 (output_bfd, H_GET_8 (input_bfd, sym->e_other), outsym->e_other);
     4607      H_PUT_16 (output_bfd, H_GET_16 (input_bfd, sym->e_desc), outsym->e_desc);
     4608      copy = FALSE;
    45224609      if (! finfo->info->keep_memory)
    45234610        {
     
    45284615            name = h->root.root.string;
    45294616          else
    4530             copy = true;
     4617            copy = TRUE;
    45314618        }
    45324619      strtab_index = add_to_stringtab (output_bfd, finfo->strtab,
    45334620                                       name, copy);
    45344621      if (strtab_index == (bfd_size_type) -1)
    4535         return false;
     4622        return FALSE;
    45364623      PUT_WORD (output_bfd, strtab_index, outsym->e_strx);
    45374624      PUT_WORD (output_bfd, val, outsym->e_value);
     
    45444631  if (outsym > finfo->output_syms)
    45454632    {
    4546       bfd_size_type outsym_count;
     4633      bfd_size_type outsym_size;
    45474634
    45484635      if (bfd_seek (output_bfd, finfo->symoff, SEEK_SET) != 0)
    4549         return false;
    4550       outsym_count = outsym - finfo->output_syms;
    4551       if (bfd_write ((PTR) finfo->output_syms,
    4552                      (bfd_size_type) EXTERNAL_NLIST_SIZE,
    4553                      (bfd_size_type) outsym_count, output_bfd)
    4554           != outsym_count * EXTERNAL_NLIST_SIZE)
    4555         return false;
    4556       finfo->symoff += outsym_count * EXTERNAL_NLIST_SIZE;
    4557     }
    4558 
    4559   return true;
     4636        return FALSE;
     4637      outsym_size = outsym - finfo->output_syms;
     4638      outsym_size *= EXTERNAL_NLIST_SIZE;
     4639      if (bfd_bwrite ((PTR) finfo->output_syms, outsym_size, output_bfd)
     4640          != outsym_size)
     4641        return FALSE;
     4642      finfo->symoff += outsym_size;
     4643    }
     4644
     4645  return TRUE;
    45604646}
    45614647
     
    45634649   object.  */
    45644650
    4565 static boolean
     4651static bfd_boolean
    45664652aout_link_write_other_symbol (h, data)
    45674653     struct aout_link_hash_entry *h;
     
    45744660  struct external_nlist outsym;
    45754661  bfd_size_type indx;
     4662  bfd_size_type amt;
     4663
     4664  if (h->root.type == bfd_link_hash_warning)
     4665    {
     4666      h = (struct aout_link_hash_entry *) h->root.u.i.link;
     4667      if (h->root.type == bfd_link_hash_new)
     4668        return TRUE;
     4669    }
    45764670
    45774671  output_bfd = finfo->output_bfd;
     
    45884682
    45894683  if (h->written)
    4590     return true;
    4591 
    4592   h->written = true;
     4684    return TRUE;
     4685
     4686  h->written = TRUE;
    45934687
    45944688  /* An indx of -2 means the symbol must be written.  */
     
    45974691          || (finfo->info->strip == strip_some
    45984692              && bfd_hash_lookup (finfo->info->keep_hash, h->root.root.string,
    4599                                   false, false) == NULL)))
    4600     return true;
     4693                                  FALSE, FALSE) == NULL)))
     4694    return TRUE;
    46014695
    46024696  switch (h->root.type)
    46034697    {
    46044698    default:
     4699    case bfd_link_hash_warning:
    46054700      abort ();
    46064701      /* Avoid variable not initialized warnings.  */
    4607       return true;
     4702      return TRUE;
    46084703    case bfd_link_hash_new:
    46094704      /* This can happen for set symbols when sets are not being
    46104705         built.  */
    4611       return true;
     4706      return TRUE;
    46124707    case bfd_link_hash_undefined:
    46134708      type = N_UNDF | N_EXT;
     
    46444739      val = 0;
    46454740    case bfd_link_hash_indirect:
    4646     case bfd_link_hash_warning:
    4647       /* FIXME: Ignore these for now.  The circumstances under which
    4648          they should be written out are not clear to me.  */
    4649       return true;
    4650     }
    4651 
    4652   bfd_h_put_8 (output_bfd, type, outsym.e_type);
    4653   bfd_h_put_8 (output_bfd, 0, outsym.e_other);
    4654   bfd_h_put_16 (output_bfd, 0, outsym.e_desc);
     4741      /* We ignore these symbols, since the indirected symbol is
     4742         already in the hash table.  */
     4743      return TRUE;
     4744    }
     4745
     4746  H_PUT_8 (output_bfd, type, outsym.e_type);
     4747  H_PUT_8 (output_bfd, 0, outsym.e_other);
     4748  H_PUT_16 (output_bfd, 0, outsym.e_desc);
    46554749  indx = add_to_stringtab (output_bfd, finfo->strtab, h->root.root.string,
    4656                            false);
    4657   if (indx == (bfd_size_type) -1)
     4750                           FALSE);
     4751  if (indx == - (bfd_size_type) 1)
    46584752    {
    46594753      /* FIXME: No way to handle errors.  */
     
    46634757  PUT_WORD (output_bfd, val, outsym.e_value);
    46644758
     4759  amt = EXTERNAL_NLIST_SIZE;
    46654760  if (bfd_seek (output_bfd, finfo->symoff, SEEK_SET) != 0
    4666       || bfd_write ((PTR) &outsym, (bfd_size_type) EXTERNAL_NLIST_SIZE,
    4667                     (bfd_size_type) 1, output_bfd) != EXTERNAL_NLIST_SIZE)
     4761      || bfd_bwrite ((PTR) &outsym, amt, output_bfd) != amt)
    46684762    {
    46694763      /* FIXME: No way to handle errors.  */
     
    46754769  ++obj_aout_external_sym_count (output_bfd);
    46764770
    4677   return true;
     4771  return TRUE;
    46784772}
    46794773
    46804774/* Link an a.out section into the output file.  */
    46814775
    4682 static boolean
     4776static bfd_boolean
    46834777aout_link_input_section (finfo, input_bfd, input_section, reloff_ptr,
    46844778                         rel_size)
     
    46974791                                  (PTR) finfo->contents,
    46984792                                  (file_ptr) 0, input_size))
    4699     return false;
     4793    return FALSE;
    47004794
    47014795  /* Read in the relocs if we haven't already done it.  */
     
    47094803        {
    47104804          if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0
    4711               || bfd_read (relocs, 1, rel_size, input_bfd) != rel_size)
    4712             return false;
     4805              || bfd_bread (relocs, rel_size, input_bfd) != rel_size)
     4806            return FALSE;
    47134807        }
    47144808    }
     
    47204814                                         (struct reloc_std_external *) relocs,
    47214815                                         rel_size, finfo->contents))
    4722         return false;
     4816        return FALSE;
    47234817    }
    47244818  else
     
    47274821                                         (struct reloc_ext_external *) relocs,
    47284822                                         rel_size, finfo->contents))
    4729         return false;
     4823        return FALSE;
    47304824    }
    47314825
     
    47344828                                  input_section->output_section,
    47354829                                  (PTR) finfo->contents,
    4736                                   input_section->output_offset,
     4830                                  (file_ptr) input_section->output_offset,
    47374831                                  input_size))
    4738     return false;
     4832    return FALSE;
    47394833
    47404834  /* If we are producing relocateable output, the relocs were
     
    47434837    {
    47444838      if (bfd_seek (finfo->output_bfd, *reloff_ptr, SEEK_SET) != 0)
    4745         return false;
    4746       if (bfd_write (relocs, (bfd_size_type) 1, rel_size, finfo->output_bfd)
    4747           != rel_size)
    4748         return false;
     4839        return FALSE;
     4840      if (bfd_bwrite (relocs, rel_size, finfo->output_bfd) != rel_size)
     4841        return FALSE;
    47494842      *reloff_ptr += rel_size;
    47504843
     
    47584851    }
    47594852
    4760   return true;
     4853  return TRUE;
    47614854}
    47624855
     
    47884881/* Relocate an a.out section using standard a.out relocs.  */
    47894882
    4790 static boolean
     4883static bfd_boolean
    47914884aout_link_input_section_std (finfo, input_bfd, input_section, relocs,
    47924885                             rel_size, contents)
     
    47984891     bfd_byte *contents;
    47994892{
    4800   boolean (*check_dynamic_reloc) PARAMS ((struct bfd_link_info *,
    4801                                           bfd *, asection *,
    4802                                           struct aout_link_hash_entry *,
    4803                                           PTR, bfd_byte *, boolean *,
    4804                                           bfd_vma *));
     4893  bfd_boolean (*check_dynamic_reloc)
     4894    PARAMS ((struct bfd_link_info *, bfd *, asection *,
     4895             struct aout_link_hash_entry *, PTR, bfd_byte *, bfd_boolean *,
     4896             bfd_vma *));
    48054897  bfd *output_bfd;
    4806   boolean relocateable;
     4898  bfd_boolean relocateable;
    48074899  struct external_nlist *syms;
    48084900  char *strings;
     
    48444936
    48454937#ifdef MY_reloc_howto
    4846       howto = MY_reloc_howto(input_bfd, rel, r_index, r_extern, r_pcrel);
     4938      howto = MY_reloc_howto (input_bfd, rel, r_index, r_extern, r_pcrel);
    48474939#else
    48484940      {
     
    48544946        if (bfd_header_big_endian (input_bfd))
    48554947          {
    4856             r_index   =  ((rel->r_index[0] << 16)
    4857                           | (rel->r_index[1] << 8)
     4948            r_index   =  (((unsigned int) rel->r_index[0] << 16)
     4949                          | ((unsigned int) rel->r_index[1] << 8)
    48584950                          | rel->r_index[2]);
    48594951            r_extern  = (0 != (rel->r_type[0] & RELOC_STD_BITS_EXTERN_BIG));
     
    48674959        else
    48684960          {
    4869             r_index   = ((rel->r_index[2] << 16)
    4870                          | (rel->r_index[1] << 8)
     4961            r_index   = (((unsigned int) rel->r_index[2] << 16)
     4962                         | ((unsigned int) rel->r_index[1] << 8)
    48714963                         | rel->r_index[0]);
    48724964            r_extern  = (0 != (rel->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE));
     
    49515043                            {
    49525044                              h->indx = -2;
    4953                               h->written = false;
     5045                              h->written = FALSE;
    49545046                              if (! aout_link_write_other_symbol (h,
    49555047                                                                  (PTR) finfo))
    4956                                 return false;
     5048                                return FALSE;
    49575049                            }
    49585050                          r_index = h->indx;
     
    49675059                                 (finfo->info, name, input_bfd, input_section,
    49685060                                  r_addr)))
    4969                             return false;
     5061                            return FALSE;
    49705062                          r_index = 0;
    49715063                        }
     
    50275119      else
    50285120        {
    5029           boolean hundef;
     5121          bfd_boolean hundef;
    50305122
    50315123          /* We are generating an executable, and must do a full
    50325124             relocation.  */
    5033           hundef = false;
     5125          hundef = FALSE;
    50345126
    50355127          if (r_extern)
     
    50505142              else
    50515143                {
    5052                   hundef = true;
     5144                  hundef = TRUE;
    50535145                  relocation = 0;
    50545146                }
     
    50685160          if (check_dynamic_reloc != NULL)
    50695161            {
    5070               boolean skip;
     5162              bfd_boolean skip;
    50715163
    50725164              if (! ((*check_dynamic_reloc)
    50735165                     (finfo->info, input_bfd, input_section, h,
    50745166                      (PTR) rel, contents, &skip, &relocation)))
    5075                 return false;
     5167                return FALSE;
    50765168              if (skip)
    50775169                continue;
     
    50915183              if (! ((*finfo->info->callbacks->undefined_symbol)
    50925184                     (finfo->info, name, input_bfd, input_section,
    5093                      r_addr, true)))
    5094                 return false;
     5185                     r_addr, TRUE)))
     5186                return FALSE;
    50955187            }
    50965188
     
    51275219                       (finfo->info, name, howto->name,
    51285220                        (bfd_vma) 0, input_bfd, input_section, r_addr)))
    5129                   return false;
     5221                  return FALSE;
    51305222              }
    51315223              break;
     
    51345226    }
    51355227
    5136   return true;
     5228  return TRUE;
    51375229}
    51385230
    51395231/* Relocate an a.out section using extended a.out relocs.  */
    51405232
    5141 static boolean
     5233static bfd_boolean
    51425234aout_link_input_section_ext (finfo, input_bfd, input_section, relocs,
    51435235                             rel_size, contents)
     
    51495241     bfd_byte *contents;
    51505242{
    5151   boolean (*check_dynamic_reloc) PARAMS ((struct bfd_link_info *,
    5152                                           bfd *, asection *,
    5153                                           struct aout_link_hash_entry *,
    5154                                           PTR, bfd_byte *, boolean *,
    5155                                           bfd_vma *));
     5243  bfd_boolean (*check_dynamic_reloc)
     5244    PARAMS ((struct bfd_link_info *, bfd *, asection *,
     5245             struct aout_link_hash_entry *, PTR, bfd_byte *, bfd_boolean *,
     5246             bfd_vma *));
    51565247  bfd *output_bfd;
    5157   boolean relocateable;
     5248  bfd_boolean relocateable;
    51585249  struct external_nlist *syms;
    51595250  char *strings;
     
    51955286      if (bfd_header_big_endian (input_bfd))
    51965287        {
    5197           r_index  = ((rel->r_index[0] << 16)
    5198                       | (rel->r_index[1] << 8)
     5288          r_index  = (((unsigned int) rel->r_index[0] << 16)
     5289                      | ((unsigned int) rel->r_index[1] << 8)
    51995290                      | rel->r_index[2]);
    52005291          r_extern = (0 != (rel->r_type[0] & RELOC_EXT_BITS_EXTERN_BIG));
     
    52045295      else
    52055296        {
    5206           r_index  = ((rel->r_index[2] << 16)
    5207                       | (rel->r_index[1] << 8)
     5297          r_index  = (((unsigned int) rel->r_index[2] << 16)
     5298                      | ((unsigned int) rel->r_index[1] << 8)
    52085299                      | rel->r_index[0]);
    52095300          r_extern = (0 != (rel->r_type[0] & RELOC_EXT_BITS_EXTERN_LITTLE));
     
    52215312             modify the reloc accordingly.  */
    52225313          if (r_extern
    5223               || r_type == RELOC_BASE10
    5224               || r_type == RELOC_BASE13
    5225               || r_type == RELOC_BASE22)
     5314              || r_type == (unsigned int) RELOC_BASE10
     5315              || r_type == (unsigned int) RELOC_BASE13
     5316              || r_type == (unsigned int) RELOC_BASE22)
    52265317            {
    52275318              /* If we know the symbol this relocation is against,
    52285319                 convert it into a relocation against a section.  This
    52295320                 is what the native linker does.  */
    5230               if (r_type == RELOC_BASE10
    5231                   || r_type == RELOC_BASE13
    5232                   || r_type == RELOC_BASE22)
     5321              if (r_type == (unsigned int) RELOC_BASE10
     5322                  || r_type == (unsigned int) RELOC_BASE13
     5323                  || r_type == (unsigned int) RELOC_BASE22)
    52335324                h = NULL;
    52345325              else
     
    52895380                            {
    52905381                              h->indx = -2;
    5291                               h->written = false;
     5382                              h->written = FALSE;
    52925383                              if (! aout_link_write_other_symbol (h,
    52935384                                                                  (PTR) finfo))
    5294                                 return false;
     5385                                return FALSE;
    52955386                            }
    52965387                          r_index = h->indx;
     
    53055396                                 (finfo->info, name, input_bfd, input_section,
    53065397                                  r_addr)))
    5307                             return false;
     5398                            return FALSE;
    53085399                          r_index = 0;
    53095400                        }
     
    53705461      else
    53715462        {
    5372           boolean hundef;
     5463          bfd_boolean hundef;
    53735464          bfd_reloc_status_type r;
    53745465
    53755466          /* We are generating an executable, and must do a full
    53765467             relocation.  */
    5377           hundef = false;
     5468          hundef = FALSE;
    53785469
    53795470          if (r_extern)
     
    53945485              else
    53955486                {
    5396                   hundef = true;
     5487                  hundef = TRUE;
    53975488                  relocation = 0;
    53985489                }
    53995490            }
    5400           else if (r_type == RELOC_BASE10
    5401                    || r_type == RELOC_BASE13
    5402                    || r_type == RELOC_BASE22)
     5491          else if (r_type == (unsigned int) RELOC_BASE10
     5492                   || r_type == (unsigned int) RELOC_BASE13
     5493                   || r_type == (unsigned int) RELOC_BASE22)
    54035494            {
    54045495              struct external_nlist *sym;
     
    54085499                 into the symbol table, even if r_extern is 0.  */
    54095500              sym = syms + r_index;
    5410               type = bfd_h_get_8 (input_bfd, sym->e_type);
     5501              type = H_GET_8 (input_bfd, sym->e_type);
    54115502              if ((type & N_TYPE) == N_TEXT
    54125503                  || type == N_WEAKT)
     
    54675558          if (check_dynamic_reloc != NULL)
    54685559            {
    5469               boolean skip;
     5560              bfd_boolean skip;
    54705561
    54715562              if (! ((*check_dynamic_reloc)
    54725563                     (finfo->info, input_bfd, input_section, h,
    54735564                      (PTR) rel, contents, &skip, &relocation)))
    5474                 return false;
     5565                return FALSE;
    54755566              if (skip)
    54765567                continue;
     
    54825573          if (hundef
    54835574              && ! finfo->info->shared
    5484               && r_type != RELOC_BASE10
    5485               && r_type != RELOC_BASE13
    5486               && r_type != RELOC_BASE22)
     5575              && r_type != (unsigned int) RELOC_BASE10
     5576              && r_type != (unsigned int) RELOC_BASE13
     5577              && r_type != (unsigned int) RELOC_BASE22)
    54875578            {
    54885579              const char *name;
     
    54945585              if (! ((*finfo->info->callbacks->undefined_symbol)
    54955586                     (finfo->info, name, input_bfd, input_section,
    5496                      r_addr, true)))
    5497                 return false;
     5587                     r_addr, TRUE)))
     5588                return FALSE;
    54985589            }
    54995590
    5500           if (r_type != RELOC_SPARC_REV32)
     5591          if (r_type != (unsigned int) RELOC_SPARC_REV32)
    55015592            r = MY_final_link_relocate (howto_table_ext + r_type,
    55025593                                        input_bfd, input_section,
     
    55275618                      name = h->root.root.string;
    55285619                    else if (r_extern
    5529                              || r_type == RELOC_BASE10
    5530                              || r_type == RELOC_BASE13
    5531                              || r_type == RELOC_BASE22)
     5620                             || r_type == (unsigned int) RELOC_BASE10
     5621                             || r_type == (unsigned int) RELOC_BASE13
     5622                             || r_type == (unsigned int) RELOC_BASE22)
    55325623                      name = strings + GET_WORD (input_bfd,
    55335624                                                 syms[r_index].e_strx);
     
    55425633                           (finfo->info, name, howto_table_ext[r_type].name,
    55435634                            r_addend, input_bfd, input_section, r_addr)))
    5544                       return false;
     5635                      return FALSE;
    55455636                  }
    55465637                  break;
     
    55505641    }
    55515642
    5552   return true;
     5643  return TRUE;
    55535644}
    55545645
    55555646/* Handle a link order which is supposed to generate a reloc.  */
    55565647
    5557 static boolean
     5648static bfd_boolean
    55585649aout_link_reloc_link_order (finfo, o, p)
    55595650     struct aout_final_link_info *finfo;
     
    55695660  struct reloc_ext_external erel;
    55705661  PTR rel_ptr;
     5662  bfd_size_type amt;
    55715663
    55725664  pr = p->u.reloc.p;
     
    55915683      h = ((struct aout_link_hash_entry *)
    55925684           bfd_wrapped_link_hash_lookup (finfo->output_bfd, finfo->info,
    5593                                          pr->u.name, false, false, true));
     5685                                         pr->u.name, FALSE, FALSE, TRUE));
    55945686      if (h != (struct aout_link_hash_entry *) NULL
    55955687          && h->indx >= 0)
     
    56025694             symbol.  */
    56035695          h->indx = -2;
    5604           h->written = false;
     5696          h->written = FALSE;
    56055697          if (! aout_link_write_other_symbol (h, (PTR) finfo))
    5606             return false;
     5698            return FALSE;
    56075699          r_index = h->indx;
    56085700        }
     
    56125704                 (finfo->info, pr->u.name, (bfd *) NULL,
    56135705                  (asection *) NULL, (bfd_vma) 0)))
    5614             return false;
     5706            return FALSE;
    56155707          r_index = 0;
    56165708        }
     
    56215713    {
    56225714      bfd_set_error (bfd_error_bad_value);
    5623       return false;
     5715      return FALSE;
    56245716    }
    56255717
     
    56345726    {
    56355727#ifdef MY_put_reloc
    5636       MY_put_reloc(finfo->output_bfd, r_extern, r_index, p->offset, howto,
    5637                    &srel);
     5728      MY_put_reloc (finfo->output_bfd, r_extern, r_index, p->offset, howto,
     5729                    &srel);
    56385730#else
    56395731      {
     
    56445736        int r_length;
    56455737
    5646         r_pcrel = howto->pc_relative;
     5738        r_pcrel = (int) howto->pc_relative;
    56475739        r_baserel = (howto->type & 8) != 0;
    56485740        r_jmptable = (howto->type & 16) != 0;
     
    56915783          bfd_reloc_status_type r;
    56925784          bfd_byte *buf;
    5693           boolean ok;
     5785          bfd_boolean ok;
    56945786
    56955787          size = bfd_get_reloc_size (howto);
    56965788          buf = (bfd_byte *) bfd_zmalloc (size);
    56975789          if (buf == (bfd_byte *) NULL)
    5698             return false;
     5790            return FALSE;
    56995791          r = MY_relocate_contents (howto, finfo->output_bfd,
    5700                                       pr->addend, buf);
     5792                                    (bfd_vma) pr->addend, buf);
    57015793          switch (r)
    57025794            {
     
    57175809                {
    57185810                  free (buf);
    5719                   return false;
     5811                  return FALSE;
    57205812                }
    57215813              break;
    57225814            }
    5723           ok = bfd_set_section_contents (finfo->output_bfd, o,
    5724                                          (PTR) buf,
    5725                                          (file_ptr) p->offset,
    5726                                          size);
     5815          ok = bfd_set_section_contents (finfo->output_bfd, o, (PTR) buf,
     5816                                         (file_ptr) p->offset, size);
    57275817          free (buf);
    57285818          if (! ok)
    5729             return false;
     5819            return FALSE;
    57305820        }
    57315821    }
     
    57575847        }
    57585848
    5759       PUT_WORD (finfo->output_bfd, pr->addend, erel.r_addend);
     5849      PUT_WORD (finfo->output_bfd, (bfd_vma) pr->addend, erel.r_addend);
    57605850#endif /* MY_put_ext_reloc */
    57615851
     
    57635853    }
    57645854
     5855  amt = obj_reloc_entry_size (finfo->output_bfd);
    57655856  if (bfd_seek (finfo->output_bfd, *reloff_ptr, SEEK_SET) != 0
    5766       || (bfd_write (rel_ptr, (bfd_size_type) 1,
    5767                      obj_reloc_entry_size (finfo->output_bfd),
    5768                      finfo->output_bfd)
    5769           != obj_reloc_entry_size (finfo->output_bfd)))
    5770     return false;
     5857      || bfd_bwrite (rel_ptr, amt, finfo->output_bfd) != amt)
     5858    return FALSE;
    57715859
    57725860  *reloff_ptr += obj_reloc_entry_size (finfo->output_bfd);
     
    57795867                      <= obj_datasec (finfo->output_bfd)->rel_filepos)));
    57805868
    5781   return true;
    5782 }
     5869  return TRUE;
     5870}
Note: See TracChangeset for help on using the changeset viewer.