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

binutils v2.14 - offical sources.

File:
1 edited

Legend:

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

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    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
    273278reloc_howto_type *
     
    276281     bfd_reloc_code_real_type code;
    277282{
    278 #define EXT(i,j)        case i: return &howto_table_ext[j]
    279 #define STD(i,j)        case i: return &howto_table_std[j]
     283#define EXT(i, j)       case i: return &howto_table_ext[j]
     284#define STD(i, j)       case i: return &howto_table_std[j]
    280285  int ext = obj_reloc_entry_size (abfd) == RELOC_EXT_SIZE;
     286
    281287  if (code == BFD_RELOC_CTOR)
    282288    switch (bfd_get_arch_info (abfd)->bits_per_address)
     
    289295        break;
    290296      }
     297
    291298  if (ext)
    292299    switch (code)
     
    311318      }
    312319  else
    313     /* std relocs */
     320    /* std relocs. */
    314321    switch (code)
    315322      {
     323        STD (BFD_RELOC_8, 0);
    316324        STD (BFD_RELOC_16, 1);
    317325        STD (BFD_RELOC_32, 2);
     
    367375  memset ((PTR) execp, 0, sizeof (struct internal_exec));
    368376  /* Now fill in fields in the execp, from the bytes in the raw data.  */
    369   execp->a_info   = bfd_h_get_32 (abfd, bytes->e_info);
     377  execp->a_info   = H_GET_32 (abfd, bytes->e_info);
    370378  execp->a_text   = GET_WORD (abfd, bytes->e_text);
    371379  execp->a_data   = GET_WORD (abfd, bytes->e_data);
     
    402410
    403411  /* Now fill in fields in the raw data, from the fields in the exec struct.  */
    404   bfd_h_put_32 (abfd, execp->a_info  , bytes->e_info);
     412  H_PUT_32 (abfd, execp->a_info  , bytes->e_info);
    405413  PUT_WORD (abfd, execp->a_text  , bytes->e_text);
    406414  PUT_WORD (abfd, execp->a_data  , bytes->e_data);
     
    414422/* Make all the section for an a.out file.  */
    415423
    416 boolean
     424bfd_boolean
    417425NAME(aout,make_sections) (abfd)
    418426     bfd *abfd;
     
    420428  if (obj_textsec (abfd) == (asection *) NULL
    421429      && bfd_make_section (abfd, ".text") == (asection *) NULL)
    422     return false;
     430    return FALSE;
    423431  if (obj_datasec (abfd) == (asection *) NULL
    424432      && bfd_make_section (abfd, ".data") == (asection *) NULL)
    425     return false;
     433    return FALSE;
    426434  if (obj_bsssec (abfd) == (asection *) NULL
    427435      && bfd_make_section (abfd, ".bss") == (asection *) NULL)
    428     return false;
    429   return true;
     436    return FALSE;
     437  return TRUE;
    430438}
    431439
     
    455463  struct aout_data_struct *rawptr, *oldrawptr;
    456464  const bfd_target *result;
    457 
    458   rawptr = (struct aout_data_struct  *) bfd_zalloc (abfd, sizeof (struct aout_data_struct ));
     465  bfd_size_type amt = sizeof (struct aout_data_struct);
     466
     467  rawptr = (struct aout_data_struct  *) bfd_zalloc (abfd, amt);
    459468  if (rawptr == NULL)
    460469    return 0;
     
    471480
    472481  abfd->tdata.aout_data->a.hdr = &rawptr->e;
    473   *(abfd->tdata.aout_data->a.hdr) = *execp;     /* Copy in the internal_exec struct */
     482  /* Copy in the internal_exec struct.  */
     483  *(abfd->tdata.aout_data->a.hdr) = *execp;
    474484  execp = abfd->tdata.aout_data->a.hdr;
    475485
    476   /* Set the file flags */
     486  /* Set the file flags. */
    477487  abfd->flags = BFD_NO_FLAGS;
    478488  if (execp->a_drsize || execp->a_trsize)
    479489    abfd->flags |= HAS_RELOC;
    480   /* Setting of EXEC_P has been deferred to the bottom of this function */
     490  /* Setting of EXEC_P has been deferred to the bottom of this function. */
    481491  if (execp->a_syms)
    482492    abfd->flags |= HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS;
    483   if (N_DYNAMIC(*execp))
     493  if (N_DYNAMIC (*execp))
    484494    abfd->flags |= DYNAMIC;
    485495
     
    530540
    531541  if (! NAME(aout,make_sections) (abfd))
    532     return NULL;
     542    goto error_ret;
    533543
    534544  obj_datasec (abfd)->_raw_size = execp->a_data;
     
    558568  struct exec *execp = exec_hdr (abfd);
    559569
    560   obj_textsec (abfd)->size = N_TXTSIZE(*execp);
    561   obj_textsec (abfd)->raw_size = N_TXTSIZE(*execp);
    562   /* data and bss are already filled in since they're so standard */
    563 
    564   /* The virtual memory addresses of the sections */
    565   obj_textsec (abfd)->vma = N_TXTADDR(*execp);
    566   obj_datasec (abfd)->vma = N_DATADDR(*execp);
    567   obj_bsssec  (abfd)->vma = N_BSSADDR(*execp);
    568 
    569   /* The file offsets of the sections */
    570   obj_textsec (abfd)->filepos = N_TXTOFF(*execp);
    571   obj_datasec (abfd)->filepos = N_DATOFF(*execp);
    572 
    573   /* The file offsets of the relocation info */
    574   obj_textsec (abfd)->rel_filepos = N_TRELOFF(*execp);
    575   obj_datasec (abfd)->rel_filepos = N_DRELOFF(*execp);
     570  obj_textsec (abfd)->size = N_TXTSIZE (*execp);
     571  obj_textsec (abfd)->raw_size = N_TXTSIZE (*execp);
     572  /* Data and bss are already filled in since they're so standard. */
     573
     574  /* The virtual memory addresses of the sections. */
     575  obj_textsec (abfd)->vma = N_TXTADDR (*execp);
     576  obj_datasec (abfd)->vma = N_DATADDR (*execp);
     577  obj_bsssec  (abfd)->vma = N_BSSADDR (*execp);
     578
     579  /* The file offsets of the sections. */
     580  obj_textsec (abfd)->filepos = N_TXTOFF (*execp);
     581  obj_datasec (abfd)->filepos = N_DATOFF (*execp);
     582
     583  /* The file offsets of the relocation info. */
     584  obj_textsec (abfd)->rel_filepos = N_TRELOFF (*execp);
     585  obj_datasec (abfd)->rel_filepos = N_DRELOFF (*execp);
    576586
    577587  /* The file offsets of the string table and symbol table.  */
     
    580590
    581591  /* Determine the architecture and machine type of the object file.  */
    582   switch (N_MACHTYPE (*exec_hdr (abfd))) {
    583   default:
    584     abfd->obj_arch = bfd_arch_obscure;
    585     break;
    586   }
    587 
    588   adata(abfd)->page_size = TARGET_PAGE_SIZE;
    589   adata(abfd)->segment_size = SEGMENT_SIZE;
    590   adata(abfd)->exec_bytes_size = EXEC_BYTES_SIZE;
     592  switch (N_MACHTYPE (*exec_hdr (abfd)))
     593    {
     594    default:
     595      abfd->obj_arch = bfd_arch_obscure;
     596      break;
     597    }
     598
     599  adata (abfd)->page_size = TARGET_PAGE_SIZE;
     600  adata (abfd)->segment_size = SEGMENT_SIZE;
     601  adata (abfd)->exec_bytes_size = EXEC_BYTES_SIZE;
    591602
    592603  return abfd->xvec;
     
    620631
    621632  if (execp->a_entry != 0
    622       || (execp->a_entry >= obj_textsec(abfd)->vma
    623           && execp->a_entry < obj_textsec(abfd)->vma + obj_textsec(abfd)->_raw_size))
     633      || (execp->a_entry >= obj_textsec (abfd)->vma
     634          && execp->a_entry < (obj_textsec (abfd)->vma
     635                               + obj_textsec (abfd)->_raw_size)))
    624636    abfd->flags |= EXEC_P;
    625637#ifdef STAT_FOR_EXEC
     
    637649      if (abfd->iostream != NULL
    638650          && (abfd->flags & BFD_IN_MEMORY) == 0
    639           && (fstat(fileno((FILE *) (abfd->iostream)), &stat_buf) == 0)
     651          && (fstat (fileno ((FILE *) (abfd->iostream)), &stat_buf) == 0)
    640652          && ((stat_buf.st_mode & 0111) != 0))
    641653        abfd->flags |= EXEC_P;
     
    650662      obj_datasec (abfd)->next = obj_bsssec (abfd);
    651663#endif
    652     }
    653   else
    654     {
    655       free (rawptr);
    656       abfd->tdata.aout_data = oldrawptr;
    657     }
    658   return result;
     664      return result;
     665    }
     666
     667 error_ret:
     668  bfd_release (abfd, rawptr);
     669  abfd->tdata.aout_data = oldrawptr;
     670  return NULL;
    659671}
    660672
     
    664676
    665677SYNOPSIS
    666         boolean aout_@var{size}_mkobject, (bfd *abfd);
     678        bfd_boolean aout_@var{size}_mkobject, (bfd *abfd);
    667679
    668680DESCRIPTION
     
    670682*/
    671683
    672 boolean
     684bfd_boolean
    673685NAME(aout,mkobject) (abfd)
    674686     bfd *abfd;
    675687{
    676   struct aout_data_struct  *rawptr;
     688  struct aout_data_struct *rawptr;
     689  bfd_size_type amt = sizeof (struct aout_data_struct);
    677690
    678691  bfd_set_error (bfd_error_system_call);
    679692
    680   /* Use an intermediate variable for clarity */
    681   rawptr = (struct aout_data_struct *)bfd_zalloc (abfd, sizeof (struct aout_data_struct ));
    682 
     693  rawptr = (struct aout_data_struct *) bfd_zalloc (abfd, amt);
    683694  if (rawptr == NULL)
    684     return false;
     695    return FALSE;
    685696
    686697  abfd->tdata.aout_data = rawptr;
    687698  exec_hdr (abfd) = &(rawptr->e);
    688699
    689   obj_textsec (abfd) = (asection *)NULL;
    690   obj_datasec (abfd) = (asection *)NULL;
    691   obj_bsssec (abfd) = (asection *)NULL;
    692 
    693   return true;
     700  obj_textsec (abfd) = (asection *) NULL;
     701  obj_datasec (abfd) = (asection *) NULL;
     702  obj_bsssec (abfd) = (asection *) NULL;
     703
     704  return TRUE;
    694705}
    695706
     
    717728     enum bfd_architecture arch;
    718729     unsigned long machine;
    719      boolean *unknown;
     730     bfd_boolean *unknown;
    720731{
    721732  enum machine_type arch_flags;
    722733
    723734  arch_flags = M_UNKNOWN;
    724   *unknown = true;
    725 
    726   switch (arch) {
    727   case bfd_arch_sparc:
    728     if (machine == 0
    729         || machine == bfd_mach_sparc
    730         || machine == bfd_mach_sparc_sparclite
    731         || machine == bfd_mach_sparc_sparclite_le
    732         || machine == bfd_mach_sparc_v9)
    733       arch_flags = M_SPARC;
    734     else if (machine == bfd_mach_sparc_sparclet)
    735       arch_flags = M_SPARCLET;
    736     break;
    737 
    738   case bfd_arch_m68k:
    739     switch (machine) {
    740     case 0:               arch_flags = M_68010; break;
    741     case bfd_mach_m68000: arch_flags = M_UNKNOWN; *unknown = false; break;
    742     case bfd_mach_m68010: arch_flags = M_68010; break;
    743     case bfd_mach_m68020: arch_flags = M_68020; break;
    744     default:              arch_flags = M_UNKNOWN; break;
    745     }
    746     break;
    747 
    748   case bfd_arch_i386:
    749     if (machine == 0)   arch_flags = M_386;
    750     break;
    751 
    752   case bfd_arch_a29k:
    753     if (machine == 0)   arch_flags = M_29K;
    754     break;
    755 
    756   case bfd_arch_arm:
    757     if (machine == 0)   arch_flags = M_ARM;
    758     break;
    759 
    760   case bfd_arch_mips:
    761     switch (machine) {
    762     case 0:
    763     case bfd_mach_mips3000:
    764     case bfd_mach_mips3900:
    765       arch_flags = M_MIPS1;
     735  *unknown = TRUE;
     736
     737  switch (arch)
     738    {
     739    case bfd_arch_sparc:
     740      if (machine == 0
     741          || machine == bfd_mach_sparc
     742          || machine == bfd_mach_sparc_sparclite
     743          || machine == bfd_mach_sparc_sparclite_le
     744          || machine == bfd_mach_sparc_v9)
     745        arch_flags = M_SPARC;
     746      else if (machine == bfd_mach_sparc_sparclet)
     747        arch_flags = M_SPARCLET;
    766748      break;
    767     case bfd_mach_mips6000:
    768       arch_flags = M_MIPS2;
     749
     750    case bfd_arch_m68k:
     751      switch (machine)
     752        {
     753        case 0:               arch_flags = M_68010; break;
     754        case bfd_mach_m68000: arch_flags = M_UNKNOWN; *unknown = FALSE; break;
     755        case bfd_mach_m68010: arch_flags = M_68010; break;
     756        case bfd_mach_m68020: arch_flags = M_68020; break;
     757        default:              arch_flags = M_UNKNOWN; break;
     758        }
    769759      break;
    770     case bfd_mach_mips4000:
    771     case bfd_mach_mips4010:
    772     case bfd_mach_mips4100:
    773     case bfd_mach_mips4300:
    774     case bfd_mach_mips4400:
    775     case bfd_mach_mips4600:
    776     case bfd_mach_mips4650:
    777     case bfd_mach_mips8000:
    778     case bfd_mach_mips10000:
    779     case bfd_mach_mips12000:
    780     case bfd_mach_mips16:
    781     case bfd_mach_mips32:
    782     case bfd_mach_mips32_4k:
    783     case bfd_mach_mips5:
    784     case bfd_mach_mips64:
    785     case bfd_mach_mips_sb1:
    786       /* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc.  */
    787       arch_flags = M_MIPS2;
     760
     761    case bfd_arch_i386:
     762      if (machine == 0
     763          || machine == bfd_mach_i386_i386
     764          || machine == bfd_mach_i386_i386_intel_syntax)
     765        arch_flags = M_386;
    788766      break;
     767
     768    case bfd_arch_a29k:
     769      if (machine == 0)
     770        arch_flags = M_29K;
     771      break;
     772
     773    case bfd_arch_arm:
     774      if (machine == 0)
     775        arch_flags = M_ARM;
     776      break;
     777
     778    case bfd_arch_mips:
     779      switch (machine)
     780        {
     781        case 0:
     782        case bfd_mach_mips3000:
     783        case bfd_mach_mips3900:
     784          arch_flags = M_MIPS1;
     785          break;
     786        case bfd_mach_mips6000:
     787          arch_flags = M_MIPS2;
     788          break;
     789        case bfd_mach_mips4000:
     790        case bfd_mach_mips4010:
     791        case bfd_mach_mips4100:
     792        case bfd_mach_mips4300:
     793        case bfd_mach_mips4400:
     794        case bfd_mach_mips4600:
     795        case bfd_mach_mips4650:
     796        case bfd_mach_mips8000:
     797        case bfd_mach_mips10000:
     798        case bfd_mach_mips12000:
     799        case bfd_mach_mips16:
     800        case bfd_mach_mipsisa32:
     801        case bfd_mach_mipsisa32r2:
     802        case bfd_mach_mips5:
     803        case bfd_mach_mipsisa64:
     804        case bfd_mach_mips_sb1:
     805          /* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc.  */
     806          arch_flags = M_MIPS2;
     807          break;
     808        default:
     809          arch_flags = M_UNKNOWN;
     810          break;
     811        }
     812      break;
     813
     814    case bfd_arch_ns32k:
     815      switch (machine)
     816        {
     817        case 0:         arch_flags = M_NS32532; break;
     818        case 32032:     arch_flags = M_NS32032; break;
     819        case 32532:     arch_flags = M_NS32532; break;
     820        default:        arch_flags = M_UNKNOWN; break;
     821        }
     822      break;
     823
     824    case bfd_arch_vax:
     825      *unknown = FALSE;
     826      break;
     827
     828    case bfd_arch_cris:
     829      if (machine == 0 || machine == 255)
     830        arch_flags = M_CRIS;
     831      break;
     832
    789833    default:
    790834      arch_flags = M_UNKNOWN;
    791       break;
    792     }
    793     break;
    794 
    795   case bfd_arch_ns32k:
    796     switch (machine) {
    797     case 0:             arch_flags = M_NS32532; break;
    798     case 32032:         arch_flags = M_NS32032; break;
    799     case 32532:         arch_flags = M_NS32532; break;
    800     default:            arch_flags = M_UNKNOWN; break;
    801     }
    802     break;
    803 
    804   case bfd_arch_vax:
    805     *unknown = false;
    806     break;
    807 
    808   case bfd_arch_cris:
    809     if (machine == 0 || machine == 255) arch_flags = M_CRIS;
    810     break;
    811 
    812   default:
    813     arch_flags = M_UNKNOWN;
    814   }
     835    }
    815836
    816837  if (arch_flags != M_UNKNOWN)
    817     *unknown = false;
     838    *unknown = FALSE;
    818839
    819840  return arch_flags;
     
    825846
    826847SYNOPSIS
    827         boolean aout_@var{size}_set_arch_mach,
     848        bfd_boolean aout_@var{size}_set_arch_mach,
    828849         (bfd *,
    829850          enum bfd_architecture arch,
     
    836857*/
    837858
    838 boolean
     859bfd_boolean
    839860NAME(aout,set_arch_mach) (abfd, arch, machine)
    840861     bfd *abfd;
     
    843864{
    844865  if (! bfd_default_set_arch_mach (abfd, arch, machine))
    845     return false;
     866    return FALSE;
    846867
    847868  if (arch != bfd_arch_unknown)
    848869    {
    849       boolean unknown;
     870      bfd_boolean unknown;
    850871
    851872      NAME(aout,machine_type) (arch, machine, &unknown);
    852873      if (unknown)
    853         return false;
    854     }
    855 
    856   /* Determine the size of a relocation entry */
    857   switch (arch) {
    858   case bfd_arch_sparc:
    859   case bfd_arch_a29k:
    860   case bfd_arch_mips:
    861     obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;
    862     break;
    863   default:
    864     obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
    865     break;
    866   }
    867 
    868   return (*aout_backend_info(abfd)->set_sizes) (abfd);
     874        return FALSE;
     875    }
     876
     877  /* Determine the size of a relocation entry.  */
     878  switch (arch)
     879    {
     880    case bfd_arch_sparc:
     881    case bfd_arch_a29k:
     882    case bfd_arch_mips:
     883      obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;
     884      break;
     885    default:
     886      obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
     887      break;
     888    }
     889
     890  return (*aout_backend_info (abfd)->set_sizes) (abfd);
    869891}
    870892
     
    879901
    880902  /* Text.  */
    881   obj_textsec(abfd)->filepos = pos;
    882   if (!obj_textsec(abfd)->user_set_vma)
    883     obj_textsec(abfd)->vma = vma;
     903  obj_textsec (abfd)->filepos = pos;
     904  if (!obj_textsec (abfd)->user_set_vma)
     905    obj_textsec (abfd)->vma = vma;
    884906  else
    885     vma = obj_textsec(abfd)->vma;
    886 
    887   pos += obj_textsec(abfd)->_raw_size;
    888   vma += obj_textsec(abfd)->_raw_size;
     907    vma = obj_textsec (abfd)->vma;
     908
     909  pos += obj_textsec (abfd)->_raw_size;
     910  vma += obj_textsec (abfd)->_raw_size;
    889911
    890912  /* Data.  */
    891   if (!obj_datasec(abfd)->user_set_vma)
    892     {
    893 #if 0       /* ?? Does alignment in the file image really matter? */
    894       pad = align_power (vma, obj_datasec(abfd)->alignment_power) - vma;
     913  if (!obj_datasec (abfd)->user_set_vma)
     914    {
     915#if 0       /* ?? Does alignment in the file image really matter?  */
     916      pad = align_power (vma, obj_datasec (abfd)->alignment_power) - vma;
    895917#endif
    896       obj_textsec(abfd)->_raw_size += pad;
     918      obj_textsec (abfd)->_raw_size += pad;
    897919      pos += pad;
    898920      vma += pad;
    899       obj_datasec(abfd)->vma = vma;
     921      obj_datasec (abfd)->vma = vma;
    900922    }
    901923  else
    902     vma = obj_datasec(abfd)->vma;
    903   obj_datasec(abfd)->filepos = pos;
    904   pos += obj_datasec(abfd)->_raw_size;
    905   vma += obj_datasec(abfd)->_raw_size;
     924    vma = obj_datasec (abfd)->vma;
     925  obj_datasec (abfd)->filepos = pos;
     926  pos += obj_datasec (abfd)->_raw_size;
     927  vma += obj_datasec (abfd)->_raw_size;
    906928
    907929  /* BSS.  */
    908   if (!obj_bsssec(abfd)->user_set_vma)
     930  if (!obj_bsssec (abfd)->user_set_vma)
    909931    {
    910932#if 0
    911       pad = align_power (vma, obj_bsssec(abfd)->alignment_power) - vma;
     933      pad = align_power (vma, obj_bsssec (abfd)->alignment_power) - vma;
    912934#endif
    913       obj_datasec(abfd)->_raw_size += pad;
     935      obj_datasec (abfd)->_raw_size += pad;
    914936      pos += pad;
    915937      vma += pad;
    916       obj_bsssec(abfd)->vma = vma;
     938      obj_bsssec (abfd)->vma = vma;
    917939    }
    918940  else
    919941    {
    920       /* The VMA of the .bss section is set by the the VMA of the
     942      /* The VMA of the .bss section is set by the VMA of the
    921943         .data section plus the size of the .data section.  We may
    922944         need to add padding bytes to make this true.  */
     
    928950        }
    929951    }
    930   obj_bsssec(abfd)->filepos = pos;
     952  obj_bsssec (abfd)->filepos = pos;
    931953
    932954  /* Fix up the exec header.  */
    933   execp->a_text = obj_textsec(abfd)->_raw_size;
    934   execp->a_data = obj_datasec(abfd)->_raw_size;
    935   execp->a_bss = obj_bsssec(abfd)->_raw_size;
     955  execp->a_text = obj_textsec (abfd)->_raw_size;
     956  execp->a_data = obj_datasec (abfd)->_raw_size;
     957  execp->a_bss = obj_bsssec (abfd)->_raw_size;
    936958  N_SET_MAGIC (*execp, OMAGIC);
    937959}
     
    944966  bfd_size_type data_pad, text_pad;
    945967  file_ptr text_end;
    946   CONST struct aout_backend_data *abdp;
     968  const struct aout_backend_data *abdp;
    947969  int ztih;                     /* Nonzero if text includes exec header.  */
    948970
     
    953975          && (abdp->text_includes_header
    954976              || obj_aout_subformat (abfd) == q_magic_format));
    955   obj_textsec(abfd)->filepos = (ztih
    956                                 ? adata(abfd).exec_bytes_size
    957                                 : adata(abfd).zmagic_disk_block_size);
    958   if (! obj_textsec(abfd)->user_set_vma)
     977  obj_textsec (abfd)->filepos = (ztih
     978                                 ? adata (abfd).exec_bytes_size
     979                                 : adata (abfd).zmagic_disk_block_size);
     980  if (! obj_textsec (abfd)->user_set_vma)
    959981    {
    960982      /* ?? Do we really need to check for relocs here?  */
    961       obj_textsec(abfd)->vma = ((abfd->flags & HAS_RELOC)
    962                                 ? 0
    963                                 : (ztih
    964                                    ? (abdp->default_text_vma
    965                                       + adata(abfd).exec_bytes_size)
    966                                    : abdp->default_text_vma));
     983      obj_textsec (abfd)->vma = ((abfd->flags & HAS_RELOC)
     984                                 ? 0
     985                                 : (ztih
     986                                    ? (abdp->default_text_vma
     987                                       + adata (abfd).exec_bytes_size)
     988                                    : abdp->default_text_vma));
    967989      text_pad = 0;
    968990    }
     
    9951017      text_end += obj_textsec (abfd)->filepos;
    9961018    }
    997   obj_textsec(abfd)->_raw_size += text_pad;
     1019  obj_textsec (abfd)->_raw_size += text_pad;
    9981020  text_end += text_pad;
    9991021
    10001022  /* Data.  */
    1001   if (!obj_datasec(abfd)->user_set_vma)
     1023  if (!obj_datasec (abfd)->user_set_vma)
    10021024    {
    10031025      bfd_vma vma;
    1004       vma = obj_textsec(abfd)->vma + obj_textsec(abfd)->_raw_size;
    1005       obj_datasec(abfd)->vma = BFD_ALIGN (vma, adata(abfd).segment_size);
     1026      vma = obj_textsec (abfd)->vma + obj_textsec (abfd)->_raw_size;
     1027      obj_datasec (abfd)->vma = BFD_ALIGN (vma, adata (abfd).segment_size);
    10061028    }
    10071029  if (abdp && abdp->zmagic_mapped_contiguous)
    10081030    {
    1009       text_pad = (obj_datasec(abfd)->vma
    1010                   - obj_textsec(abfd)->vma
    1011                   - obj_textsec(abfd)->_raw_size);
    1012       obj_textsec(abfd)->_raw_size += text_pad;
    1013     }
    1014   obj_datasec(abfd)->filepos = (obj_textsec(abfd)->filepos
    1015                                 + obj_textsec(abfd)->_raw_size);
     1031      asection * text = obj_textsec (abfd);
     1032      asection * data = obj_datasec (abfd);
     1033
     1034      text_pad = data->vma - (text->vma + text->_raw_size);
     1035      /* Only pad the text section if the data
     1036         section is going to be placed after it.  */
     1037      if (text_pad > 0)
     1038        text->_raw_size += text_pad;
     1039    }
     1040  obj_datasec (abfd)->filepos = (obj_textsec (abfd)->filepos
     1041                                 + obj_textsec (abfd)->_raw_size);
    10161042
    10171043  /* Fix up exec header while we're at it.  */
    1018   execp->a_text = obj_textsec(abfd)->_raw_size;
     1044  execp->a_text = obj_textsec (abfd)->_raw_size;
    10191045  if (ztih && (!abdp || (abdp && !abdp->exec_header_not_counted)))
    1020     execp->a_text += adata(abfd).exec_bytes_size;
     1046    execp->a_text += adata (abfd).exec_bytes_size;
    10211047  if (obj_aout_subformat (abfd) == q_magic_format)
    10221048    N_SET_MAGIC (*execp, QMAGIC);
     
    10251051
    10261052  /* Spec says data section should be rounded up to page boundary.  */
    1027   obj_datasec(abfd)->_raw_size
    1028     = align_power (obj_datasec(abfd)->_raw_size,
    1029                    obj_bsssec(abfd)->alignment_power);
    1030   execp->a_data = BFD_ALIGN (obj_datasec(abfd)->_raw_size,
    1031                              adata(abfd).page_size);
    1032   data_pad = execp->a_data - obj_datasec(abfd)->_raw_size;
     1053  obj_datasec (abfd)->_raw_size
     1054    = align_power (obj_datasec (abfd)->_raw_size,
     1055                   obj_bsssec (abfd)->alignment_power);
     1056  execp->a_data = BFD_ALIGN (obj_datasec (abfd)->_raw_size,
     1057                             adata (abfd).page_size);
     1058  data_pad = execp->a_data - obj_datasec (abfd)->_raw_size;
    10331059
    10341060  /* BSS.  */
    1035   if (!obj_bsssec(abfd)->user_set_vma)
    1036     obj_bsssec(abfd)->vma = (obj_datasec(abfd)->vma
    1037                              + obj_datasec(abfd)->_raw_size);
     1061  if (!obj_bsssec (abfd)->user_set_vma)
     1062    obj_bsssec (abfd)->vma = (obj_datasec (abfd)->vma
     1063                              + obj_datasec (abfd)->_raw_size);
    10381064  /* If the BSS immediately follows the data section and extra space
    10391065     in the page is left after the data section, fudge data
     
    10431069     could have explicitly set the BSS vma to immediately follow
    10441070     the data section.)  */
    1045   if (align_power (obj_bsssec(abfd)->vma, obj_bsssec(abfd)->alignment_power)
    1046       == obj_datasec(abfd)->vma + obj_datasec(abfd)->_raw_size)
    1047     execp->a_bss = (data_pad > obj_bsssec(abfd)->_raw_size) ? 0 :
    1048       obj_bsssec(abfd)->_raw_size - data_pad;
     1071  if (align_power (obj_bsssec (abfd)->vma, obj_bsssec (abfd)->alignment_power)
     1072      == obj_datasec (abfd)->vma + obj_datasec (abfd)->_raw_size)
     1073    execp->a_bss = (data_pad > obj_bsssec (abfd)->_raw_size
     1074                    ? 0 : obj_bsssec (abfd)->_raw_size - data_pad);
    10491075  else
    1050     execp->a_bss = obj_bsssec(abfd)->_raw_size;
     1076    execp->a_bss = obj_bsssec (abfd)->_raw_size;
    10511077}
    10521078
     
    10561082     struct internal_exec *execp;
    10571083{
    1058   file_ptr pos = adata(abfd).exec_bytes_size;
     1084  file_ptr pos = adata (abfd).exec_bytes_size;
    10591085  bfd_vma vma = 0;
    10601086  int pad;
    10611087
    10621088  /* Text.  */
    1063   obj_textsec(abfd)->filepos = pos;
    1064   if (!obj_textsec(abfd)->user_set_vma)
    1065     obj_textsec(abfd)->vma = vma;
     1089  obj_textsec (abfd)->filepos = pos;
     1090  if (!obj_textsec (abfd)->user_set_vma)
     1091    obj_textsec (abfd)->vma = vma;
    10661092  else
    1067     vma = obj_textsec(abfd)->vma;
    1068   pos += obj_textsec(abfd)->_raw_size;
    1069   vma += obj_textsec(abfd)->_raw_size;
     1093    vma = obj_textsec (abfd)->vma;
     1094  pos += obj_textsec (abfd)->_raw_size;
     1095  vma += obj_textsec (abfd)->_raw_size;
    10701096
    10711097  /* Data.  */
    1072   obj_datasec(abfd)->filepos = pos;
    1073   if (!obj_datasec(abfd)->user_set_vma)
    1074     obj_datasec(abfd)->vma = BFD_ALIGN (vma, adata(abfd).segment_size);
    1075   vma = obj_datasec(abfd)->vma;
     1098  obj_datasec (abfd)->filepos = pos;
     1099  if (!obj_datasec (abfd)->user_set_vma)
     1100    obj_datasec (abfd)->vma = BFD_ALIGN (vma, adata (abfd).segment_size);
     1101  vma = obj_datasec (abfd)->vma;
    10761102
    10771103  /* Since BSS follows data immediately, see if it needs alignment.  */
    1078   vma += obj_datasec(abfd)->_raw_size;
    1079   pad = align_power (vma, obj_bsssec(abfd)->alignment_power) - vma;
    1080   obj_datasec(abfd)->_raw_size += pad;
    1081   pos += obj_datasec(abfd)->_raw_size;
     1104  vma += obj_datasec (abfd)->_raw_size;
     1105  pad = align_power (vma, obj_bsssec (abfd)->alignment_power) - vma;
     1106  obj_datasec (abfd)->_raw_size += pad;
     1107  pos += obj_datasec (abfd)->_raw_size;
    10821108
    10831109  /* BSS.  */
    1084   if (!obj_bsssec(abfd)->user_set_vma)
    1085     obj_bsssec(abfd)->vma = vma;
     1110  if (!obj_bsssec (abfd)->user_set_vma)
     1111    obj_bsssec (abfd)->vma = vma;
    10861112  else
    1087     vma = obj_bsssec(abfd)->vma;
     1113    vma = obj_bsssec (abfd)->vma;
    10881114
    10891115  /* Fix up exec header.  */
    1090   execp->a_text = obj_textsec(abfd)->_raw_size;
    1091   execp->a_data = obj_datasec(abfd)->_raw_size;
    1092   execp->a_bss = obj_bsssec(abfd)->_raw_size;
     1116  execp->a_text = obj_textsec (abfd)->_raw_size;
     1117  execp->a_data = obj_datasec (abfd)->_raw_size;
     1118  execp->a_bss = obj_bsssec (abfd)->_raw_size;
    10931119  N_SET_MAGIC (*execp, NMAGIC);
    10941120}
    10951121
    1096 boolean
     1122bfd_boolean
    10971123NAME(aout,adjust_sizes_and_vmas) (abfd, text_size, text_end)
    10981124     bfd *abfd;
     
    11031129
    11041130  if (! NAME(aout,make_sections) (abfd))
    1105     return false;
    1106 
    1107   if (adata(abfd).magic != undecided_magic)
    1108     return true;
    1109 
    1110   obj_textsec(abfd)->_raw_size =
    1111     align_power(obj_textsec(abfd)->_raw_size,
    1112                 obj_textsec(abfd)->alignment_power);
     1131    return FALSE;
     1132
     1133  if (adata (abfd).magic != undecided_magic)
     1134    return TRUE;
     1135
     1136  obj_textsec (abfd)->_raw_size =
     1137    align_power (obj_textsec (abfd)->_raw_size,
     1138                 obj_textsec (abfd)->alignment_power);
    11131139
    11141140  *text_size = obj_textsec (abfd)->_raw_size;
     
    11311157  if (abfd->flags & D_PAGED)
    11321158    /* Whether or not WP_TEXT is set -- let D_PAGED override.  */
    1133     adata(abfd).magic = z_magic;
     1159    adata (abfd).magic = z_magic;
    11341160  else if (abfd->flags & WP_TEXT)
    1135     adata(abfd).magic = n_magic;
     1161    adata (abfd).magic = n_magic;
    11361162  else
    1137     adata(abfd).magic = o_magic;
     1163    adata (abfd).magic = o_magic;
    11381164
    11391165#ifdef BFD_AOUT_DEBUG /* requires gcc2 */
     
    11411167  fprintf (stderr, "%s text=<%x,%x,%x> data=<%x,%x,%x> bss=<%x,%x,%x>\n",
    11421168           ({ char *str;
    1143               switch (adata(abfd).magic) {
    1144               case n_magic: str = "NMAGIC"; break;
    1145               case o_magic: str = "OMAGIC"; break;
    1146               case z_magic: str = "ZMAGIC"; break;
    1147               default: abort ();
    1148               }
     1169              switch (adata (abfd).magic)
     1170                {
     1171                case n_magic: str = "NMAGIC"; break;
     1172                case o_magic: str = "OMAGIC"; break;
     1173                case z_magic: str = "ZMAGIC"; break;
     1174                default: abort ();
     1175                }
    11491176              str;
    11501177            }),
    1151            obj_textsec(abfd)->vma, obj_textsec(abfd)->_raw_size,
    1152                 obj_textsec(abfd)->alignment_power,
    1153            obj_datasec(abfd)->vma, obj_datasec(abfd)->_raw_size,
    1154                 obj_datasec(abfd)->alignment_power,
    1155            obj_bsssec(abfd)->vma, obj_bsssec(abfd)->_raw_size,
    1156                 obj_bsssec(abfd)->alignment_power);
     1178           obj_textsec (abfd)->vma, obj_textsec (abfd)->_raw_size,
     1179                obj_textsec (abfd)->alignment_power,
     1180           obj_datasec (abfd)->vma, obj_datasec (abfd)->_raw_size,
     1181                obj_datasec (abfd)->alignment_power,
     1182           obj_bsssec (abfd)->vma, obj_bsssec (abfd)->_raw_size,
     1183                obj_bsssec (abfd)->alignment_power);
    11571184#endif
    11581185#endif
    11591186
    1160   switch (adata(abfd).magic)
     1187  switch (adata (abfd).magic)
    11611188    {
    11621189    case o_magic:
     
    11751202#ifdef BFD_AOUT_DEBUG
    11761203  fprintf (stderr, "       text=<%x,%x,%x> data=<%x,%x,%x> bss=<%x,%x>\n",
    1177            obj_textsec(abfd)->vma, obj_textsec(abfd)->_raw_size,
    1178                 obj_textsec(abfd)->filepos,
    1179            obj_datasec(abfd)->vma, obj_datasec(abfd)->_raw_size,
    1180                 obj_datasec(abfd)->filepos,
    1181            obj_bsssec(abfd)->vma, obj_bsssec(abfd)->_raw_size);
     1204           obj_textsec (abfd)->vma, obj_textsec (abfd)->_raw_size,
     1205                obj_textsec (abfd)->filepos,
     1206           obj_datasec (abfd)->vma, obj_datasec (abfd)->_raw_size,
     1207                obj_datasec (abfd)->filepos,
     1208           obj_bsssec (abfd)->vma, obj_bsssec (abfd)->_raw_size);
    11821209#endif
    11831210
    1184   return true;
     1211  return TRUE;
    11851212}
    11861213
     
    11901217
    11911218SYNOPSIS
    1192         boolean aout_@var{size}_new_section_hook,
     1219        bfd_boolean aout_@var{size}_new_section_hook,
    11931220           (bfd *abfd,
    11941221            asection *newsect));
     
    11981225        request.
    11991226*/
    1200 boolean
     1227bfd_boolean
    12011228NAME(aout,new_section_hook) (abfd, newsect)
    12021229     bfd *abfd;
    12031230     asection *newsect;
    12041231{
    1205   /* align to double at least */
    1206   newsect->alignment_power = bfd_get_arch_info(abfd)->section_align_power;
     1232  /* Align to double at least. */
     1233  newsect->alignment_power = bfd_get_arch_info (abfd)->section_align_power;
    12071234
    12081235  if (bfd_get_format (abfd) == bfd_object)
    1209   {
    1210     if (obj_textsec(abfd) == NULL && !strcmp(newsect->name, ".text")) {
    1211         obj_textsec(abfd)= newsect;
    1212         newsect->target_index = N_TEXT;
    1213         return true;
    1214       }
    1215 
    1216     if (obj_datasec(abfd) == NULL && !strcmp(newsect->name, ".data")) {
    1217         obj_datasec(abfd) = newsect;
    1218         newsect->target_index = N_DATA;
    1219         return true;
    1220       }
    1221 
    1222     if (obj_bsssec(abfd) == NULL && !strcmp(newsect->name, ".bss")) {
    1223         obj_bsssec(abfd) = newsect;
    1224         newsect->target_index = N_BSS;
    1225         return true;
    1226       }
    1227 
    1228   }
    1229 
    1230   /* We allow more than three sections internally */
    1231   return true;
    1232 }
    1233 
    1234 boolean
     1236    {
     1237      if (obj_textsec (abfd) == NULL && !strcmp (newsect->name, ".text"))
     1238        {
     1239          obj_textsec (abfd)= newsect;
     1240          newsect->target_index = N_TEXT;
     1241          return TRUE;
     1242        }
     1243
     1244      if (obj_datasec (abfd) == NULL && !strcmp (newsect->name, ".data"))
     1245        {
     1246          obj_datasec (abfd) = newsect;
     1247          newsect->target_index = N_DATA;
     1248          return TRUE;
     1249        }
     1250
     1251      if (obj_bsssec (abfd) == NULL && !strcmp (newsect->name, ".bss"))
     1252        {
     1253          obj_bsssec (abfd) = newsect;
     1254          newsect->target_index = N_BSS;
     1255          return TRUE;
     1256        }
     1257    }
     1258
     1259  /* We allow more than three sections internally.  */
     1260  return TRUE;
     1261}
     1262
     1263bfd_boolean
    12351264NAME(aout,set_section_contents) (abfd, section, location, offset, count)
    12361265     bfd *abfd;
     
    12461275    {
    12471276      if (! NAME(aout,adjust_sizes_and_vmas) (abfd, &text_size, &text_end))
    1248         return false;
     1277        return FALSE;
    12491278    }
    12501279
     
    12521281    {
    12531282      bfd_set_error (bfd_error_no_contents);
    1254       return false;
     1283      return FALSE;
    12551284    }
    12561285
     
    12581287      && section != obj_datasec (abfd))
    12591288    {
    1260       (*_bfd_error_handler)
    1261         (_("%s: can not represent section `%s' in a.out object file format"),
    1262          bfd_get_filename (abfd), bfd_get_section_name (abfd, section));
    1263       bfd_set_error (bfd_error_nonrepresentable_section);
    1264       return false;
     1289      if (aout_section_merge_with_text_p (abfd, section))
     1290        section->filepos = obj_textsec (abfd)->filepos +
     1291                           (section->vma - obj_textsec (abfd)->vma);
     1292      else
     1293        {
     1294          (*_bfd_error_handler)
     1295           (_("%s: can not represent section `%s' in a.out object file format"),
     1296             bfd_get_filename (abfd), bfd_get_section_name (abfd, section));
     1297          bfd_set_error (bfd_error_nonrepresentable_section);
     1298          return FALSE;
     1299        }
    12651300    }
    12661301
     
    12681303    {
    12691304      if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0
    1270           || bfd_write (location, 1, count, abfd) != count)
    1271         return false;
    1272     }
    1273 
    1274   return true;
     1305          || bfd_bwrite (location, count, abfd) != count)
     1306        return FALSE;
     1307    }
     1308
     1309  return TRUE;
    12751310}
    12761311
     
    12781313/* Read the external symbols from an a.out file.  */
    12791314
    1280 static boolean
     1315static bfd_boolean
    12811316aout_get_external_symbols (abfd)
    12821317     bfd *abfd;
     
    12861321      bfd_size_type count;
    12871322      struct external_nlist *syms;
     1323      bfd_size_type amt;
    12881324
    12891325      count = exec_hdr (abfd)->a_syms / EXTERNAL_NLIST_SIZE;
    12901326
    12911327#ifdef USE_MMAP
    1292       if (bfd_get_file_window (abfd,
    1293                                obj_sym_filepos (abfd), exec_hdr (abfd)->a_syms,
    1294                                &obj_aout_sym_window (abfd), true) == false)
    1295         return false;
     1328      if (! bfd_get_file_window (abfd, obj_sym_filepos (abfd),
     1329                                exec_hdr (abfd)->a_syms,
     1330                                 &obj_aout_sym_window (abfd), TRUE))
     1331        return FALSE;
    12961332      syms = (struct external_nlist *) obj_aout_sym_window (abfd).data;
    12971333#else
     
    13001336         possible to free them.  */
    13011337      syms = ((struct external_nlist *)
    1302               bfd_malloc ((size_t) count * EXTERNAL_NLIST_SIZE));
     1338              bfd_malloc (count * EXTERNAL_NLIST_SIZE));
    13031339      if (syms == (struct external_nlist *) NULL && count != 0)
    1304         return false;
    1305 
     1340        return FALSE;
     1341
     1342      amt = exec_hdr (abfd)->a_syms;
    13061343      if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
    1307           || (bfd_read (syms, 1, exec_hdr (abfd)->a_syms, abfd)
    1308               != exec_hdr (abfd)->a_syms))
     1344          || bfd_bread (syms, amt, abfd) != amt)
    13091345        {
    13101346          free (syms);
    1311           return false;
     1347          return FALSE;
    13121348        }
    13131349#endif
     
    13231359      bfd_size_type stringsize;
    13241360      char *strings;
     1361      bfd_size_type amt = BYTES_IN_WORD;
    13251362
    13261363      /* Get the size of the strings.  */
    13271364      if (bfd_seek (abfd, obj_str_filepos (abfd), SEEK_SET) != 0
    1328           || (bfd_read ((PTR) string_chars, BYTES_IN_WORD, 1, abfd)
    1329               != BYTES_IN_WORD))
    1330         return false;
     1365          || bfd_bread ((PTR) string_chars, amt, abfd) != amt)
     1366        return FALSE;
    13311367      stringsize = GET_WORD (abfd, string_chars);
    13321368
    13331369#ifdef USE_MMAP
    1334       if (bfd_get_file_window (abfd, obj_str_filepos (abfd), stringsize,
    1335                                &obj_aout_string_window (abfd), true) == false)
    1336         return false;
     1370      if (! bfd_get_file_window (abfd, obj_str_filepos (abfd), stringsize,
     1371                                 &obj_aout_string_window (abfd), TRUE))
     1372        return FALSE;
    13371373      strings = (char *) obj_aout_string_window (abfd).data;
    13381374#else
    1339       strings = (char *) bfd_malloc ((size_t) stringsize + 1);
     1375      strings = (char *) bfd_malloc (stringsize + 1);
    13401376      if (strings == NULL)
    1341         return false;
     1377        return FALSE;
    13421378
    13431379      /* Skip space for the string count in the buffer for convenience
    13441380         when using indexes.  */
    1345       if (bfd_read (strings + BYTES_IN_WORD, 1, stringsize - BYTES_IN_WORD,
    1346                     abfd)
    1347           != stringsize - BYTES_IN_WORD)
     1381      amt = stringsize - BYTES_IN_WORD;
     1382      if (bfd_bread (strings + BYTES_IN_WORD, amt, abfd) != amt)
    13481383        {
    13491384          free (strings);
    1350           return false;
     1385          return FALSE;
    13511386        }
    13521387#endif
     
    13611396    }
    13621397
    1363   return true;
     1398  return TRUE;
    13641399}
    13651400
     
    13691404   symbol->flags and symbol->section, and adjusting symbol->value.  */
    13701405
    1371 static boolean
     1406static bfd_boolean
    13721407translate_from_native_sym_flags (abfd, cache_ptr)
    13731408     bfd *abfd;
     
    13821417
    13831418      /* This is a debugging symbol.  */
    1384 
    13851419      cache_ptr->symbol.flags = BSF_DEBUGGING;
    13861420
     
    14071441      cache_ptr->symbol.value -= sec->vma;
    14081442
    1409       return true;
     1443      return TRUE;
    14101444    }
    14111445
     
    14761510        arelent_chain *reloc;
    14771511        asection *into_section;
     1512        bfd_size_type amt;
    14781513
    14791514        /* This is a set symbol.  The name of the symbol is the name
     
    14921527            char *copy;
    14931528
    1494             copy = bfd_alloc (abfd, strlen (cache_ptr->symbol.name) + 1);
     1529            amt = strlen (cache_ptr->symbol.name) + 1;
     1530            copy = bfd_alloc (abfd, amt);
    14951531            if (copy == NULL)
    1496               return false;
     1532              return FALSE;
    14971533
    14981534            strcpy (copy, cache_ptr->symbol.name);
    14991535            section = bfd_make_section (abfd, copy);
    15001536            if (section == NULL)
    1501               return false;
     1537              return FALSE;
    15021538          }
    15031539
    1504         reloc = (arelent_chain *) bfd_alloc (abfd, sizeof (arelent_chain));
     1540        amt = sizeof (arelent_chain);
     1541        reloc = (arelent_chain *) bfd_alloc (abfd, amt);
    15051542        if (reloc == NULL)
    1506           return false;
     1543          return FALSE;
    15071544
    15081545        /* Build a relocation entry for the constructor.  */
     
    15471584        section->_raw_size += BYTES_IN_WORD;
    15481585
    1549         reloc->relent.howto = CTOR_TABLE_RELOC_HOWTO(abfd);
     1586        reloc->relent.howto = CTOR_TABLE_RELOC_HOWTO (abfd);
    15501587
    15511588#endif /* 0 */
     
    16171654    }
    16181655
    1619   return true;
     1656  return TRUE;
    16201657}
    16211658
    16221659/* Set the fields of SYM_POINTER according to CACHE_PTR.  */
    16231660
    1624 static boolean
     1661static bfd_boolean
    16251662translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer)
    16261663     bfd *abfd;
     
    16481685         cache_ptr->name != NULL ? cache_ptr->name : _("*unknown*"));
    16491686      bfd_set_error (bfd_error_nonrepresentable_section);
    1650       return false;
     1687      return FALSE;
    16511688    }
    16521689
     
    16731710  else
    16741711    {
    1675       (*_bfd_error_handler)
    1676         (_("%s: can not represent section `%s' in a.out object file format"),
    1677          bfd_get_filename (abfd), bfd_get_section_name (abfd, sec));
    1678       bfd_set_error (bfd_error_nonrepresentable_section);
    1679       return false;
    1680     }
    1681 
    1682   /* Turn the symbol from section relative to absolute again */
     1712      if (aout_section_merge_with_text_p (abfd, sec))
     1713        sym_pointer->e_type[0] |= N_TEXT;
     1714      else
     1715        {
     1716          (*_bfd_error_handler)
     1717           (_("%s: can not represent section `%s' in a.out object file format"),
     1718             bfd_get_filename (abfd), bfd_get_section_name (abfd, sec));
     1719          bfd_set_error (bfd_error_nonrepresentable_section);
     1720          return FALSE;
     1721        }
     1722    }
     1723
     1724  /* Turn the symbol from section relative to absolute again.  */
    16831725  value += sec->vma + off;
    16841726
     
    16961738    {
    16971739      int type = ((aout_symbol_type *) cache_ptr)->type;
     1740
    16981741      switch (type)
    16991742        {
     
    17221765    }
    17231766
    1724   PUT_WORD(abfd, value, sym_pointer->e_value);
    1725 
    1726   return true;
     1767  PUT_WORD (abfd, value, sym_pointer->e_value);
     1768
     1769  return TRUE;
    17271770}
    17281771
     
    17341777     bfd *abfd;
    17351778{
    1736   aout_symbol_type  *new =
    1737     (aout_symbol_type *)bfd_zalloc (abfd, sizeof (aout_symbol_type));
     1779  bfd_size_type amt = sizeof (aout_symbol_type);
     1780  aout_symbol_type *new = (aout_symbol_type *) bfd_zalloc (abfd, amt);
    17381781  if (!new)
    17391782    return NULL;
     
    17451788/* Translate a set of internal symbols into external symbols.  */
    17461789
    1747 boolean
     1790bfd_boolean
    17481791NAME(aout,translate_symbol_table) (abfd, in, ext, count, str, strsize, dynamic)
    17491792     bfd *abfd;
     
    17531796     char *str;
    17541797     bfd_size_type strsize;
    1755      boolean dynamic;
     1798     bfd_boolean dynamic;
    17561799{
    17571800  struct external_nlist *ext_end;
     
    17751818        in->symbol.name = str + x;
    17761819      else
    1777         return false;
     1820        return FALSE;
    17781821
    17791822      in->symbol.value = GET_SWORD (abfd,  ext->e_value);
    1780       in->desc = bfd_h_get_16 (abfd, ext->e_desc);
    1781       in->other = bfd_h_get_8 (abfd, ext->e_other);
    1782       in->type = bfd_h_get_8 (abfd,  ext->e_type);
     1823      in->desc = H_GET_16 (abfd, ext->e_desc);
     1824      in->other = H_GET_8 (abfd, ext->e_other);
     1825      in->type = H_GET_8 (abfd,  ext->e_type);
    17831826      in->symbol.udata.p = NULL;
    17841827
    17851828      if (! translate_from_native_sym_flags (abfd, in))
    1786         return false;
     1829        return FALSE;
    17871830
    17881831      if (dynamic)
     
    17901833    }
    17911834
    1792   return true;
     1835  return TRUE;
    17931836}
    17941837
     
    17971840   hold them all plus all the cached symbol entries.  */
    17981841
    1799 boolean
     1842bfd_boolean
    18001843NAME(aout,slurp_symbol_table) (abfd)
    18011844     bfd *abfd;
     
    18031846  struct external_nlist *old_external_syms;
    18041847  aout_symbol_type *cached;
    1805   size_t cached_size;
    1806 
    1807   /* If there's no work to be done, don't do any */
     1848  bfd_size_type cached_size;
     1849
     1850  /* If there's no work to be done, don't do any. */
    18081851  if (obj_aout_symbols (abfd) != (aout_symbol_type *) NULL)
    1809     return true;
     1852    return TRUE;
    18101853
    18111854  old_external_syms = obj_aout_external_syms (abfd);
    18121855
    18131856  if (! aout_get_external_symbols (abfd))
    1814     return false;
    1815 
    1816   cached_size = (obj_aout_external_sym_count (abfd)
    1817                  * sizeof (aout_symbol_type));
    1818   cached = (aout_symbol_type *) bfd_malloc (cached_size);
     1857    return FALSE;
     1858
     1859  cached_size = obj_aout_external_sym_count (abfd);
     1860  cached_size *= sizeof (aout_symbol_type);
     1861  cached = (aout_symbol_type *) bfd_zmalloc (cached_size);
    18191862  if (cached == NULL && cached_size != 0)
    1820     return false;
    1821   if (cached_size != 0)
    1822     memset (cached, 0, cached_size);
     1863    return FALSE;
    18231864
    18241865  /* Convert from external symbol information to internal.  */
     
    18291870          obj_aout_external_strings (abfd),
    18301871          obj_aout_external_string_size (abfd),
    1831           false)))
     1872          FALSE)))
    18321873    {
    18331874      free (cached);
    1834       return false;
     1875      return FALSE;
    18351876    }
    18361877
     
    18541895    }
    18551896
    1856   return true;
     1897  return TRUE;
    18571898}
    18581899
     
    18681909
    18691910static bfd_size_type add_to_stringtab
    1870   PARAMS ((bfd *, struct bfd_strtab_hash *, const char *, boolean));
    1871 static boolean emit_stringtab PARAMS ((bfd *, struct bfd_strtab_hash *));
     1911  PARAMS ((bfd *, struct bfd_strtab_hash *, const char *, bfd_boolean));
     1912static bfd_boolean emit_stringtab
     1913  PARAMS ((bfd *, struct bfd_strtab_hash *));
    18721914
    18731915/* Get the index of a string in a strtab, adding it if it is not
     
    18791921     struct bfd_strtab_hash *tab;
    18801922     const char *str;
    1881      boolean copy;
    1882 {
    1883   boolean hash;
     1923     bfd_boolean copy;
     1924{
     1925  bfd_boolean hash;
    18841926  bfd_size_type index;
    18851927
     
    18901932  /* Don't hash if BFD_TRADITIONAL_FORMAT is set, because SunOS dbx
    18911933     doesn't understand a hashed string table.  */
    1892   hash = true;
     1934  hash = TRUE;
    18931935  if ((abfd->flags & BFD_TRADITIONAL_FORMAT) != 0)
    1894     hash = false;
     1936    hash = FALSE;
    18951937
    18961938  index = _bfd_stringtab_add (tab, str, hash, copy);
     
    19091951   file.  */
    19101952
    1911 static boolean
     1953static bfd_boolean
    19121954emit_stringtab (abfd, tab)
    19131955     register bfd *abfd;
     
    19151957{
    19161958  bfd_byte buffer[BYTES_IN_WORD];
     1959  bfd_size_type amt = BYTES_IN_WORD;
    19171960
    19181961  /* The string table starts with the size.  */
    19191962  PUT_WORD (abfd, _bfd_stringtab_size (tab) + BYTES_IN_WORD, buffer);
    1920   if (bfd_write ((PTR) buffer, 1, BYTES_IN_WORD, abfd) != BYTES_IN_WORD)
    1921     return false;
     1963  if (bfd_bwrite ((PTR) buffer, amt, abfd) != amt)
     1964    return FALSE;
    19221965
    19231966  return _bfd_stringtab_emit (abfd, tab);
     
    19251968
    19261969
    1927 boolean
     1970bfd_boolean
    19281971NAME(aout,write_syms) (abfd)
    19291972     bfd *abfd;
     
    19351978  strtab = _bfd_stringtab_init ();
    19361979  if (strtab == NULL)
    1937     return false;
     1980    return FALSE;
    19381981
    19391982  for (count = 0; count < bfd_get_symcount (abfd); count++)
     
    19421985      bfd_size_type indx;
    19431986      struct external_nlist nsp;
    1944 
    1945       indx = add_to_stringtab (abfd, strtab, g->name, false);
     1987      bfd_size_type amt;
     1988
     1989      indx = add_to_stringtab (abfd, strtab, g->name, FALSE);
    19461990      if (indx == (bfd_size_type) -1)
    19471991        goto error_return;
    19481992      PUT_WORD (abfd, indx, (bfd_byte *) nsp.e_strx);
    19491993
    1950       if (bfd_asymbol_flavour(g) == abfd->xvec->flavour)
     1994      if (bfd_asymbol_flavour (g) == abfd->xvec->flavour)
    19511995        {
    1952           bfd_h_put_16(abfd, aout_symbol(g)->desc,  nsp.e_desc);
    1953           bfd_h_put_8(abfd, aout_symbol(g)->other, nsp.e_other);
    1954           bfd_h_put_8(abfd, aout_symbol(g)->type,  nsp.e_type);
     1996          H_PUT_16 (abfd, aout_symbol (g)->desc,  nsp.e_desc);
     1997          H_PUT_8  (abfd, aout_symbol (g)->other, nsp.e_other);
     1998          H_PUT_8  (abfd, aout_symbol (g)->type,  nsp.e_type);
    19551999        }
    19562000      else
    19572001        {
    1958           bfd_h_put_16(abfd,0, nsp.e_desc);
    1959           bfd_h_put_8(abfd, 0, nsp.e_other);
    1960           bfd_h_put_8(abfd, 0, nsp.e_type);
     2002          H_PUT_16 (abfd, 0, nsp.e_desc);
     2003          H_PUT_8  (abfd, 0, nsp.e_other);
     2004          H_PUT_8  (abfd, 0, nsp.e_type);
    19612005        }
    19622006
     
    19642008        goto error_return;
    19652009
    1966       if (bfd_write((PTR)&nsp,1,EXTERNAL_NLIST_SIZE, abfd)
    1967           != EXTERNAL_NLIST_SIZE)
     2010      amt = EXTERNAL_NLIST_SIZE;
     2011      if (bfd_bwrite ((PTR) &nsp, amt, abfd) != amt)
    19682012        goto error_return;
    19692013
     
    19782022  _bfd_stringtab_free (strtab);
    19792023
    1980   return true;
     2024  return TRUE;
    19812025
    19822026error_return:
    19832027  _bfd_stringtab_free (strtab);
    1984   return false;
     2028  return FALSE;
    19852029}
    19862030
     
    19972041      return -1;
    19982042
    1999     for (symbase = obj_aout_symbols(abfd); counter++ < bfd_get_symcount (abfd);)
    2000       *(location++) = (asymbol *) ( symbase++);
     2043    for (symbase = obj_aout_symbols (abfd);
     2044         counter++ < bfd_get_symcount (abfd);
     2045         )
     2046      *(location++) = (asymbol *) (symbase++);
    20012047    *location++ =0;
    20022048    return bfd_get_symcount (abfd);
     
    20042050
    20052051
    2006 /* Standard reloc stuff */
     2052/* Standard reloc stuff. */
    20072053/* Output standard relocation information to a file in target byte order.  */
    20082054
     
    20242070  asection *output_section = sym->section->output_section;
    20252071
    2026   PUT_WORD(abfd, g->address, natptr->r_address);
    2027 
    2028   r_length = g->howto->size ;   /* Size as a power of two */
    2029   r_pcrel  = (int) g->howto->pc_relative; /* Relative to PC? */
     2072  PUT_WORD (abfd, g->address, natptr->r_address);
     2073
     2074  r_length = g->howto->size ;   /* Size as a power of two. */
     2075  r_pcrel  = (int) g->howto->pc_relative; /* Relative to PC?  */
    20302076  /* XXX This relies on relocs coming from a.out files.  */
    20312077  r_baserel = (g->howto->type & 8) != 0;
     
    20382084#endif
    20392085
    2040   /* name was clobbered by aout_write_syms to be symbol index */
     2086  /* Name was clobbered by aout_write_syms to be symbol index. */
    20412087
    20422088  /* If this relocation is relative to a symbol then set the
     
    20452091     Absolute symbols can come in in two ways, either as an offset
    20462092     from the abs section, or as a symbol which has an abs value.
    2047      check for that here
    2048      */
     2093     check for that here.  */
    20492094
    20502095  if (bfd_is_com_section (output_section)
     
    20532098    {
    20542099      if (bfd_abs_section_ptr->symbol == sym)
    2055       {
    2056         /* Whoops, looked like an abs symbol, but is really an offset
    2057            from the abs section */
    2058         r_index = N_ABS;
    2059         r_extern = 0;
    2060        }
     2100        {
     2101          /* Whoops, looked like an abs symbol, but is
     2102             really an offset from the abs section. */
     2103          r_index = N_ABS;
     2104          r_extern = 0;
     2105        }
    20612106      else
    2062       {
    2063         /* Fill in symbol */
    2064         r_extern = 1;
    2065         r_index = (*(g->sym_ptr_ptr))->KEEPIT;
    2066 
    2067       }
     2107        {
     2108          /* Fill in symbol.  */
     2109          r_extern = 1;
     2110          r_index = (*(g->sym_ptr_ptr))->KEEPIT;
     2111        }
    20682112    }
    20692113  else
    20702114    {
    2071       /* Just an ordinary section */
     2115      /* Just an ordinary section. */
    20722116      r_extern = 0;
    20732117      r_index  = output_section->target_index;
    20742118    }
    20752119
    2076   /* now the fun stuff */
    2077   if (bfd_header_big_endian (abfd)) {
     2120  /* Now the fun stuff.  */
     2121  if (bfd_header_big_endian (abfd))
     2122    {
    20782123      natptr->r_index[0] = r_index >> 16;
    20792124      natptr->r_index[1] = r_index >> 8;
    20802125      natptr->r_index[2] = r_index;
    2081       natptr->r_type[0] =
    2082        (r_extern?    RELOC_STD_BITS_EXTERN_BIG: 0)
    2083         | (r_pcrel?     RELOC_STD_BITS_PCREL_BIG: 0)
    2084          | (r_baserel?   RELOC_STD_BITS_BASEREL_BIG: 0)
    2085           | (r_jmptable?  RELOC_STD_BITS_JMPTABLE_BIG: 0)
    2086            | (r_relative?  RELOC_STD_BITS_RELATIVE_BIG: 0)
    2087             | (r_length <<  RELOC_STD_BITS_LENGTH_SH_BIG);
    2088     } else {
    2089         natptr->r_index[2] = r_index >> 16;
    2090         natptr->r_index[1] = r_index >> 8;
    2091         natptr->r_index[0] = r_index;
    2092         natptr->r_type[0] =
    2093          (r_extern?    RELOC_STD_BITS_EXTERN_LITTLE: 0)
    2094           | (r_pcrel?     RELOC_STD_BITS_PCREL_LITTLE: 0)
    2095            | (r_baserel?   RELOC_STD_BITS_BASEREL_LITTLE: 0)
    2096             | (r_jmptable?  RELOC_STD_BITS_JMPTABLE_LITTLE: 0)
    2097              | (r_relative?  RELOC_STD_BITS_RELATIVE_LITTLE: 0)
    2098               | (r_length <<  RELOC_STD_BITS_LENGTH_SH_LITTLE);
    2099       }
    2100 }
    2101 
    2102 /* Extended stuff */
     2126      natptr->r_type[0] = ((r_extern ? RELOC_STD_BITS_EXTERN_BIG : 0)
     2127                           | (r_pcrel ? RELOC_STD_BITS_PCREL_BIG : 0)
     2128                           | (r_baserel ? RELOC_STD_BITS_BASEREL_BIG : 0)
     2129                           | (r_jmptable ? RELOC_STD_BITS_JMPTABLE_BIG : 0)
     2130                           | (r_relative ? RELOC_STD_BITS_RELATIVE_BIG : 0)
     2131                           | (r_length << RELOC_STD_BITS_LENGTH_SH_BIG));
     2132    }
     2133  else
     2134    {
     2135      natptr->r_index[2] = r_index >> 16;
     2136      natptr->r_index[1] = r_index >> 8;
     2137      natptr->r_index[0] = r_index;
     2138      natptr->r_type[0] = ((r_extern ? RELOC_STD_BITS_EXTERN_LITTLE : 0)
     2139                           | (r_pcrel ? RELOC_STD_BITS_PCREL_LITTLE : 0)
     2140                           | (r_baserel ? RELOC_STD_BITS_BASEREL_LITTLE : 0)
     2141                           | (r_jmptable ? RELOC_STD_BITS_JMPTABLE_LITTLE : 0)
     2142                           | (r_relative ? RELOC_STD_BITS_RELATIVE_LITTLE : 0)
     2143                           | (r_length << RELOC_STD_BITS_LENGTH_SH_LITTLE));
     2144    }
     2145}
     2146
     2147/* Extended stuff. */
    21032148/* Output extended relocation information to a file in target byte order.  */
    21042149
     
    21152160  int r_extern;
    21162161  unsigned int r_type;
    2117   unsigned int r_addend;
     2162  bfd_vma r_addend;
    21182163  asymbol *sym = *(g->sym_ptr_ptr);
    21192164  asection *output_section = sym->section->output_section;
     
    21332178     from the abs section, or as a symbol which has an abs value.
    21342179     check for that here.  */
    2135 
    21362180  if (bfd_is_abs_section (bfd_get_section (sym)))
    21372181    {
     
    21502194  else
    21512195    {
    2152       /* Just an ordinary section */
     2196      /* Just an ordinary section. */
    21532197      r_extern = 0;
    21542198      r_index = output_section->target_index;
    21552199    }
    21562200
    2157   /* now the fun stuff */
    2158   if (bfd_header_big_endian (abfd)) {
    2159     natptr->r_index[0] = r_index >> 16;
    2160     natptr->r_index[1] = r_index >> 8;
    2161     natptr->r_index[2] = r_index;
    2162     natptr->r_type[0] =
    2163       ((r_extern? RELOC_EXT_BITS_EXTERN_BIG: 0)
    2164        | (r_type << RELOC_EXT_BITS_TYPE_SH_BIG));
    2165   } else {
    2166     natptr->r_index[2] = r_index >> 16;
    2167     natptr->r_index[1] = r_index >> 8;
    2168     natptr->r_index[0] = r_index;
    2169     natptr->r_type[0] =
    2170      (r_extern? RELOC_EXT_BITS_EXTERN_LITTLE: 0)
    2171       | (r_type << RELOC_EXT_BITS_TYPE_SH_LITTLE);
    2172   }
     2201  /* Now the fun stuff.  */
     2202  if (bfd_header_big_endian (abfd))
     2203    {
     2204      natptr->r_index[0] = r_index >> 16;
     2205      natptr->r_index[1] = r_index >> 8;
     2206      natptr->r_index[2] = r_index;
     2207      natptr->r_type[0] = ((r_extern ? RELOC_EXT_BITS_EXTERN_BIG : 0)
     2208                           | (r_type << RELOC_EXT_BITS_TYPE_SH_BIG));
     2209    }
     2210  else
     2211    {
     2212      natptr->r_index[2] = r_index >> 16;
     2213      natptr->r_index[1] = r_index >> 8;
     2214      natptr->r_index[0] = r_index;
     2215      natptr->r_type[0] = ((r_extern ? RELOC_EXT_BITS_EXTERN_LITTLE : 0)
     2216                           | (r_type << RELOC_EXT_BITS_TYPE_SH_LITTLE));
     2217    }
    21732218
    21742219  PUT_WORD (abfd, r_addend, natptr->r_addend);
     
    21812226   Aout keeps all it's symbols based from zero, so the symbol would
    21822227   contain 60. This macro subs the base of each section from the value
    2183    to give the true offset from the section */
    2184 
    2185 #define MOVE_ADDRESS(ad)                                                \
    2186   if (r_extern) {                                                       \
    2187    /* undefined symbol */                                               \
    2188      cache_ptr->sym_ptr_ptr = symbols + r_index;                        \
    2189      cache_ptr->addend = ad;                                            \
    2190      } else {                                                           \
    2191     /* defined, section relative. replace symbol with pointer to        \
    2192        symbol which points to section  */                               \
    2193     switch (r_index) {                                                  \
    2194     case N_TEXT:                                                        \
    2195     case N_TEXT | N_EXT:                                                \
    2196       cache_ptr->sym_ptr_ptr  = obj_textsec(abfd)->symbol_ptr_ptr;      \
    2197       cache_ptr->addend = ad  - su->textsec->vma;                       \
    2198       break;                                                            \
    2199     case N_DATA:                                                        \
    2200     case N_DATA | N_EXT:                                                \
    2201       cache_ptr->sym_ptr_ptr  = obj_datasec(abfd)->symbol_ptr_ptr;      \
    2202       cache_ptr->addend = ad - su->datasec->vma;                        \
    2203       break;                                                            \
    2204     case N_BSS:                                                         \
    2205     case N_BSS | N_EXT:                                                 \
    2206       cache_ptr->sym_ptr_ptr  = obj_bsssec(abfd)->symbol_ptr_ptr;       \
    2207       cache_ptr->addend = ad - su->bsssec->vma;                         \
    2208       break;                                                            \
    2209     default:                                                            \
    2210     case N_ABS:                                                         \
    2211     case N_ABS | N_EXT:                                                 \
    2212      cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;      \
     2228   to give the true offset from the section.  */
     2229
     2230#define MOVE_ADDRESS(ad)                                                \
     2231  if (r_extern)                                                         \
     2232    {                                                                   \
     2233      /* Undefined symbol.  */                                          \
     2234      cache_ptr->sym_ptr_ptr = symbols + r_index;                       \
    22132235      cache_ptr->addend = ad;                                           \
    2214       break;                                                            \
    22152236    }                                                                   \
    2216   }                                                                     \
     2237   else                                                                 \
     2238    {                                                                   \
     2239      /* Defined, section relative.  Replace symbol with pointer to     \
     2240         symbol which points to section.  */                            \
     2241      switch (r_index)                                                  \
     2242        {                                                               \
     2243        case N_TEXT:                                                    \
     2244        case N_TEXT | N_EXT:                                            \
     2245          cache_ptr->sym_ptr_ptr = obj_textsec (abfd)->symbol_ptr_ptr;  \
     2246          cache_ptr->addend = ad - su->textsec->vma;                    \
     2247          break;                                                        \
     2248        case N_DATA:                                                    \
     2249        case N_DATA | N_EXT:                                            \
     2250          cache_ptr->sym_ptr_ptr = obj_datasec (abfd)->symbol_ptr_ptr;  \
     2251          cache_ptr->addend = ad - su->datasec->vma;                    \
     2252          break;                                                        \
     2253        case N_BSS:                                                     \
     2254        case N_BSS | N_EXT:                                             \
     2255          cache_ptr->sym_ptr_ptr = obj_bsssec (abfd)->symbol_ptr_ptr;   \
     2256          cache_ptr->addend = ad - su->bsssec->vma;                     \
     2257          break;                                                        \
     2258        default:                                                        \
     2259        case N_ABS:                                                     \
     2260        case N_ABS | N_EXT:                                             \
     2261          cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; \
     2262          cache_ptr->addend = ad;                                       \
     2263          break;                                                        \
     2264        }                                                               \
     2265    }
    22172266
    22182267void
     
    22312280  cache_ptr->address = (GET_SWORD (abfd, bytes->r_address));
    22322281
    2233   /* now the fun stuff */
    2234   if (bfd_header_big_endian (abfd)) {
    2235     r_index =  (bytes->r_index[0] << 16)
    2236              | (bytes->r_index[1] << 8)
    2237              |  bytes->r_index[2];
    2238     r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_BIG));
    2239     r_type   =       (bytes->r_type[0] & RELOC_EXT_BITS_TYPE_BIG)
    2240                                       >> RELOC_EXT_BITS_TYPE_SH_BIG;
    2241   } else {
    2242     r_index =  (bytes->r_index[2] << 16)
    2243              | (bytes->r_index[1] << 8)
    2244              |  bytes->r_index[0];
    2245     r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_LITTLE));
    2246     r_type   =       (bytes->r_type[0] & RELOC_EXT_BITS_TYPE_LITTLE)
    2247                                       >> RELOC_EXT_BITS_TYPE_SH_LITTLE;
    2248   }
     2282  /* Now the fun stuff.  */
     2283  if (bfd_header_big_endian (abfd))
     2284    {
     2285      r_index = (((unsigned int) bytes->r_index[0] << 16)
     2286                 | ((unsigned int) bytes->r_index[1] << 8)
     2287                 | bytes->r_index[2]);
     2288      r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_BIG));
     2289      r_type = ((bytes->r_type[0] & RELOC_EXT_BITS_TYPE_BIG)
     2290                >> RELOC_EXT_BITS_TYPE_SH_BIG);
     2291    }
     2292  else
     2293    {
     2294      r_index =  (((unsigned int) bytes->r_index[2] << 16)
     2295                  | ((unsigned int) bytes->r_index[1] << 8)
     2296                  | bytes->r_index[0]);
     2297      r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_LITTLE));
     2298      r_type = ((bytes->r_type[0] & RELOC_EXT_BITS_TYPE_LITTLE)
     2299                >> RELOC_EXT_BITS_TYPE_SH_LITTLE);
     2300    }
    22492301
    22502302  cache_ptr->howto =  howto_table_ext + r_type;
     
    22532305     regardless of the setting of r_extern.  r_extern just reflects
    22542306     whether the symbol the reloc is against is local or global.  */
    2255   if (r_type == RELOC_BASE10
    2256       || r_type == RELOC_BASE13
    2257       || r_type == RELOC_BASE22)
     2307  if (r_type == (unsigned int) RELOC_BASE10
     2308      || r_type == (unsigned int) RELOC_BASE13
     2309      || r_type == (unsigned int) RELOC_BASE22)
    22582310    r_extern = 1;
    22592311
     
    22662318    }
    22672319
    2268   MOVE_ADDRESS(GET_SWORD(abfd, bytes->r_addend));
     2320  MOVE_ADDRESS (GET_SWORD (abfd, bytes->r_addend));
    22692321}
    22702322
     
    22852337  unsigned int howto_idx;
    22862338
    2287   cache_ptr->address = bfd_h_get_32 (abfd, bytes->r_address);
    2288 
    2289   /* now the fun stuff */
    2290   if (bfd_header_big_endian (abfd)) {
    2291     r_index =  (bytes->r_index[0] << 16)
    2292       | (bytes->r_index[1] << 8)
    2293         |  bytes->r_index[2];
    2294     r_extern  = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_BIG));
    2295     r_pcrel   = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_BIG));
    2296     r_baserel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_BASEREL_BIG));
    2297     r_jmptable= (0 != (bytes->r_type[0] & RELOC_STD_BITS_JMPTABLE_BIG));
    2298     r_relative= (0 != (bytes->r_type[0] & RELOC_STD_BITS_RELATIVE_BIG));
    2299     r_length  =       (bytes->r_type[0] & RELOC_STD_BITS_LENGTH_BIG)
    2300                         >> RELOC_STD_BITS_LENGTH_SH_BIG;
    2301   } else {
    2302     r_index =  (bytes->r_index[2] << 16)
    2303       | (bytes->r_index[1] << 8)
    2304         |  bytes->r_index[0];
    2305     r_extern  = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE));
    2306     r_pcrel   = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE));
    2307     r_baserel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_BASEREL_LITTLE));
    2308     r_jmptable= (0 != (bytes->r_type[0] & RELOC_STD_BITS_JMPTABLE_LITTLE));
    2309     r_relative= (0 != (bytes->r_type[0] & RELOC_STD_BITS_RELATIVE_LITTLE));
    2310     r_length  =       (bytes->r_type[0] & RELOC_STD_BITS_LENGTH_LITTLE)
    2311                         >> RELOC_STD_BITS_LENGTH_SH_LITTLE;
    2312   }
    2313 
    2314   howto_idx = r_length + 4 * r_pcrel + 8 * r_baserel
    2315               + 16 * r_jmptable + 32 * r_relative;
     2339  cache_ptr->address = H_GET_32 (abfd, bytes->r_address);
     2340
     2341  /* Now the fun stuff.  */
     2342  if (bfd_header_big_endian (abfd))
     2343    {
     2344      r_index = (((unsigned int) bytes->r_index[0] << 16)
     2345                 | ((unsigned int) bytes->r_index[1] << 8)
     2346                 | bytes->r_index[2]);
     2347      r_extern  = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_BIG));
     2348      r_pcrel   = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_BIG));
     2349      r_baserel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_BASEREL_BIG));
     2350      r_jmptable= (0 != (bytes->r_type[0] & RELOC_STD_BITS_JMPTABLE_BIG));
     2351      r_relative= (0 != (bytes->r_type[0] & RELOC_STD_BITS_RELATIVE_BIG));
     2352      r_length  = ((bytes->r_type[0] & RELOC_STD_BITS_LENGTH_BIG)
     2353                   >> RELOC_STD_BITS_LENGTH_SH_BIG);
     2354    }
     2355  else
     2356    {
     2357      r_index = (((unsigned int) bytes->r_index[2] << 16)
     2358                 | ((unsigned int) bytes->r_index[1] << 8)
     2359                 | bytes->r_index[0]);
     2360      r_extern  = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE));
     2361      r_pcrel   = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE));
     2362      r_baserel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_BASEREL_LITTLE));
     2363      r_jmptable= (0 != (bytes->r_type[0] & RELOC_STD_BITS_JMPTABLE_LITTLE));
     2364      r_relative= (0 != (bytes->r_type[0] & RELOC_STD_BITS_RELATIVE_LITTLE));
     2365      r_length  = ((bytes->r_type[0] & RELOC_STD_BITS_LENGTH_LITTLE)
     2366                   >> RELOC_STD_BITS_LENGTH_SH_LITTLE);
     2367    }
     2368
     2369  howto_idx = (r_length + 4 * r_pcrel + 8 * r_baserel
     2370               + 16 * r_jmptable + 32 * r_relative);
    23162371  BFD_ASSERT (howto_idx < TABLE_SIZE (howto_table_std));
    23172372  cache_ptr->howto =  howto_table_std + howto_idx;
     
    23322387    }
    23332388
    2334   MOVE_ADDRESS(0);
     2389  MOVE_ADDRESS (0);
    23352390}
    23362391
    23372392/* Read and swap the relocs for a section.  */
    23382393
    2339 boolean
     2394bfd_boolean
    23402395NAME(aout,slurp_reloc_table) (abfd, asect, symbols)
    23412396     bfd *abfd;
     
    23432398     asymbol **symbols;
    23442399{
    2345   unsigned int count;
     2400  bfd_size_type count;
    23462401  bfd_size_type reloc_size;
    23472402  PTR relocs;
     
    23502405  unsigned int counter = 0;
    23512406  arelent *cache_ptr;
     2407  bfd_size_type amt;
    23522408
    23532409  if (asect->relocation)
    2354     return true;
     2410    return TRUE;
    23552411
    23562412  if (asect->flags & SEC_CONSTRUCTOR)
    2357     return true;
     2413    return TRUE;
    23582414
    23592415  if (asect == obj_datasec (abfd))
    2360     reloc_size = exec_hdr(abfd)->a_drsize;
     2416    reloc_size = exec_hdr (abfd)->a_drsize;
    23612417  else if (asect == obj_textsec (abfd))
    2362     reloc_size = exec_hdr(abfd)->a_trsize;
     2418    reloc_size = exec_hdr (abfd)->a_trsize;
    23632419  else if (asect == obj_bsssec (abfd))
    23642420    reloc_size = 0;
     
    23662422    {
    23672423      bfd_set_error (bfd_error_invalid_operation);
    2368       return false;
     2424      return FALSE;
    23692425    }
    23702426
    23712427  if (bfd_seek (abfd, asect->rel_filepos, SEEK_SET) != 0)
    2372     return false;
     2428    return FALSE;
    23732429
    23742430  each_size = obj_reloc_entry_size (abfd);
     
    23762432  count = reloc_size / each_size;
    23772433
    2378   reloc_cache = (arelent *) bfd_malloc ((size_t) (count * sizeof (arelent)));
     2434  amt = count * sizeof (arelent);
     2435  reloc_cache = (arelent *) bfd_zmalloc (amt);
    23792436  if (reloc_cache == NULL && count != 0)
    2380     return false;
    2381   memset (reloc_cache, 0, count * sizeof (arelent));
    2382 
    2383   relocs = bfd_malloc ((size_t) reloc_size);
     2437    return FALSE;
     2438
     2439  relocs = bfd_malloc (reloc_size);
    23842440  if (relocs == NULL && reloc_size != 0)
    23852441    {
    23862442      free (reloc_cache);
    2387       return false;
    2388     }
    2389 
    2390   if (bfd_read (relocs, 1, reloc_size, abfd) != reloc_size)
     2443      return FALSE;
     2444    }
     2445
     2446  if (bfd_bread (relocs, reloc_size, abfd) != reloc_size)
    23912447    {
    23922448      free (relocs);
    23932449      free (reloc_cache);
    2394       return false;
     2450      return FALSE;
    23952451    }
    23962452
     
    23982454  if (each_size == RELOC_EXT_SIZE)
    23992455    {
    2400       register struct reloc_ext_external *rptr =
    2401         (struct reloc_ext_external *) relocs;
     2456      struct reloc_ext_external *rptr = (struct reloc_ext_external *) relocs;
    24022457
    24032458      for (; counter < count; counter++, rptr++, cache_ptr++)
    24042459        MY_swap_ext_reloc_in (abfd, rptr, cache_ptr, symbols,
    2405                               bfd_get_symcount (abfd));
     2460                              (bfd_size_type) bfd_get_symcount (abfd));
    24062461    }
    24072462  else
    24082463    {
    2409       register struct reloc_std_external *rptr =
    2410         (struct reloc_std_external *) relocs;
     2464      struct reloc_std_external *rptr = (struct reloc_std_external *) relocs;
    24112465
    24122466      for (; counter < count; counter++, rptr++, cache_ptr++)
    24132467        MY_swap_std_reloc_in (abfd, rptr, cache_ptr, symbols,
    2414                               bfd_get_symcount (abfd));
     2468                              (bfd_size_type) bfd_get_symcount (abfd));
    24152469    }
    24162470
     
    24202474  asect->reloc_count = cache_ptr - reloc_cache;
    24212475
    2422   return true;
     2476  return TRUE;
    24232477}
    24242478
    24252479/* Write out a relocation section into an object file.  */
    24262480
    2427 boolean
     2481bfd_boolean
    24282482NAME(aout,squirt_out_relocs) (abfd, section)
    24292483     bfd *abfd;
     
    24352489
    24362490  unsigned int count = section->reloc_count;
    2437   size_t natsize;
     2491  bfd_size_type natsize;
    24382492
    24392493  if (count == 0 || section->orelocation == NULL)
    2440     return true;
     2494    return TRUE;
    24412495
    24422496  each_size = obj_reloc_entry_size (abfd);
    2443   natsize = each_size * count;
     2497  natsize = (bfd_size_type) each_size * count;
    24442498  native = (unsigned char *) bfd_zalloc (abfd, natsize);
    24452499  if (!native)
    2446     return false;
     2500    return FALSE;
    24472501
    24482502  generic = section->orelocation;
     
    24612515           count != 0;
    24622516           --count, natptr += each_size, ++generic)
    2463         MY_swap_std_reloc_out(abfd, *generic, (struct reloc_std_external *)natptr);
    2464     }
    2465 
    2466   if ( bfd_write ((PTR) native, 1, natsize, abfd) != natsize) {
    2467     bfd_release(abfd, native);
    2468     return false;
    2469   }
     2517        MY_swap_std_reloc_out (abfd, *generic,
     2518                               (struct reloc_std_external *) natptr);
     2519    }
     2520
     2521  if (bfd_bwrite ((PTR) native, natsize, abfd) != natsize)
     2522    {
     2523      bfd_release (abfd, native);
     2524      return FALSE;
     2525    }
    24702526  bfd_release (abfd, native);
    24712527
    2472   return true;
    2473 }
    2474 
    2475 /* This is stupid.  This function should be a boolean predicate */
     2528  return TRUE;
     2529}
     2530
     2531/* This is stupid.  This function should be a boolean predicate.  */
     2532
    24762533long
    24772534NAME(aout,canonicalize_reloc) (abfd, section, relptr, symbols)
     
    24932550    return -1;
    24942551
    2495   if (section->flags & SEC_CONSTRUCTOR) {
    2496     arelent_chain *chain = section->constructor_chain;
    2497     for (count = 0; count < section->reloc_count; count ++) {
    2498       *relptr ++ = &chain->relent;
    2499       chain = chain->next;
    2500     }
    2501   }
    2502   else {
    2503     tblptr = section->relocation;
    2504 
    2505     for (count = 0; count++ < section->reloc_count;)
    2506       {
    2507         *relptr++ = tblptr++;
    2508       }
    2509   }
     2552  if (section->flags & SEC_CONSTRUCTOR)
     2553    {
     2554      arelent_chain *chain = section->constructor_chain;
     2555      for (count = 0; count < section->reloc_count; count ++)
     2556        {
     2557          *relptr ++ = &chain->relent;
     2558          chain = chain->next;
     2559        }
     2560    }
     2561  else
     2562    {
     2563      tblptr = section->relocation;
     2564
     2565      for (count = 0; count++ < section->reloc_count; )
     2566        {
     2567          *relptr++ = tblptr++;
     2568        }
     2569    }
    25102570  *relptr = 0;
    25112571
     
    25182578     sec_ptr asect;
    25192579{
    2520   if (bfd_get_format (abfd) != bfd_object) {
    2521     bfd_set_error (bfd_error_invalid_operation);
    2522     return -1;
    2523   }
    2524   if (asect->flags & SEC_CONSTRUCTOR) {
     2580  if (bfd_get_format (abfd) != bfd_object)
     2581    {
     2582      bfd_set_error (bfd_error_invalid_operation);
     2583      return -1;
     2584    }
     2585
     2586  if (asect->flags & SEC_CONSTRUCTOR)
    25252587    return (sizeof (arelent *) * (asect->reloc_count+1));
    2526   }
    25272588
    25282589  if (asect == obj_datasec (abfd))
    25292590    return (sizeof (arelent *)
    2530             * ((exec_hdr(abfd)->a_drsize / obj_reloc_entry_size (abfd))
     2591            * ((exec_hdr (abfd)->a_drsize / obj_reloc_entry_size (abfd))
    25312592               + 1));
    25322593
    25332594  if (asect == obj_textsec (abfd))
    25342595    return (sizeof (arelent *)
    2535             * ((exec_hdr(abfd)->a_trsize / obj_reloc_entry_size (abfd))
     2596            * ((exec_hdr (abfd)->a_trsize / obj_reloc_entry_size (abfd))
    25362597               + 1));
    25372598
     
    25572618}
    25582619
    2559  alent *
     2620alent *
    25602621NAME(aout,get_lineno) (ignore_abfd, ignore_symbol)
    25612622     bfd *ignore_abfd ATTRIBUTE_UNUSED;
     
    25752636  if (ret->type == '?')
    25762637    {
    2577       int type_code = aout_symbol(symbol)->type & 0xff;
     2638      int type_code = aout_symbol (symbol)->type & 0xff;
    25782639      const char *stab_name = bfd_get_stab_name (type_code);
    25792640      static char buf[10];
     
    25862647      ret->type = '-';
    25872648      ret->stab_type = type_code;
    2588       ret->stab_other = (unsigned) (aout_symbol(symbol)->other & 0xff);
    2589       ret->stab_desc = (unsigned) (aout_symbol(symbol)->desc & 0xffff);
     2649      ret->stab_other = (unsigned) (aout_symbol (symbol)->other & 0xff);
     2650      ret->stab_desc = (unsigned) (aout_symbol (symbol)->desc & 0xffff);
    25902651      ret->stab_name = stab_name;
    25912652    }
     
    25932654
    25942655void
    2595 NAME(aout,print_symbol) (ignore_abfd, afile, symbol, how)
    2596      bfd *ignore_abfd ATTRIBUTE_UNUSED;
     2656NAME(aout,print_symbol) (abfd, afile, symbol, how)
     2657     bfd *abfd;
    25972658     PTR afile;
    25982659     asymbol *symbol;
     
    26012662  FILE *file = (FILE *)afile;
    26022663
    2603   switch (how) {
    2604   case bfd_print_symbol_name:
    2605     if (symbol->name)
    2606       fprintf (file,"%s", symbol->name);
    2607     break;
    2608   case bfd_print_symbol_more:
    2609     fprintf (file,"%4x %2x %2x",(unsigned) (aout_symbol(symbol)->desc & 0xffff),
    2610             (unsigned) (aout_symbol(symbol)->other & 0xff),
    2611             (unsigned) (aout_symbol(symbol)->type));
    2612     break;
    2613   case bfd_print_symbol_all:
    2614     {
    2615    CONST char *section_name = symbol->section->name;
    2616 
    2617       bfd_print_symbol_vandf((PTR)file,symbol);
    2618 
    2619       fprintf (file," %-5s %04x %02x %02x",
    2620               section_name,
    2621               (unsigned) (aout_symbol(symbol)->desc & 0xffff),
    2622               (unsigned) (aout_symbol(symbol)->other & 0xff),
    2623               (unsigned) (aout_symbol(symbol)->type  & 0xff));
     2664  switch (how)
     2665    {
     2666    case bfd_print_symbol_name:
    26242667      if (symbol->name)
    2625         fprintf (file," %s", symbol->name);
    2626     }
    2627     break;
    2628   }
     2668        fprintf (file,"%s", symbol->name);
     2669      break;
     2670    case bfd_print_symbol_more:
     2671      fprintf (file,"%4x %2x %2x",
     2672               (unsigned) (aout_symbol (symbol)->desc & 0xffff),
     2673               (unsigned) (aout_symbol (symbol)->other & 0xff),
     2674               (unsigned) (aout_symbol (symbol)->type));
     2675      break;
     2676    case bfd_print_symbol_all:
     2677      {
     2678        const char *section_name = symbol->section->name;
     2679
     2680        bfd_print_symbol_vandf (abfd, (PTR)file, symbol);
     2681
     2682        fprintf (file," %-5s %04x %02x %02x",
     2683                 section_name,
     2684                 (unsigned) (aout_symbol (symbol)->desc & 0xffff),
     2685                 (unsigned) (aout_symbol (symbol)->other & 0xff),
     2686                 (unsigned) (aout_symbol (symbol)->type & 0xff));
     2687        if (symbol->name)
     2688          fprintf (file," %s", symbol->name);
     2689      }
     2690      break;
     2691    }
    26292692}
    26302693
     
    26412704NAME(aout,read_minisymbols) (abfd, dynamic, minisymsp, sizep)
    26422705     bfd *abfd;
    2643      boolean dynamic;
     2706     bfd_boolean dynamic;
    26442707     PTR *minisymsp;
    26452708     unsigned int *sizep;
     
    26772740NAME(aout,minisymbol_to_symbol) (abfd, dynamic, minisym, sym)
    26782741     bfd *abfd;
    2679      boolean dynamic;
     2742     bfd_boolean dynamic;
    26802743     const PTR minisym;
    26812744     asymbol *sym;
     
    26952758          obj_aout_external_strings (abfd),
    26962759          obj_aout_external_string_size (abfd),
    2697           false)))
     2760          FALSE)))
    26982761    return NULL;
    26992762
     
    27012764}
    27022765
    2703 /*
    2704  provided a BFD, a section and an offset into the section, calculate
    2705  and return the name of the source file and the line nearest to the
    2706  wanted location.
    2707 */
    2708 
    2709 boolean
     2766/* Provided a BFD, a section and an offset into the section, calculate
     2767   and return the name of the source file and the line nearest to the
     2768   wanted location.  */
     2769
     2770bfd_boolean
    27102771NAME(aout,find_nearest_line)
    27112772     (abfd, section, symbols, offset, filename_ptr, functionname_ptr, line_ptr)
     
    27142775     asymbol **symbols;
    27152776     bfd_vma offset;
    2716      CONST char **filename_ptr;
    2717      CONST char **functionname_ptr;
     2777     const char **filename_ptr;
     2778     const char **functionname_ptr;
    27182779     unsigned int *line_ptr;
    27192780{
    2720   /* Run down the file looking for the filename, function and linenumber */
     2781  /* Run down the file looking for the filename, function and linenumber. */
    27212782  asymbol **p;
    2722   CONST char *directory_name = NULL;
    2723   CONST char *main_file_name = NULL;
    2724   CONST char *current_file_name = NULL;
    2725   CONST char *line_file_name = NULL; /* Value of current_file_name at line number.  */
    2726   CONST char *line_directory_name = NULL; /* Value of directory_name at line number.  */
     2783  const char *directory_name = NULL;
     2784  const char *main_file_name = NULL;
     2785  const char *current_file_name = NULL;
     2786  const char *line_file_name = NULL; /* Value of current_file_name at line number.  */
     2787  const char *line_directory_name = NULL; /* Value of directory_name at line number.  */
    27272788  bfd_vma low_line_vma = 0;
    27282789  bfd_vma low_func_vma = 0;
    27292790  asymbol *func = 0;
    2730   size_t filelen, funclen;
     2791  bfd_size_type filelen, funclen;
    27312792  char *buf;
    27322793
     
    27342795  *functionname_ptr = 0;
    27352796  *line_ptr = 0;
    2736   if (symbols != (asymbol **)NULL) {
    2737     for (p = symbols; *p; p++) {
    2738       aout_symbol_type  *q = (aout_symbol_type *) (*p);
    2739     next:
    2740       switch (q->type){
    2741       case N_TEXT:
    2742         /* If this looks like a file name symbol, and it comes after
    2743            the line number we have found so far, but before the
    2744            offset, then we have probably not found the right line
    2745            number.  */
    2746         if (q->symbol.value <= offset
    2747             && ((q->symbol.value > low_line_vma
    2748                  && (line_file_name != NULL
    2749                      || *line_ptr != 0))
    2750                 || (q->symbol.value > low_func_vma
    2751                     && func != NULL)))
    2752           {
    2753             const char *symname;
    2754 
    2755             symname = q->symbol.name;
    2756             if (strcmp (symname + strlen (symname) - 2, ".o") == 0)
     2797
     2798  if (symbols != (asymbol **)NULL)
     2799    {
     2800      for (p = symbols; *p; p++)
     2801        {
     2802          aout_symbol_type  *q = (aout_symbol_type *) (*p);
     2803        next:
     2804          switch (q->type)
     2805            {
     2806            case N_TEXT:
     2807              /* If this looks like a file name symbol, and it comes after
     2808                 the line number we have found so far, but before the
     2809                 offset, then we have probably not found the right line
     2810                 number.  */
     2811              if (q->symbol.value <= offset
     2812                  && ((q->symbol.value > low_line_vma
     2813                       && (line_file_name != NULL
     2814                           || *line_ptr != 0))
     2815                      || (q->symbol.value > low_func_vma
     2816                          && func != NULL)))
     2817                {
     2818                  const char *symname;
     2819
     2820                  symname = q->symbol.name;
     2821                  if (strcmp (symname + strlen (symname) - 2, ".o") == 0)
     2822                    {
     2823                      if (q->symbol.value > low_line_vma)
     2824                        {
     2825                          *line_ptr = 0;
     2826                          line_file_name = NULL;
     2827                        }
     2828                      if (q->symbol.value > low_func_vma)
     2829                        func = NULL;
     2830                    }
     2831                }
     2832              break;
     2833
     2834            case N_SO:
     2835              /* If this symbol is less than the offset, but greater than
     2836                 the line number we have found so far, then we have not
     2837                 found the right line number.  */
     2838              if (q->symbol.value <= offset)
     2839                {
     2840                  if (q->symbol.value > low_line_vma)
     2841                    {
     2842                      *line_ptr = 0;
     2843                      line_file_name = NULL;
     2844                    }
     2845                  if (q->symbol.value > low_func_vma)
     2846                    func = NULL;
     2847                }
     2848
     2849              main_file_name = current_file_name = q->symbol.name;
     2850              /* Look ahead to next symbol to check if that too is an N_SO.  */
     2851              p++;
     2852              if (*p == NULL)
     2853                break;
     2854              q = (aout_symbol_type *) (*p);
     2855              if (q->type != (int)N_SO)
     2856                goto next;
     2857
     2858              /* Found a second N_SO  First is directory; second is filename.  */
     2859              directory_name = current_file_name;
     2860              main_file_name = current_file_name = q->symbol.name;
     2861              if (obj_textsec (abfd) != section)
     2862                goto done;
     2863              break;
     2864            case N_SOL:
     2865              current_file_name = q->symbol.name;
     2866              break;
     2867
     2868            case N_SLINE:
     2869
     2870            case N_DSLINE:
     2871            case N_BSLINE:
     2872              /* We'll keep this if it resolves nearer than the one we have
     2873                 already.  */
     2874              if (q->symbol.value >= low_line_vma
     2875                  && q->symbol.value <= offset)
     2876                {
     2877                  *line_ptr = q->desc;
     2878                  low_line_vma = q->symbol.value;
     2879                  line_file_name = current_file_name;
     2880                  line_directory_name = directory_name;
     2881                }
     2882              break;
     2883            case N_FUN:
    27572884              {
    2758                 if (q->symbol.value > low_line_vma)
     2885                /* We'll keep this if it is nearer than the one we have already.  */
     2886                if (q->symbol.value >= low_func_vma &&
     2887                    q->symbol.value <= offset)
    27592888                  {
    2760                     *line_ptr = 0;
    2761                     line_file_name = NULL;
     2889                    low_func_vma = q->symbol.value;
     2890                    func = (asymbol *)q;
    27622891                  }
    2763                 if (q->symbol.value > low_func_vma)
    2764                   func = NULL;
     2892                else if (q->symbol.value > offset)
     2893                  goto done;
    27652894              }
    2766           }
    2767         break;
    2768 
    2769       case N_SO:
    2770         /* If this symbol is less than the offset, but greater than
    2771            the line number we have found so far, then we have not
    2772            found the right line number.  */
    2773         if (q->symbol.value <= offset)
    2774           {
    2775             if (q->symbol.value > low_line_vma)
    2776               {
    2777                 *line_ptr = 0;
    2778                 line_file_name = NULL;
    2779               }
    2780             if (q->symbol.value > low_func_vma)
    2781               func = NULL;
    2782           }
    2783 
    2784         main_file_name = current_file_name = q->symbol.name;
    2785         /* Look ahead to next symbol to check if that too is an N_SO.  */
    2786         p++;
    2787         if (*p == NULL)
    2788           break;
    2789         q = (aout_symbol_type *) (*p);
    2790         if (q->type != (int)N_SO)
    2791           goto next;
    2792 
    2793         /* Found a second N_SO  First is directory; second is filename.  */
    2794         directory_name = current_file_name;
    2795         main_file_name = current_file_name = q->symbol.name;
    2796         if (obj_textsec(abfd) != section)
    2797           goto done;
    2798         break;
    2799       case N_SOL:
    2800         current_file_name = q->symbol.name;
    2801         break;
    2802 
    2803       case N_SLINE:
    2804 
    2805       case N_DSLINE:
    2806       case N_BSLINE:
    2807         /* We'll keep this if it resolves nearer than the one we have
    2808            already.  */
    2809         if (q->symbol.value >= low_line_vma
    2810             && q->symbol.value <= offset)
    2811           {
    2812             *line_ptr = q->desc;
    2813             low_line_vma = q->symbol.value;
    2814             line_file_name = current_file_name;
    2815             line_directory_name = directory_name;
    2816           }
    2817         break;
    2818       case N_FUN:
    2819         {
    2820           /* We'll keep this if it is nearer than the one we have already */
    2821           if (q->symbol.value >= low_func_vma &&
    2822               q->symbol.value <= offset) {
    2823             low_func_vma = q->symbol.value;
    2824             func = (asymbol *)q;
    2825           }
    2826           else if (q->symbol.value > offset)
    2827             goto done;
     2895              break;
     2896            }
    28282897        }
    2829         break;
    2830       }
    2831     }
    2832   }
     2898    }
    28332899
    28342900 done:
     
    28452911  else
    28462912    filelen = strlen (directory_name) + strlen (main_file_name);
     2913
    28472914  if (func == NULL)
    28482915    funclen = 0;
     
    28522919  if (adata (abfd).line_buf != NULL)
    28532920    free (adata (abfd).line_buf);
     2921
    28542922  if (filelen + funclen == 0)
    28552923    adata (abfd).line_buf = buf = NULL;
     
    28592927      adata (abfd).line_buf = buf;
    28602928      if (buf == NULL)
    2861         return false;
     2929        return FALSE;
    28622930    }
    28632931
     
    28772945    {
    28782946      const char *function = func->name;
    2879       char *p;
     2947      char *colon;
    28802948
    28812949      /* The caller expects a symbol name.  We actually have a
     
    28892957          strcpy (buf + 1, function);
    28902958        }
    2891       /* Have to remove : stuff */
    2892       p = strchr (buf, ':');
    2893       if (p != NULL)
    2894         *p = '\0';
     2959      /* Have to remove : stuff. */
     2960      colon = strchr (buf, ':');
     2961      if (colon != NULL)
     2962        *colon = '\0';
    28952963      *functionname_ptr = buf;
    28962964    }
    28972965
    2898   return true;
     2966  return TRUE;
    28992967}
    29002968
     
    29022970NAME(aout,sizeof_headers) (abfd, execable)
    29032971     bfd *abfd;
    2904      boolean execable ATTRIBUTE_UNUSED;
    2905 {
    2906   return adata(abfd).exec_bytes_size;
     2972     bfd_boolean execable ATTRIBUTE_UNUSED;
     2973{
     2974  return adata (abfd).exec_bytes_size;
    29072975}
    29082976
     
    29102978   read it again later if we need it.  */
    29112979
    2912 boolean
     2980bfd_boolean
    29132981NAME(aout,bfd_free_cached_info) (abfd)
    29142982     bfd *abfd;
     
    29182986  if (bfd_get_format (abfd) != bfd_object
    29192987      || abfd->tdata.aout_data == NULL)
    2920     return true;
     2988    return TRUE;
    29212989
    29222990#define BFCI_FREE(x) if (x != NULL) { free (x); x = NULL; }
     
    29353003#undef BFCI_FREE
    29363004
    2937   return true;
     3005  return TRUE;
    29383006}
    29393007
     
    29413009/* a.out link code.  */
    29423010
    2943 static boolean aout_link_add_object_symbols
     3011static bfd_boolean aout_link_add_object_symbols
    29443012  PARAMS ((bfd *, struct bfd_link_info *));
    2945 static boolean aout_link_check_archive_element
    2946   PARAMS ((bfd *, struct bfd_link_info *, boolean *));
    2947 static boolean aout_link_free_symbols PARAMS ((bfd *));
    2948 static boolean aout_link_check_ar_symbols
    2949   PARAMS ((bfd *, struct bfd_link_info *, boolean *pneeded));
    2950 static boolean aout_link_add_symbols
     3013static bfd_boolean aout_link_check_archive_element
     3014  PARAMS ((bfd *, struct bfd_link_info *, bfd_boolean *));
     3015static bfd_boolean aout_link_free_symbols
     3016  PARAMS ((bfd *));
     3017static bfd_boolean aout_link_check_ar_symbols
     3018  PARAMS ((bfd *, struct bfd_link_info *, bfd_boolean *pneeded));
     3019static bfd_boolean aout_link_add_symbols
    29513020  PARAMS ((bfd *, struct bfd_link_info *));
    29523021
     
    29763045    {
    29773046      /* Set local fields.  */
    2978       ret->written = false;
     3047      ret->written = FALSE;
    29793048      ret->indx = -1;
    29803049    }
     
    29853054/* Initialize an a.out link hash table.  */
    29863055
    2987 boolean
     3056bfd_boolean
    29883057NAME(aout,link_hash_table_init) (table, abfd, newfunc)
    29893058     struct aout_link_hash_table *table;
    29903059     bfd *abfd;
    2991      struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *,
    2992                                                 struct bfd_hash_table *,
    2993                                                 const char *));
     3060     struct bfd_hash_entry *(*newfunc)
     3061       PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *,
     3062                const char *));
    29943063{
    29953064  return _bfd_link_hash_table_init (&table->root, abfd, newfunc);
     
    30033072{
    30043073  struct aout_link_hash_table *ret;
    3005 
    3006   ret = ((struct aout_link_hash_table *)
    3007          bfd_alloc (abfd, sizeof (struct aout_link_hash_table)));
     3074  bfd_size_type amt = sizeof (struct aout_link_hash_table);
     3075
     3076  ret = (struct aout_link_hash_table *) bfd_malloc (amt);
    30083077  if (ret == NULL)
    30093078    return (struct bfd_link_hash_table *) NULL;
     3079
    30103080  if (! NAME(aout,link_hash_table_init) (ret, abfd,
    30113081                                         NAME(aout,link_hash_newfunc)))
     
    30203090   appropriate.  */
    30213091
    3022 boolean
     3092bfd_boolean
    30233093NAME(aout,link_add_symbols) (abfd, info)
    30243094     bfd *abfd;
     
    30343104    default:
    30353105      bfd_set_error (bfd_error_wrong_format);
    3036       return false;
     3106      return FALSE;
    30373107    }
    30383108}
     
    30403110/* Add symbols from an a.out object file.  */
    30413111
    3042 static boolean
     3112static bfd_boolean
    30433113aout_link_add_object_symbols (abfd, info)
    30443114     bfd *abfd;
     
    30463116{
    30473117  if (! aout_get_external_symbols (abfd))
    3048     return false;
     3118    return FALSE;
    30493119  if (! aout_link_add_symbols (abfd, info))
    3050     return false;
     3120    return FALSE;
    30513121  if (! info->keep_memory)
    30523122    {
    30533123      if (! aout_link_free_symbols (abfd))
    3054         return false;
    3055     }
    3056   return true;
     3124        return FALSE;
     3125    }
     3126  return TRUE;
    30573127}
    30583128
     
    30623132   _bfd_generic_link_add_archive_symbols.  */
    30633133
    3064 static boolean
     3134static bfd_boolean
    30653135aout_link_check_archive_element (abfd, info, pneeded)
    30663136     bfd *abfd;
    30673137     struct bfd_link_info *info;
    3068      boolean *pneeded;
     3138     bfd_boolean *pneeded;
    30693139{
    30703140  if (! aout_get_external_symbols (abfd))
    3071     return false;
     3141    return FALSE;
    30723142
    30733143  if (! aout_link_check_ar_symbols (abfd, info, pneeded))
    3074     return false;
     3144    return FALSE;
    30753145
    30763146  if (*pneeded)
    30773147    {
    30783148      if (! aout_link_add_symbols (abfd, info))
    3079         return false;
     3149        return FALSE;
    30803150    }
    30813151
     
    30833153    {
    30843154      if (! aout_link_free_symbols (abfd))
    3085         return false;
    3086     }
    3087 
    3088   return true;
     3155        return FALSE;
     3156    }
     3157
     3158  return TRUE;
    30893159}
    30903160
    30913161/* Free up the internal symbols read from an a.out file.  */
    30923162
    3093 static boolean
     3163static bfd_boolean
    30943164aout_link_free_symbols (abfd)
    30953165     bfd *abfd;
     
    31133183      obj_aout_external_strings (abfd) = (char *) NULL;
    31143184    }
    3115   return true;
     3185  return TRUE;
    31163186}
    31173187
     
    31233193   (unless there is some other reason to include it).  */
    31243194
    3125 static boolean
     3195static bfd_boolean
    31263196aout_link_check_ar_symbols (abfd, info, pneeded)
    31273197     bfd *abfd;
    31283198     struct bfd_link_info *info;
    3129      boolean *pneeded;
     3199     bfd_boolean *pneeded;
    31303200{
    31313201  register struct external_nlist *p;
     
    31333203  char *strings;
    31343204
    3135   *pneeded = false;
     3205  *pneeded = FALSE;
    31363206
    31373207  /* Look through all the symbols.  */
     
    31413211  for (; p < pend; p++)
    31423212    {
    3143       int type = bfd_h_get_8 (abfd, p->e_type);
     3213      int type = H_GET_8 (abfd, p->e_type);
    31443214      const char *name;
    31453215      struct bfd_link_hash_entry *h;
     
    31633233
    31643234      name = strings + GET_WORD (abfd, p->e_strx);
    3165       h = bfd_link_hash_lookup (info->hash, name, false, false, true);
     3235      h = bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, TRUE);
    31663236
    31673237      /* We are only interested in symbols that are currently
     
    31843254          /* This object file defines this symbol.  We must link it
    31853255             in.  This is true regardless of whether the current
    3186              definition of the symbol is undefined or common.  If the
    3187              current definition is common, we have a case in which we
    3188              have already seen an object file including
     3256             definition of the symbol is undefined or common.
     3257
     3258             If the current definition is common, we have a case in
     3259             which we have already seen an object file including:
    31893260                 int a;
    3190              and this object file from the archive includes
     3261             and this object file from the archive includes:
    31913262                 int a = 5;
    3192              In such a case we must include this object file.
     3263             In such a case, whether to include this object is target
     3264             dependant for backward compatability.
    31933265
    31943266             FIXME: The SunOS 4.1.3 linker will pull in the archive
    31953267             element if the symbol is defined in the .data section,
    31963268             but not if it is defined in the .text section.  That
    3197              seems a bit crazy to me, and I haven't implemented it.
    3198              However, it might be correct.  */
     3269             seems a bit crazy to me, and it has not been implemented
     3270             yet.  However, it might be correct.  */
     3271          if (h->type == bfd_link_hash_common)
     3272            {
     3273              int skip = 0;
     3274
     3275              switch (info->common_skip_ar_aymbols)
     3276                {
     3277                case bfd_link_common_skip_text:
     3278                  skip = (type == (N_TEXT | N_EXT));
     3279                  break;
     3280                case bfd_link_common_skip_data:
     3281                  skip = (type == (N_DATA | N_EXT));
     3282                  break;
     3283                default:
     3284                case bfd_link_common_skip_all:
     3285                  skip = 1;
     3286                  break;
     3287                }
     3288
     3289              if (skip)
     3290                continue;
     3291            }
     3292
    31993293          if (! (*info->callbacks->add_archive_element) (info, abfd, name))
    3200             return false;
    3201           *pneeded = true;
    3202           return true;
     3294            return FALSE;
     3295          *pneeded = TRUE;
     3296          return TRUE;
    32033297        }
    32043298
     
    32273321                                                                     abfd,
    32283322                                                                     name))
    3229                         return false;
    3230                       *pneeded = true;
    3231                       return true;
     3323                        return FALSE;
     3324                      *pneeded = TRUE;
     3325                      return TRUE;
    32323326                    }
    32333327                  /* Turn the current link symbol into a common
     
    32383332                                  sizeof (struct bfd_link_hash_common_entry)));
    32393333                  if (h->u.c.p == NULL)
    3240                     return false;
     3334                    return FALSE;
    32413335
    32423336                  h->u.c.size = value;
     
    32753369            {
    32763370              if (! (*info->callbacks->add_archive_element) (info, abfd, name))
    3277                 return false;
    3278               *pneeded = true;
    3279               return true;
     3371                return FALSE;
     3372              *pneeded = TRUE;
     3373              return TRUE;
    32803374            }
    32813375        }
     
    32833377
    32843378  /* We do not need this object file.  */
    3285   return true;
     3379  return TRUE;
    32863380}
    32873381
    32883382/* Add all symbols from an object file to the hash table.  */
    32893383
    3290 static boolean
     3384static bfd_boolean
    32913385aout_link_add_symbols (abfd, info)
    32923386     bfd *abfd;
    32933387     struct bfd_link_info *info;
    32943388{
    3295   boolean (*add_one_symbol) PARAMS ((struct bfd_link_info *, bfd *,
    3296                                      const char *, flagword, asection *,
    3297                                      bfd_vma, const char *, boolean,
    3298                                      boolean,
    3299                                      struct bfd_link_hash_entry **));
     3389  bfd_boolean (*add_one_symbol)
     3390    PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, asection *,
     3391             bfd_vma, const char *, bfd_boolean, bfd_boolean,
     3392             struct bfd_link_hash_entry **));
    33003393  struct external_nlist *syms;
    33013394  bfd_size_type sym_count;
    33023395  char *strings;
    3303   boolean copy;
     3396  bfd_boolean copy;
    33043397  struct aout_link_hash_entry **sym_hash;
    33053398  register struct external_nlist *p;
    33063399  struct external_nlist *pend;
     3400  bfd_size_type amt;
    33073401
    33083402  syms = obj_aout_external_syms (abfd);
     
    33103404  strings = obj_aout_external_strings (abfd);
    33113405  if (info->keep_memory)
    3312     copy = false;
     3406    copy = FALSE;
    33133407  else
    3314     copy = true;
     3408    copy = TRUE;
    33153409
    33163410  if (aout_backend_info (abfd)->add_dynamic_symbols != NULL)
     
    33183412      if (! ((*aout_backend_info (abfd)->add_dynamic_symbols)
    33193413             (abfd, info, &syms, &sym_count, &strings)))
    3320         return false;
     3414        return FALSE;
    33213415    }
    33223416
     
    33253419     table, but keeping the list is more efficient.  Perhaps this
    33263420     should be conditional on info->keep_memory.  */
    3327   sym_hash = ((struct aout_link_hash_entry **)
    3328               bfd_alloc (abfd,
    3329                          ((size_t) sym_count
    3330                           * sizeof (struct aout_link_hash_entry *))));
     3421  amt = sym_count * sizeof (struct aout_link_hash_entry *);
     3422  sym_hash = (struct aout_link_hash_entry **) bfd_alloc (abfd, amt);
    33313423  if (sym_hash == NULL && sym_count != 0)
    3332     return false;
     3424    return FALSE;
    33333425  obj_aout_sym_hashes (abfd) = sym_hash;
    33343426
     
    33503442      *sym_hash = NULL;
    33513443
    3352       type = bfd_h_get_8 (abfd, p->e_type);
     3444      type = H_GET_8 (abfd, p->e_type);
    33533445
    33543446      /* Ignore debugging symbols.  */
     
    34763568
    34773569      if (! ((*add_one_symbol)
    3478              (info, abfd, name, flags, section, value, string, copy, false,
     3570             (info, abfd, name, flags, section, value, string, copy, FALSE,
    34793571              (struct bfd_link_hash_entry **) sym_hash)))
    3480         return false;
     3572        return FALSE;
    34813573
    34823574      /* Restrict the maximum alignment of a common symbol based on
     
    35043596    }
    35053597
    3506   return true;
     3598  return TRUE;
    35073599}
    35083600
     
    35353627/* Look up an entry in an the header file hash table.  */
    35363628
    3537 #define aout_link_includes_lookup(table, string, create, copy) \
    3538   ((struct aout_link_includes_entry *) \
     3629#define aout_link_includes_lookup(table, string, create, copy)          \
     3630  ((struct aout_link_includes_entry *)                                  \
    35393631   bfd_hash_lookup (&(table)->root, (string), (create), (copy)))
    35403632
     
    35683660static struct bfd_hash_entry *aout_link_includes_newfunc
    35693661  PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
    3570 static boolean aout_link_input_bfd
     3662static bfd_boolean aout_link_input_bfd
    35713663  PARAMS ((struct aout_final_link_info *, bfd *input_bfd));
    3572 static boolean aout_link_write_symbols
     3664static bfd_boolean aout_link_write_symbols
    35733665  PARAMS ((struct aout_final_link_info *, bfd *input_bfd));
    3574 static boolean aout_link_write_other_symbol
     3666static bfd_boolean aout_link_write_other_symbol
    35753667  PARAMS ((struct aout_link_hash_entry *, PTR));
    3576 static boolean aout_link_input_section
     3668static bfd_boolean aout_link_input_section
    35773669  PARAMS ((struct aout_final_link_info *, bfd *input_bfd,
    35783670           asection *input_section, file_ptr *reloff_ptr,
    35793671           bfd_size_type rel_size));
    3580 static boolean aout_link_input_section_std
     3672static bfd_boolean aout_link_input_section_std
    35813673  PARAMS ((struct aout_final_link_info *, bfd *input_bfd,
    35823674           asection *input_section, struct reloc_std_external *,
    35833675           bfd_size_type rel_size, bfd_byte *contents));
    3584 static boolean aout_link_input_section_ext
     3676static bfd_boolean aout_link_input_section_ext
    35853677  PARAMS ((struct aout_final_link_info *, bfd *input_bfd,
    35863678           asection *input_section, struct reloc_ext_external *,
     
    35883680static INLINE asection *aout_reloc_index_to_section
    35893681  PARAMS ((bfd *, int));
    3590 static boolean aout_link_reloc_link_order
     3682static bfd_boolean aout_link_reloc_link_order
    35913683  PARAMS ((struct aout_final_link_info *, asection *,
    35923684           struct bfd_link_order *));
     
    36313723   the output section.  */
    36323724
    3633 boolean
     3725bfd_boolean
    36343726NAME(aout,final_link) (abfd, info, callback)
    36353727     bfd *abfd;
     
    36383730{
    36393731  struct aout_final_link_info aout_info;
    3640   boolean includes_hash_initialized = false;
     3732  bfd_boolean includes_hash_initialized = FALSE;
    36413733  register bfd *sub;
    36423734  bfd_size_type trsize, drsize;
    3643   size_t max_contents_size;
    3644   size_t max_relocs_size;
    3645   size_t max_sym_count;
     3735  bfd_size_type max_contents_size;
     3736  bfd_size_type max_relocs_size;
     3737  bfd_size_type max_sym_count;
    36463738  bfd_size_type text_size;
    36473739  file_ptr text_end;
    36483740  register struct bfd_link_order *p;
    36493741  asection *o;
    3650   boolean have_link_order_relocs;
     3742  bfd_boolean have_link_order_relocs;
    36513743
    36523744  if (info->shared)
     
    36643756                               251))
    36653757    goto error_return;
    3666   includes_hash_initialized = true;
     3758  includes_hash_initialized = TRUE;
    36673759
    36683760  /* Figure out the largest section size.  Also, if generating
     
    36753767  for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
    36763768    {
    3677       size_t sz;
     3769      bfd_size_type sz;
    36783770
    36793771      if (info->relocateable)
     
    37873879
    37883880    h = aout_link_hash_lookup (aout_hash_table (info), "__DYNAMIC",
    3789                                false, false, false);
     3881                               FALSE, FALSE, FALSE);
    37903882    if (h != NULL)
    37913883      aout_link_write_other_symbol (h, &aout_info);
     
    38143906     whether we have already handled it.  */
    38153907  for (sub = info->input_bfds; sub != (bfd *) NULL; sub = sub->link_next)
    3816     sub->output_has_begun = false;
     3908    sub->output_has_begun = FALSE;
    38173909
    38183910  /* Mark all sections which are to be included in the link.  This
     
    38233915    {
    38243916      for (p = o->link_order_head; p != NULL; p = p->next)
    3825         {
    3826           if (p->type == bfd_indirect_link_order)
    3827             p->u.indirect.section->linker_mark = true;
    3828         }
    3829     }
    3830 
    3831   have_link_order_relocs = false;
     3917        if (p->type == bfd_indirect_link_order)
     3918          p->u.indirect.section->linker_mark = TRUE;
     3919    }
     3920
     3921  have_link_order_relocs = FALSE;
    38323922  for (o = abfd->sections; o != (asection *) NULL; o = o->next)
    38333923    {
     
    38473937                  if (! aout_link_input_bfd (&aout_info, input_bfd))
    38483938                    goto error_return;
    3849                   input_bfd->output_has_begun = true;
     3939                  input_bfd->output_has_begun = TRUE;
    38503940                }
    38513941            }
     
    38543944            {
    38553945              /* These are handled below.  */
    3856               have_link_order_relocs = true;
     3946              have_link_order_relocs = TRUE;
    38573947            }
    38583948          else
     
    39144004    {
    39154005      bfd_hash_table_free (&aout_info.includes.root);
    3916       includes_hash_initialized = false;
     4006      includes_hash_initialized = FALSE;
    39174007    }
    39184008
     
    39444034    {
    39454035      bfd_byte b;
     4036      file_ptr pos;
    39464037
    39474038      b = 0;
    3948       if (bfd_seek (abfd,
    3949                     (obj_datasec (abfd)->filepos
    3950                      + exec_hdr (abfd)->a_data
    3951                      - 1),
    3952                     SEEK_SET) != 0
    3953           || bfd_write (&b, 1, 1, abfd) != 1)
     4039      pos = obj_datasec (abfd)->filepos + exec_hdr (abfd)->a_data - 1;
     4040      if (bfd_seek (abfd, pos, SEEK_SET) != 0
     4041          || bfd_bwrite (&b, (bfd_size_type) 1, abfd) != 1)
    39544042        goto error_return;
    39554043    }
    39564044
    3957   return true;
     4045  return TRUE;
    39584046
    39594047 error_return:
     
    39684056  if (includes_hash_initialized)
    39694057    bfd_hash_table_free (&aout_info.includes.root);
    3970   return false;
     4058  return FALSE;
    39714059}
    39724060
    39734061/* Link an a.out input BFD into the output file.  */
    39744062
    3975 static boolean
     4063static bfd_boolean
    39764064aout_link_input_bfd (finfo, input_bfd)
    39774065     struct aout_final_link_info *finfo;
     
    39914079
    39924080  /* Get the symbols.  We probably have them already, unless
    3993      finfo->info->keep_memory is false.  */
     4081     finfo->info->keep_memory is FALSE.  */
    39944082  if (! aout_get_external_symbols (input_bfd))
    3995     return false;
     4083    return FALSE;
    39964084
    39974085  sym_count = obj_aout_external_sym_count (input_bfd);
     
    40004088     is placed into finfo->symbol_map.  */
    40014089  if (! aout_link_write_symbols (finfo, input_bfd))
    4002     return false;
     4090    return FALSE;
    40034091
    40044092  /* Relocate and write out the sections.  These functions use the
     
    40124100                                     &finfo->treloff,
    40134101                                     exec_hdr (input_bfd)->a_trsize))
    4014         return false;
     4102        return FALSE;
    40154103    }
    40164104  if (obj_datasec (input_bfd)->linker_mark)
     
    40204108                                     &finfo->dreloff,
    40214109                                     exec_hdr (input_bfd)->a_drsize))
    4022         return false;
     4110        return FALSE;
    40234111    }
    40244112
     
    40294117    {
    40304118      if (! aout_link_free_symbols (input_bfd))
    4031         return false;
    4032     }
    4033 
    4034   return true;
     4119        return FALSE;
     4120    }
     4121
     4122  return TRUE;
    40354123}
    40364124
     
    40384126   symbol indices into a symbol_map.  */
    40394127
    4040 static boolean
     4128static bfd_boolean
    40414129aout_link_write_symbols (finfo, input_bfd)
    40424130     struct aout_final_link_info *finfo;
     
    40544142  struct aout_link_hash_entry **sym_hash;
    40554143  int *symbol_map;
    4056   boolean pass;
    4057   boolean skip_next;
     4144  bfd_boolean pass;
     4145  bfd_boolean skip_next;
    40584146
    40594147  output_bfd = finfo->output_bfd;
     
    40694157      && (strip != strip_some
    40704158          || bfd_hash_lookup (finfo->info->keep_hash, input_bfd->filename,
    4071                               false, false) != NULL)
     4159                              FALSE, FALSE) != NULL)
    40724160      && discard != discard_all)
    40734161    {
    4074       bfd_h_put_8 (output_bfd, N_TEXT, outsym->e_type);
    4075       bfd_h_put_8 (output_bfd, 0, outsym->e_other);
    4076       bfd_h_put_16 (output_bfd, (bfd_vma) 0, outsym->e_desc);
     4162      H_PUT_8 (output_bfd, N_TEXT, outsym->e_type);
     4163      H_PUT_8 (output_bfd, 0, outsym->e_other);
     4164      H_PUT_16 (output_bfd, 0, outsym->e_desc);
    40774165      strtab_index = add_to_stringtab (output_bfd, finfo->strtab,
    4078                                        input_bfd->filename, false);
     4166                                       input_bfd->filename, FALSE);
    40794167      if (strtab_index == (bfd_size_type) -1)
    4080         return false;
     4168        return FALSE;
    40814169      PUT_WORD (output_bfd, strtab_index, outsym->e_strx);
    40824170      PUT_WORD (output_bfd,
     
    40894177    }
    40904178
    4091   pass = false;
    4092   skip_next = false;
     4179  pass = FALSE;
     4180  skip_next = FALSE;
    40934181  sym = obj_aout_external_syms (input_bfd);
    40944182  sym_end = sym + sym_count;
    40954183  sym_hash = obj_aout_sym_hashes (input_bfd);
    40964184  symbol_map = finfo->symbol_map;
    4097   memset (symbol_map, 0, sym_count * sizeof *symbol_map);
     4185  memset (symbol_map, 0, (size_t) sym_count * sizeof *symbol_map);
    40984186  for (; sym < sym_end; sym++, sym_hash++, symbol_map++)
    40994187    {
     
    41014189      int type;
    41024190      struct aout_link_hash_entry *h;
    4103       boolean skip;
     4191      bfd_boolean skip;
    41044192      asection *symsec;
    41054193      bfd_vma val = 0;
    4106       boolean copy;
     4194      bfd_boolean copy;
    41074195
    41084196      /* We set *symbol_map to 0 above for all symbols.  If it has
     
    41184206      *symbol_map = -1;
    41194207
    4120       type = bfd_h_get_8 (input_bfd, sym->e_type);
     4208      type = H_GET_8 (input_bfd, sym->e_type);
    41214209      name = strings + GET_WORD (input_bfd, sym->e_strx);
    41224210
     
    41284216             indirect or warning symbol.  */
    41294217          val = GET_WORD (input_bfd, sym->e_value);
    4130           pass = false;
     4218          pass = FALSE;
    41314219        }
    41324220      else if (skip_next)
     
    41354223             symbol that we have changed to no longer be an indirect
    41364224             symbol.  */
    4137           skip_next = false;
     4225          skip_next = FALSE;
    41384226          continue;
    41394227        }
     
    41504238          /* Use the name from the hash table, in case the symbol was
    41514239             wrapped.  */
    4152           if (h != NULL)
     4240          if (h != NULL
     4241              && h->root.type != bfd_link_hash_warning)
    41534242            name = h->root.root.string;
    41544243
     
    41724261          /* If the symbol has already been written out, skip it.  */
    41734262          if (h != (struct aout_link_hash_entry *) NULL
    4174               && h->root.type != bfd_link_hash_warning
    41754263              && h->written)
    41764264            {
    41774265              if ((type & N_TYPE) == N_INDR
    41784266                  || type == N_WARNING)
    4179                 skip_next = true;
     4267                skip_next = TRUE;
    41804268              *symbol_map = h->indx;
    41814269              continue;
     
    41834271
    41844272          /* See if we are stripping this symbol.  */
    4185           skip = false;
     4273          skip = FALSE;
    41864274          switch (strip)
    41874275            {
     
    41904278            case strip_debugger:
    41914279              if ((type & N_STAB) != 0)
    4192                 skip = true;
     4280                skip = TRUE;
    41934281              break;
    41944282            case strip_some:
    4195               if (bfd_hash_lookup (finfo->info->keep_hash, name, false, false)
     4283              if (bfd_hash_lookup (finfo->info->keep_hash, name, FALSE, FALSE)
    41964284                  == NULL)
    4197                 skip = true;
     4285                skip = TRUE;
    41984286              break;
    41994287            case strip_all:
    4200               skip = true;
     4288              skip = TRUE;
    42014289              break;
    42024290            }
     
    42044292            {
    42054293              if (h != (struct aout_link_hash_entry *) NULL)
    4206                 h->written = true;
     4294                h->written = TRUE;
    42074295              continue;
    42084296            }
     
    42334321                 the correct definition so the debugger will
    42344322                 understand it.  */
    4235               pass = true;
     4323              pass = TRUE;
    42364324              val = GET_WORD (input_bfd, sym->e_value);
    42374325              symsec = NULL;
     
    42494337                 which is the target of the indirection.  */
    42504338              if ((type & N_TYPE) == N_INDR)
    4251                 skip_next = true;
     4339                skip_next = TRUE;
    42524340
    42534341              symsec = NULL;
     
    43414429          if (h != (struct aout_link_hash_entry *) NULL)
    43424430            {
    4343               h->written = true;
     4431              h->written = TRUE;
    43444432              h->indx = obj_aout_external_sym_count (output_bfd);
    43454433            }
     
    43524440                {
    43534441                case discard_none:
     4442                case discard_sec_merge:
    43544443                  break;
    43554444                case discard_l:
    43564445                  if ((type & N_STAB) == 0
    43574446                      && bfd_is_local_label_name (input_bfd, name))
    4358                     skip = true;
     4447                    skip = TRUE;
    43594448                  break;
    43604449                case discard_all:
    4361                   skip = true;
     4450                  skip = TRUE;
    43624451                  break;
    43634452                }
    43644453              if (skip)
    43654454                {
    4366                   pass = false;
     4455                  pass = FALSE;
    43674456                  continue;
    43684457                }
     
    43754464             numbers in types (the first number after an open
    43764465             parenthesis).  */
    4377           if (type == N_BINCL)
     4466          if (type == (int) N_BINCL)
    43784467            {
    43794468              struct external_nlist *incl_sym;
     
    43884477                  int incl_type;
    43894478
    4390                   incl_type = bfd_h_get_8 (input_bfd, incl_sym->e_type);
    4391                   if (incl_type == N_EINCL)
     4479                  incl_type = H_GET_8 (input_bfd, incl_sym->e_type);
     4480                  if (incl_type == (int) N_EINCL)
    43924481                    {
    43934482                      if (nest == 0)
     
    43954484                      --nest;
    43964485                    }
    4397                   else if (incl_type == N_BINCL)
     4486                  else if (incl_type == (int) N_BINCL)
    43984487                    ++nest;
    43994488                  else if (nest == 0)
     
    44094498                              /* Skip the file number.  */
    44104499                              ++s;
    4411                               while (isdigit ((unsigned char) *s))
     4500                              while (ISDIGIT (*s))
    44124501                                ++s;
    44134502                              --s;
     
    44204509                 same value, then replace this one with an N_EXCL
    44214510                 symbol.  */
    4422               copy = ! finfo->info->keep_memory;
     4511              copy = (bfd_boolean) (! finfo->info->keep_memory);
    44234512              incl_entry = aout_link_includes_lookup (&finfo->includes,
    4424                                                       name, true, copy);
     4513                                                      name, TRUE, copy);
    44254514              if (incl_entry == NULL)
    4426                 return false;
     4515                return FALSE;
    44274516              for (t = incl_entry->totals; t != NULL; t = t->next)
    44284517                if (t->total == val)
     
    44364525                                          sizeof *t));
    44374526                  if (t == NULL)
    4438                     return false;
     4527                    return FALSE;
    44394528                  t->total = val;
    44404529                  t->next = incl_entry->totals;
     
    44484537                     it to be an N_EXCL entry, and mark all the
    44494538                     included symbols to prevent outputting them.  */
    4450                   type = N_EXCL;
     4539                  type = (int) N_EXCL;
    44514540
    44524541                  nest = 0;
     
    44574546                      int incl_type;
    44584547
    4459                       incl_type = bfd_h_get_8 (input_bfd, incl_sym->e_type);
    4460                       if (incl_type == N_EINCL)
     4548                      incl_type = H_GET_8 (input_bfd, incl_sym->e_type);
     4549                      if (incl_type == (int) N_EINCL)
    44614550                        {
    44624551                          if (nest == 0)
     
    44674556                          --nest;
    44684557                        }
    4469                       else if (incl_type == N_BINCL)
     4558                      else if (incl_type == (int) N_BINCL)
    44704559                        ++nest;
    44714560                      else if (nest == 0)
     
    44784567      /* Copy this symbol into the list of symbols we are going to
    44794568         write out.  */
    4480       bfd_h_put_8 (output_bfd, type, outsym->e_type);
    4481       bfd_h_put_8 (output_bfd, bfd_h_get_8 (input_bfd, sym->e_other),
    4482                    outsym->e_other);
    4483       bfd_h_put_16 (output_bfd, bfd_h_get_16 (input_bfd, sym->e_desc),
    4484                     outsym->e_desc);
    4485       copy = false;
     4569      H_PUT_8 (output_bfd, type, outsym->e_type);
     4570      H_PUT_8 (output_bfd, H_GET_8 (input_bfd, sym->e_other), outsym->e_other);
     4571      H_PUT_16 (output_bfd, H_GET_16 (input_bfd, sym->e_desc), outsym->e_desc);
     4572      copy = FALSE;
    44864573      if (! finfo->info->keep_memory)
    44874574        {
     
    44924579            name = h->root.root.string;
    44934580          else
    4494             copy = true;
     4581            copy = TRUE;
    44954582        }
    44964583      strtab_index = add_to_stringtab (output_bfd, finfo->strtab,
    44974584                                       name, copy);
    44984585      if (strtab_index == (bfd_size_type) -1)
    4499         return false;
     4586        return FALSE;
    45004587      PUT_WORD (output_bfd, strtab_index, outsym->e_strx);
    45014588      PUT_WORD (output_bfd, val, outsym->e_value);
     
    45084595  if (outsym > finfo->output_syms)
    45094596    {
    4510       bfd_size_type outsym_count;
     4597      bfd_size_type outsym_size;
    45114598
    45124599      if (bfd_seek (output_bfd, finfo->symoff, SEEK_SET) != 0)
    4513         return false;
    4514       outsym_count = outsym - finfo->output_syms;
    4515       if (bfd_write ((PTR) finfo->output_syms,
    4516                      (bfd_size_type) EXTERNAL_NLIST_SIZE,
    4517                      (bfd_size_type) outsym_count, output_bfd)
    4518           != outsym_count * EXTERNAL_NLIST_SIZE)
    4519         return false;
    4520       finfo->symoff += outsym_count * EXTERNAL_NLIST_SIZE;
    4521     }
    4522 
    4523   return true;
     4600        return FALSE;
     4601      outsym_size = outsym - finfo->output_syms;
     4602      outsym_size *= EXTERNAL_NLIST_SIZE;
     4603      if (bfd_bwrite ((PTR) finfo->output_syms, outsym_size, output_bfd)
     4604          != outsym_size)
     4605        return FALSE;
     4606      finfo->symoff += outsym_size;
     4607    }
     4608
     4609  return TRUE;
    45244610}
    45254611
     
    45274613   object.  */
    45284614
    4529 static boolean
     4615static bfd_boolean
    45304616aout_link_write_other_symbol (h, data)
    45314617     struct aout_link_hash_entry *h;
     
    45384624  struct external_nlist outsym;
    45394625  bfd_size_type indx;
     4626  bfd_size_type amt;
     4627
     4628  if (h->root.type == bfd_link_hash_warning)
     4629    {
     4630      h = (struct aout_link_hash_entry *) h->root.u.i.link;
     4631      if (h->root.type == bfd_link_hash_new)
     4632        return TRUE;
     4633    }
    45404634
    45414635  output_bfd = finfo->output_bfd;
     
    45524646
    45534647  if (h->written)
    4554     return true;
    4555 
    4556   h->written = true;
     4648    return TRUE;
     4649
     4650  h->written = TRUE;
    45574651
    45584652  /* An indx of -2 means the symbol must be written.  */
     
    45614655          || (finfo->info->strip == strip_some
    45624656              && bfd_hash_lookup (finfo->info->keep_hash, h->root.root.string,
    4563                                   false, false) == NULL)))
    4564     return true;
     4657                                  FALSE, FALSE) == NULL)))
     4658    return TRUE;
    45654659
    45664660  switch (h->root.type)
    45674661    {
    45684662    default:
     4663    case bfd_link_hash_warning:
    45694664      abort ();
    45704665      /* Avoid variable not initialized warnings.  */
    4571       return true;
     4666      return TRUE;
    45724667    case bfd_link_hash_new:
    45734668      /* This can happen for set symbols when sets are not being
    45744669         built.  */
    4575       return true;
     4670      return TRUE;
    45764671    case bfd_link_hash_undefined:
    45774672      type = N_UNDF | N_EXT;
     
    46084703      val = 0;
    46094704    case bfd_link_hash_indirect:
    4610     case bfd_link_hash_warning:
    4611       /* FIXME: Ignore these for now.  The circumstances under which
    4612          they should be written out are not clear to me.  */
    4613       return true;
    4614     }
    4615 
    4616   bfd_h_put_8 (output_bfd, type, outsym.e_type);
    4617   bfd_h_put_8 (output_bfd, 0, outsym.e_other);
    4618   bfd_h_put_16 (output_bfd, 0, outsym.e_desc);
     4705      /* We ignore these symbols, since the indirected symbol is
     4706         already in the hash table.  */
     4707      return TRUE;
     4708    }
     4709
     4710  H_PUT_8 (output_bfd, type, outsym.e_type);
     4711  H_PUT_8 (output_bfd, 0, outsym.e_other);
     4712  H_PUT_16 (output_bfd, 0, outsym.e_desc);
    46194713  indx = add_to_stringtab (output_bfd, finfo->strtab, h->root.root.string,
    4620                            false);
    4621   if (indx == (bfd_size_type) -1)
     4714                           FALSE);
     4715  if (indx == - (bfd_size_type) 1)
    46224716    {
    46234717      /* FIXME: No way to handle errors.  */
     
    46274721  PUT_WORD (output_bfd, val, outsym.e_value);
    46284722
     4723  amt = EXTERNAL_NLIST_SIZE;
    46294724  if (bfd_seek (output_bfd, finfo->symoff, SEEK_SET) != 0
    4630       || bfd_write ((PTR) &outsym, (bfd_size_type) EXTERNAL_NLIST_SIZE,
    4631                     (bfd_size_type) 1, output_bfd) != EXTERNAL_NLIST_SIZE)
     4725      || bfd_bwrite ((PTR) &outsym, amt, output_bfd) != amt)
    46324726    {
    46334727      /* FIXME: No way to handle errors.  */
     
    46394733  ++obj_aout_external_sym_count (output_bfd);
    46404734
    4641   return true;
     4735  return TRUE;
    46424736}
    46434737
    46444738/* Link an a.out section into the output file.  */
    46454739
    4646 static boolean
     4740static bfd_boolean
    46474741aout_link_input_section (finfo, input_bfd, input_section, reloff_ptr,
    46484742                         rel_size)
     
    46614755                                  (PTR) finfo->contents,
    46624756                                  (file_ptr) 0, input_size))
    4663     return false;
     4757    return FALSE;
    46644758
    46654759  /* Read in the relocs if we haven't already done it.  */
     
    46734767        {
    46744768          if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0
    4675               || bfd_read (relocs, 1, rel_size, input_bfd) != rel_size)
    4676             return false;
     4769              || bfd_bread (relocs, rel_size, input_bfd) != rel_size)
     4770            return FALSE;
    46774771        }
    46784772    }
     
    46844778                                         (struct reloc_std_external *) relocs,
    46854779                                         rel_size, finfo->contents))
    4686         return false;
     4780        return FALSE;
    46874781    }
    46884782  else
     
    46914785                                         (struct reloc_ext_external *) relocs,
    46924786                                         rel_size, finfo->contents))
    4693         return false;
     4787        return FALSE;
    46944788    }
    46954789
     
    46984792                                  input_section->output_section,
    46994793                                  (PTR) finfo->contents,
    4700                                   input_section->output_offset,
     4794                                  (file_ptr) input_section->output_offset,
    47014795                                  input_size))
    4702     return false;
     4796    return FALSE;
    47034797
    47044798  /* If we are producing relocateable output, the relocs were
     
    47074801    {
    47084802      if (bfd_seek (finfo->output_bfd, *reloff_ptr, SEEK_SET) != 0)
    4709         return false;
    4710       if (bfd_write (relocs, (bfd_size_type) 1, rel_size, finfo->output_bfd)
    4711           != rel_size)
    4712         return false;
     4803        return FALSE;
     4804      if (bfd_bwrite (relocs, rel_size, finfo->output_bfd) != rel_size)
     4805        return FALSE;
    47134806      *reloff_ptr += rel_size;
    47144807
     
    47224815    }
    47234816
    4724   return true;
     4817  return TRUE;
    47254818}
    47264819
     
    47524845/* Relocate an a.out section using standard a.out relocs.  */
    47534846
    4754 static boolean
     4847static bfd_boolean
    47554848aout_link_input_section_std (finfo, input_bfd, input_section, relocs,
    47564849                             rel_size, contents)
     
    47624855     bfd_byte *contents;
    47634856{
    4764   boolean (*check_dynamic_reloc) PARAMS ((struct bfd_link_info *,
    4765                                           bfd *, asection *,
    4766                                           struct aout_link_hash_entry *,
    4767                                           PTR, bfd_byte *, boolean *,
    4768                                           bfd_vma *));
     4857  bfd_boolean (*check_dynamic_reloc)
     4858    PARAMS ((struct bfd_link_info *, bfd *, asection *,
     4859             struct aout_link_hash_entry *, PTR, bfd_byte *, bfd_boolean *,
     4860             bfd_vma *));
    47694861  bfd *output_bfd;
    4770   boolean relocateable;
     4862  bfd_boolean relocateable;
    47714863  struct external_nlist *syms;
    47724864  char *strings;
     
    48084900
    48094901#ifdef MY_reloc_howto
    4810       howto = MY_reloc_howto(input_bfd, rel, r_index, r_extern, r_pcrel);
     4902      howto = MY_reloc_howto (input_bfd, rel, r_index, r_extern, r_pcrel);
    48114903#else
    48124904      {
     
    48184910        if (bfd_header_big_endian (input_bfd))
    48194911          {
    4820             r_index   =  ((rel->r_index[0] << 16)
    4821                           | (rel->r_index[1] << 8)
     4912            r_index   =  (((unsigned int) rel->r_index[0] << 16)
     4913                          | ((unsigned int) rel->r_index[1] << 8)
    48224914                          | rel->r_index[2]);
    48234915            r_extern  = (0 != (rel->r_type[0] & RELOC_STD_BITS_EXTERN_BIG));
     
    48314923        else
    48324924          {
    4833             r_index   = ((rel->r_index[2] << 16)
    4834                          | (rel->r_index[1] << 8)
     4925            r_index   = (((unsigned int) rel->r_index[2] << 16)
     4926                         | ((unsigned int) rel->r_index[1] << 8)
    48354927                         | rel->r_index[0]);
    48364928            r_extern  = (0 != (rel->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE));
     
    49105002                            {
    49115003                              h->indx = -2;
    4912                               h->written = false;
     5004                              h->written = FALSE;
    49135005                              if (! aout_link_write_other_symbol (h,
    49145006                                                                  (PTR) finfo))
    4915                                 return false;
     5007                                return FALSE;
    49165008                            }
    49175009                          r_index = h->indx;
     
    49265018                                 (finfo->info, name, input_bfd, input_section,
    49275019                                  r_addr)))
    4928                             return false;
     5020                            return FALSE;
    49295021                          r_index = 0;
    49305022                        }
     
    49865078      else
    49875079        {
    4988           boolean hundef;
     5080          bfd_boolean hundef;
    49895081
    49905082          /* We are generating an executable, and must do a full
    49915083             relocation.  */
    4992           hundef = false;
     5084          hundef = FALSE;
    49935085
    49945086          if (r_extern)
     
    50095101              else
    50105102                {
    5011                   hundef = true;
     5103                  hundef = TRUE;
    50125104                  relocation = 0;
    50135105                }
     
    50275119          if (check_dynamic_reloc != NULL)
    50285120            {
    5029               boolean skip;
     5121              bfd_boolean skip;
    50305122
    50315123              if (! ((*check_dynamic_reloc)
    50325124                     (finfo->info, input_bfd, input_section, h,
    50335125                      (PTR) rel, contents, &skip, &relocation)))
    5034                 return false;
     5126                return FALSE;
    50355127              if (skip)
    50365128                continue;
     
    50505142              if (! ((*finfo->info->callbacks->undefined_symbol)
    50515143                     (finfo->info, name, input_bfd, input_section,
    5052                      r_addr, true)))
    5053                 return false;
     5144                     r_addr, TRUE)))
     5145                return FALSE;
    50545146            }
    50555147
     
    50865178                       (finfo->info, name, howto->name,
    50875179                        (bfd_vma) 0, input_bfd, input_section, r_addr)))
    5088                   return false;
     5180                  return FALSE;
    50895181              }
    50905182              break;
     
    50935185    }
    50945186
    5095   return true;
     5187  return TRUE;
    50965188}
    50975189
    50985190/* Relocate an a.out section using extended a.out relocs.  */
    50995191
    5100 static boolean
     5192static bfd_boolean
    51015193aout_link_input_section_ext (finfo, input_bfd, input_section, relocs,
    51025194                             rel_size, contents)
     
    51085200     bfd_byte *contents;
    51095201{
    5110   boolean (*check_dynamic_reloc) PARAMS ((struct bfd_link_info *,
    5111                                           bfd *, asection *,
    5112                                           struct aout_link_hash_entry *,
    5113                                           PTR, bfd_byte *, boolean *,
    5114                                           bfd_vma *));
     5202  bfd_boolean (*check_dynamic_reloc)
     5203    PARAMS ((struct bfd_link_info *, bfd *, asection *,
     5204             struct aout_link_hash_entry *, PTR, bfd_byte *, bfd_boolean *,
     5205             bfd_vma *));
    51155206  bfd *output_bfd;
    5116   boolean relocateable;
     5207  bfd_boolean relocateable;
    51175208  struct external_nlist *syms;
    51185209  char *strings;
     
    51545245      if (bfd_header_big_endian (input_bfd))
    51555246        {
    5156           r_index  = ((rel->r_index[0] << 16)
    5157                       | (rel->r_index[1] << 8)
     5247          r_index  = (((unsigned int) rel->r_index[0] << 16)
     5248                      | ((unsigned int) rel->r_index[1] << 8)
    51585249                      | rel->r_index[2]);
    51595250          r_extern = (0 != (rel->r_type[0] & RELOC_EXT_BITS_EXTERN_BIG));
     
    51635254      else
    51645255        {
    5165           r_index  = ((rel->r_index[2] << 16)
    5166                       | (rel->r_index[1] << 8)
     5256          r_index  = (((unsigned int) rel->r_index[2] << 16)
     5257                      | ((unsigned int) rel->r_index[1] << 8)
    51675258                      | rel->r_index[0]);
    51685259          r_extern = (0 != (rel->r_type[0] & RELOC_EXT_BITS_EXTERN_LITTLE));
     
    51805271             modify the reloc accordingly.  */
    51815272          if (r_extern
    5182               || r_type == RELOC_BASE10
    5183               || r_type == RELOC_BASE13
    5184               || r_type == RELOC_BASE22)
     5273              || r_type == (unsigned int) RELOC_BASE10
     5274              || r_type == (unsigned int) RELOC_BASE13
     5275              || r_type == (unsigned int) RELOC_BASE22)
    51855276            {
    51865277              /* If we know the symbol this relocation is against,
    51875278                 convert it into a relocation against a section.  This
    51885279                 is what the native linker does.  */
    5189               if (r_type == RELOC_BASE10
    5190                   || r_type == RELOC_BASE13
    5191                   || r_type == RELOC_BASE22)
     5280              if (r_type == (unsigned int) RELOC_BASE10
     5281                  || r_type == (unsigned int) RELOC_BASE13
     5282                  || r_type == (unsigned int) RELOC_BASE22)
    51925283                h = NULL;
    51935284              else
     
    52485339                            {
    52495340                              h->indx = -2;
    5250                               h->written = false;
     5341                              h->written = FALSE;
    52515342                              if (! aout_link_write_other_symbol (h,
    52525343                                                                  (PTR) finfo))
    5253                                 return false;
     5344                                return FALSE;
    52545345                            }
    52555346                          r_index = h->indx;
     
    52645355                                 (finfo->info, name, input_bfd, input_section,
    52655356                                  r_addr)))
    5266                             return false;
     5357                            return FALSE;
    52675358                          r_index = 0;
    52685359                        }
     
    53295420      else
    53305421        {
    5331           boolean hundef;
     5422          bfd_boolean hundef;
    53325423          bfd_reloc_status_type r;
    53335424
    53345425          /* We are generating an executable, and must do a full
    53355426             relocation.  */
    5336           hundef = false;
     5427          hundef = FALSE;
    53375428
    53385429          if (r_extern)
     
    53535444              else
    53545445                {
    5355                   hundef = true;
     5446                  hundef = TRUE;
    53565447                  relocation = 0;
    53575448                }
    53585449            }
    5359           else if (r_type == RELOC_BASE10
    5360                    || r_type == RELOC_BASE13
    5361                    || r_type == RELOC_BASE22)
     5450          else if (r_type == (unsigned int) RELOC_BASE10
     5451                   || r_type == (unsigned int) RELOC_BASE13
     5452                   || r_type == (unsigned int) RELOC_BASE22)
    53625453            {
    53635454              struct external_nlist *sym;
     
    53675458                 into the symbol table, even if r_extern is 0.  */
    53685459              sym = syms + r_index;
    5369               type = bfd_h_get_8 (input_bfd, sym->e_type);
     5460              type = H_GET_8 (input_bfd, sym->e_type);
    53705461              if ((type & N_TYPE) == N_TEXT
    53715462                  || type == N_WEAKT)
     
    54265517          if (check_dynamic_reloc != NULL)
    54275518            {
    5428               boolean skip;
     5519              bfd_boolean skip;
    54295520
    54305521              if (! ((*check_dynamic_reloc)
    54315522                     (finfo->info, input_bfd, input_section, h,
    54325523                      (PTR) rel, contents, &skip, &relocation)))
    5433                 return false;
     5524                return FALSE;
    54345525              if (skip)
    54355526                continue;
     
    54415532          if (hundef
    54425533              && ! finfo->info->shared
    5443               && r_type != RELOC_BASE10
    5444               && r_type != RELOC_BASE13
    5445               && r_type != RELOC_BASE22)
     5534              && r_type != (unsigned int) RELOC_BASE10
     5535              && r_type != (unsigned int) RELOC_BASE13
     5536              && r_type != (unsigned int) RELOC_BASE22)
    54465537            {
    54475538              const char *name;
     
    54535544              if (! ((*finfo->info->callbacks->undefined_symbol)
    54545545                     (finfo->info, name, input_bfd, input_section,
    5455                      r_addr, true)))
    5456                 return false;
     5546                     r_addr, TRUE)))
     5547                return FALSE;
    54575548            }
    54585549
    5459           if (r_type != RELOC_SPARC_REV32)
     5550          if (r_type != (unsigned int) RELOC_SPARC_REV32)
    54605551            r = MY_final_link_relocate (howto_table_ext + r_type,
    54615552                                        input_bfd, input_section,
     
    54865577                      name = h->root.root.string;
    54875578                    else if (r_extern
    5488                              || r_type == RELOC_BASE10
    5489                              || r_type == RELOC_BASE13
    5490                              || r_type == RELOC_BASE22)
     5579                             || r_type == (unsigned int) RELOC_BASE10
     5580                             || r_type == (unsigned int) RELOC_BASE13
     5581                             || r_type == (unsigned int) RELOC_BASE22)
    54915582                      name = strings + GET_WORD (input_bfd,
    54925583                                                 syms[r_index].e_strx);
     
    55015592                           (finfo->info, name, howto_table_ext[r_type].name,
    55025593                            r_addend, input_bfd, input_section, r_addr)))
    5503                       return false;
     5594                      return FALSE;
    55045595                  }
    55055596                  break;
     
    55095600    }
    55105601
    5511   return true;
     5602  return TRUE;
    55125603}
    55135604
    55145605/* Handle a link order which is supposed to generate a reloc.  */
    55155606
    5516 static boolean
     5607static bfd_boolean
    55175608aout_link_reloc_link_order (finfo, o, p)
    55185609     struct aout_final_link_info *finfo;
     
    55285619  struct reloc_ext_external erel;
    55295620  PTR rel_ptr;
     5621  bfd_size_type amt;
    55305622
    55315623  pr = p->u.reloc.p;
     
    55505642      h = ((struct aout_link_hash_entry *)
    55515643           bfd_wrapped_link_hash_lookup (finfo->output_bfd, finfo->info,
    5552                                          pr->u.name, false, false, true));
     5644                                         pr->u.name, FALSE, FALSE, TRUE));
    55535645      if (h != (struct aout_link_hash_entry *) NULL
    55545646          && h->indx >= 0)
     
    55615653             symbol.  */
    55625654          h->indx = -2;
    5563           h->written = false;
     5655          h->written = FALSE;
    55645656          if (! aout_link_write_other_symbol (h, (PTR) finfo))
    5565             return false;
     5657            return FALSE;
    55665658          r_index = h->indx;
    55675659        }
     
    55715663                 (finfo->info, pr->u.name, (bfd *) NULL,
    55725664                  (asection *) NULL, (bfd_vma) 0)))
    5573             return false;
     5665            return FALSE;
    55745666          r_index = 0;
    55755667        }
     
    55805672    {
    55815673      bfd_set_error (bfd_error_bad_value);
    5582       return false;
     5674      return FALSE;
    55835675    }
    55845676
     
    55935685    {
    55945686#ifdef MY_put_reloc
    5595       MY_put_reloc(finfo->output_bfd, r_extern, r_index, p->offset, howto,
    5596                    &srel);
     5687      MY_put_reloc (finfo->output_bfd, r_extern, r_index, p->offset, howto,
     5688                    &srel);
    55975689#else
    55985690      {
     
    56035695        int r_length;
    56045696
    5605         r_pcrel = howto->pc_relative;
     5697        r_pcrel = (int) howto->pc_relative;
    56065698        r_baserel = (howto->type & 8) != 0;
    56075699        r_jmptable = (howto->type & 16) != 0;
     
    56505742          bfd_reloc_status_type r;
    56515743          bfd_byte *buf;
    5652           boolean ok;
     5744          bfd_boolean ok;
    56535745
    56545746          size = bfd_get_reloc_size (howto);
    56555747          buf = (bfd_byte *) bfd_zmalloc (size);
    56565748          if (buf == (bfd_byte *) NULL)
    5657             return false;
     5749            return FALSE;
    56585750          r = MY_relocate_contents (howto, finfo->output_bfd,
    5659                                       pr->addend, buf);
     5751                                    (bfd_vma) pr->addend, buf);
    56605752          switch (r)
    56615753            {
     
    56765768                {
    56775769                  free (buf);
    5678                   return false;
     5770                  return FALSE;
    56795771                }
    56805772              break;
    56815773            }
    5682           ok = bfd_set_section_contents (finfo->output_bfd, o,
    5683                                          (PTR) buf,
    5684                                          (file_ptr) p->offset,
    5685                                          size);
     5774          ok = bfd_set_section_contents (finfo->output_bfd, o, (PTR) buf,
     5775                                         (file_ptr) p->offset, size);
    56865776          free (buf);
    56875777          if (! ok)
    5688             return false;
     5778            return FALSE;
    56895779        }
    56905780    }
     
    57165806        }
    57175807
    5718       PUT_WORD (finfo->output_bfd, pr->addend, erel.r_addend);
     5808      PUT_WORD (finfo->output_bfd, (bfd_vma) pr->addend, erel.r_addend);
    57195809#endif /* MY_put_ext_reloc */
    57205810
     
    57225812    }
    57235813
     5814  amt = obj_reloc_entry_size (finfo->output_bfd);
    57245815  if (bfd_seek (finfo->output_bfd, *reloff_ptr, SEEK_SET) != 0
    5725       || (bfd_write (rel_ptr, (bfd_size_type) 1,
    5726                      obj_reloc_entry_size (finfo->output_bfd),
    5727                      finfo->output_bfd)
    5728           != obj_reloc_entry_size (finfo->output_bfd)))
    5729     return false;
     5816      || bfd_bwrite (rel_ptr, amt, finfo->output_bfd) != amt)
     5817    return FALSE;
    57305818
    57315819  *reloff_ptr += obj_reloc_entry_size (finfo->output_bfd);
     
    57385826                      <= obj_datasec (finfo->output_bfd)->rel_filepos)));
    57395827
    5740   return true;
    5741 }
     5828  return TRUE;
     5829}
Note: See TracChangeset for help on using the changeset viewer.