Changeset 618 for trunk/src/binutils/bfd


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

Joined the port of 2.11.2 with 2.14.

Location:
trunk/src/binutils/bfd
Files:
1 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/binutils/bfd/acinclude.m4

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r617 r618  
    124124AC_SUBST(INTLLIBS)
    125125])
     126
     127AC_DEFUN([AM_INSTALL_LIBBFD],
     128[AC_MSG_CHECKING([whether to install libbfd])
     129  AC_ARG_ENABLE(install-libbfd,
     130[  --enable-install-libbfd controls installation of libbfd and related headers],
     131      install_libbfd_p=$enableval,
     132      if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then
     133        install_libbfd_p=yes
     134      else
     135        install_libbfd_p=no
     136      fi)
     137  AC_MSG_RESULT($install_libbfd_p)
     138  AM_CONDITIONAL(INSTALL_LIBBFD, test $install_libbfd_p = yes)
     139  # libbfd.a is a host library containing target dependent code
     140  bfdlibdir='$(libdir)'
     141  bfdincludedir='$(includedir)'
     142  if test "${host}" != "${target}"; then
     143    bfdlibdir='$(exec_prefix)/$(host_alias)/$(target_alias)/lib'
     144    bfdincludedir='$(exec_prefix)/$(host_alias)/$(target_alias)/include'
     145  fi
     146  AC_SUBST(bfdlibdir)
     147  AC_SUBST(bfdincludedir)
     148]
     149)
  • trunk/src/binutils/bfd/aclocal.m4

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r617 r618  
    137137])
    138138
     139AC_DEFUN([AM_INSTALL_LIBBFD],
     140[AC_MSG_CHECKING([whether to install libbfd])
     141  AC_ARG_ENABLE(install-libbfd,
     142[  --enable-install-libbfd controls installation of libbfd and related headers],
     143      install_libbfd_p=$enableval,
     144      if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then
     145        install_libbfd_p=yes
     146      else
     147        install_libbfd_p=no
     148      fi)
     149  AC_MSG_RESULT($install_libbfd_p)
     150  AM_CONDITIONAL(INSTALL_LIBBFD, test $install_libbfd_p = yes)
     151  # libbfd.a is a host library containing target dependent code
     152  bfdlibdir='$(libdir)'
     153  bfdincludedir='$(includedir)'
     154  if test "${host}" != "${target}"; then
     155    bfdlibdir='$(exec_prefix)/$(host_alias)/$(target_alias)/lib'
     156    bfdincludedir='$(exec_prefix)/$(host_alias)/$(target_alias)/include'
     157  fi
     158  AC_SUBST(bfdlibdir)
     159  AC_SUBST(bfdincludedir)
     160]
     161)
     162
     163# Define a conditional.
     164
     165AC_DEFUN([AM_CONDITIONAL],
     166[AC_SUBST($1_TRUE)
     167AC_SUBST($1_FALSE)
     168if $2; then
     169  $1_TRUE=
     170  $1_FALSE='#'
     171else
     172  $1_TRUE='#'
     173  $1_FALSE=
     174fi])
     175
     176#serial 1
     177# This test replaces the one in autoconf.
     178# Currently this macro should have the same name as the autoconf macro
     179# because gettext's gettext.m4 (distributed in the automake package)
     180# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
     181# give these diagnostics:
     182#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
     183#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
     184
     185undefine([AC_ISC_POSIX])
     186
     187AC_DEFUN([AC_ISC_POSIX],
     188  [
     189    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
     190    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
     191  ]
     192)
     193
    139194# Do all the work for Automake.  This macro actually does too much --
    140195# some checks are only needed if your package does certain things.
     
    272327)
    273328
    274 # Define a conditional.
    275 
    276 AC_DEFUN([AM_CONDITIONAL],
    277 [AC_SUBST($1_TRUE)
    278 AC_SUBST($1_FALSE)
    279 if $2; then
    280   $1_TRUE=
    281   $1_FALSE='#'
    282 else
    283   $1_TRUE='#'
    284   $1_FALSE=
    285 fi])
    286 
  • trunk/src/binutils/bfd/aoutx.h

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

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r617 r618  
    11/* BFD back-end for archive files (libraries).
    22   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    3    2000
     3   2000, 2001, 2002
    44   Free Software Foundation, Inc.
    55   Written by Cygnus Support.  Mostly Gumby Henkel-Wallace's fault.
     
    133133#include "aout/ar.h"
    134134#include "aout/ranlib.h"
    135 #include <ctype.h>
     135#include "safe-ctype.h"
    136136
    137137#ifndef errno
     
    141141#ifdef GNU960
    142142#define BFD_GNU960_ARMAG(abfd)  (BFD_COFF_FILE_P((abfd)) ? ARMAG : ARMAGB)
    143 #endif
    144 
    145 /* Define offsetof for those systems which lack it */
    146 
    147 #ifndef offsetof
    148 #define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
    149143#endif
    150144
     
    167161#define arch_hdr(bfd) ((struct ar_hdr *)arch_eltdata(bfd)->arch_header)
    168162
    169 static char *get_extended_arelt_filename PARAMS ((bfd *arch,
    170                                                   const char *name));
    171 static boolean do_slurp_bsd_armap PARAMS ((bfd *abfd));
    172 static boolean do_slurp_coff_armap PARAMS ((bfd *abfd));
    173 static const char *normalize PARAMS ((bfd *, const char *file));
    174 static struct areltdata *bfd_ar_hdr_from_filesystem PARAMS ((bfd *abfd,
    175                                                              const char *,
    176                                                              bfd *member));
    177 
    178 
    179 boolean
     163static char *get_extended_arelt_filename
     164  PARAMS ((bfd *arch, const char *name));
     165static bfd_boolean do_slurp_bsd_armap
     166  PARAMS ((bfd *abfd));
     167static bfd_boolean do_slurp_coff_armap
     168  PARAMS ((bfd *abfd));
     169bfd_boolean bfd_elf64_archive_slurp_armap
     170  PARAMS ((bfd *abfd));
     171static const char *normalize
     172  PARAMS ((bfd *, const char *file));
     173static struct areltdata *bfd_ar_hdr_from_filesystem
     174  PARAMS ((bfd *abfd, const char *, bfd *member));
     175
     176
     177bfd_boolean
    180178_bfd_generic_mkarchive (abfd)
    181179     bfd *abfd;
    182180{
    183   abfd->tdata.aout_ar_data = ((struct artdata *)
    184                               bfd_zalloc (abfd, sizeof (struct artdata)));
    185 
     181  bfd_size_type amt = sizeof (struct artdata);
     182
     183  abfd->tdata.aout_ar_data = (struct artdata *) bfd_zalloc (abfd, amt);
    186184  if (bfd_ardata (abfd) == NULL)
    187     return false;
     185    return FALSE;
    188186
    189187  bfd_ardata (abfd)->cache = NULL;
     
    193191  bfd_ardata (abfd)->tdata = NULL;
    194192
    195   return true;
     193  return TRUE;
    196194}
    197195
     
    254252
    255253SYNOPSIS
    256         boolean bfd_set_archive_head(bfd *output, bfd *new_head);
     254        bfd_boolean bfd_set_archive_head(bfd *output, bfd *new_head);
    257255
    258256DESCRIPTION
     
    261259*/
    262260
    263 boolean
     261bfd_boolean
    264262bfd_set_archive_head (output_archive, new_head)
    265263     bfd *output_archive;
     
    268266
    269267  output_archive->archive_head = new_head;
    270   return true;
     268  return TRUE;
    271269}
    272270
     
    287285
    288286/* Kind of stupid to call cons for each one, but we don't do too many */
    289 boolean
     287bfd_boolean
    290288_bfd_add_bfd_to_archive_cache (arch_bfd, filepos, new_elt)
    291289     bfd *arch_bfd, *new_elt;
    292290     file_ptr filepos;
    293291{
    294   struct ar_cache *new_cache = ((struct ar_cache *)
    295                                 bfd_zalloc (arch_bfd,
    296                                             sizeof (struct ar_cache)));
    297 
     292  bfd_size_type amt = sizeof (struct ar_cache);
     293
     294  struct ar_cache *new_cache = (struct ar_cache *) bfd_zalloc (arch_bfd, amt);
    298295  if (new_cache == NULL)
    299     return false;
     296    return FALSE;
    300297
    301298  new_cache->ptr = filepos;
     
    313310    }
    314311
    315   return true;
     312  return TRUE;
    316313}
    317314
     
    367364  struct ar_hdr hdr;
    368365  char *hdrp = (char *) &hdr;
    369   unsigned int parsed_size;
     366  size_t parsed_size;
    370367  struct areltdata *ared;
    371368  char *filename = NULL;
    372   unsigned int namelen = 0;
    373   unsigned int allocsize = sizeof (struct areltdata) + sizeof (struct ar_hdr);
     369  bfd_size_type namelen = 0;
     370  bfd_size_type allocsize = sizeof (struct areltdata) + sizeof (struct ar_hdr);
    374371  char *allocptr = 0;
    375372
    376   if (bfd_read ((PTR) hdrp, 1, sizeof (struct ar_hdr), abfd)
     373  if (bfd_bread ((PTR) hdrp, (bfd_size_type) sizeof (struct ar_hdr), abfd)
    377374      != sizeof (struct ar_hdr))
    378375    {
     
    417414           && hdr.ar_name[1] == '1'
    418415           && hdr.ar_name[2] == '/'
    419            && isdigit ((unsigned char) hdr.ar_name[3]))
     416           && ISDIGIT (hdr.ar_name[3]))
    420417    {
    421418      /* BSD-4.4 extended name */
     
    430427                  + sizeof (struct areltdata)
    431428                  + sizeof (struct ar_hdr));
    432       if (bfd_read (filename, 1, namelen, abfd) != namelen)
     429      if (bfd_bread (filename, namelen, abfd) != namelen)
    433430        {
    434431          if (bfd_get_error () != bfd_error_system_call)
     
    445442
    446443      char *e;
    447       e = memchr (hdr.ar_name, '\0', ar_maxnamelen (abfd));
     444      e = (char *) memchr (hdr.ar_name, '\0', ar_maxnamelen (abfd));
    448445      if (e == NULL)
    449446        {
    450           e = memchr (hdr.ar_name, '/', ar_maxnamelen (abfd));
     447          e = (char *) memchr (hdr.ar_name, '/', ar_maxnamelen (abfd));
    451448          if (e == NULL)
    452             e = memchr (hdr.ar_name, ' ', ar_maxnamelen (abfd));
     449            e = (char *) memchr (hdr.ar_name, ' ', ar_maxnamelen (abfd));
    453450        }
    454451
     
    485482                                   sizeof (struct ar_hdr));
    486483      if (namelen)
    487         memcpy (ared->filename, hdr.ar_name, namelen);
     484        memcpy (ared->filename, hdr.ar_name, (size_t) namelen);
    488485      ared->filename[namelen] = '\0';
    489486    }
     
    611608  struct artdata *tdata_hold;
    612609  char armag[SARMAG + 1];
    613 
    614   tdata_hold = abfd->tdata.aout_ar_data;
    615 
    616   if (bfd_read ((PTR) armag, 1, SARMAG, abfd) != SARMAG)
     610  bfd_size_type amt;
     611
     612  if (bfd_bread ((PTR) armag, (bfd_size_type) SARMAG, abfd) != SARMAG)
    617613    {
    618614      if (bfd_get_error () != bfd_error_system_call)
     
    630626#endif
    631627
    632   /* We are setting bfd_ardata(abfd) here, but since bfd_ardata
    633      involves a cast, we can't do it as the left operand of assignment.  */
    634   abfd->tdata.aout_ar_data = ((struct artdata *)
    635                               bfd_zalloc (abfd, sizeof (struct artdata)));
    636 
     628  tdata_hold = bfd_ardata (abfd);
     629
     630  amt = sizeof (struct artdata);
     631  bfd_ardata (abfd) = (struct artdata *) bfd_zalloc (abfd, amt);
    637632  if (bfd_ardata (abfd) == NULL)
    638     return NULL;
     633    {
     634      bfd_ardata (abfd) = tdata_hold;
     635      return NULL;
     636    }
    639637
    640638  bfd_ardata (abfd)->first_file_filepos = SARMAG;
     
    645643  bfd_ardata (abfd)->tdata = NULL;
    646644
    647   if (!BFD_SEND (abfd, _bfd_slurp_armap, (abfd)))
    648     {
    649       bfd_release (abfd, bfd_ardata (abfd));
    650       abfd->tdata.aout_ar_data = tdata_hold;
     645  if (!BFD_SEND (abfd, _bfd_slurp_armap, (abfd))
     646      || !BFD_SEND (abfd, _bfd_slurp_extended_name_table, (abfd)))
     647    {
    651648      if (bfd_get_error () != bfd_error_system_call)
    652649        bfd_set_error (bfd_error_wrong_format);
    653       return NULL;
    654     }
    655 
    656   if (!BFD_SEND (abfd, _bfd_slurp_extended_name_table, (abfd)))
    657     {
    658650      bfd_release (abfd, bfd_ardata (abfd));
    659       abfd->tdata.aout_ar_data = tdata_hold;
    660       if (bfd_get_error () != bfd_error_system_call)
    661         bfd_set_error (bfd_error_wrong_format);
     651      bfd_ardata (abfd) = tdata_hold;
    662652      return NULL;
    663653    }
     
    681671      if (first != NULL)
    682672        {
    683           boolean fail;
    684 
    685           first->target_defaulted = false;
    686           fail = false;
     673          bfd_boolean fail;
     674
     675          first->target_defaulted = FALSE;
     676          fail = FALSE;
    687677          if (bfd_check_format (first, bfd_object)
    688678              && first->xvec != abfd->xvec)
    689679            {
     680#if 0
     681              /* We ought to close `first' here, but we can't, because
     682                 we have no way to remove it from the archive cache.
     683                 It's close to impossible to figure out when we can
     684                 release bfd_ardata.  FIXME.  */
    690685              (void) bfd_close (first);
    691686              bfd_release (abfd, bfd_ardata (abfd));
    692               abfd->tdata.aout_ar_data = tdata_hold;
    693               bfd_set_error (bfd_error_wrong_format);
     687#endif
     688              bfd_set_error (bfd_error_wrong_object_format);
     689              bfd_ardata (abfd) = tdata_hold;
    694690              return NULL;
    695691            }
    696 
    697           /* We ought to close first here, but we can't, because we
    698              have no way to remove it from the archive cache.  FIXME.  */
     692          /* And we ought to close `first' here too.  */
    699693        }
    700694    }
     
    706700   support 64 bit archives presently; so far as I know, none actually
    707701   exist.  Supporting them would require changing these constants, and
    708    changing some bfd_h_get_32 to bfd_h_get_64.  */
     702   changing some H_GET_32 to H_GET_64.  */
    709703
    710704/* The size of an external symdef structure.  */
     
    720714#define BSD_STRING_COUNT_SIZE 4
    721715
    722 /* Returns false on error, true otherwise */
    723 
    724 static boolean
     716/* Returns FALSE on error, TRUE otherwise */
     717
     718static bfd_boolean
    725719do_slurp_bsd_armap (abfd)
    726720     bfd *abfd;
     
    731725  struct artdata *ardata = bfd_ardata (abfd);
    732726  char *stringbase;
    733   unsigned int parsed_size;
     727  bfd_size_type parsed_size, amt;
    734728  carsym *set;
    735729
    736730  mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd);
    737731  if (mapdata == NULL)
    738     return false;
     732    return FALSE;
    739733  parsed_size = mapdata->parsed_size;
    740734  bfd_release (abfd, (PTR) mapdata);    /* Don't need it any more.  */
     
    742736  raw_armap = (bfd_byte *) bfd_zalloc (abfd, parsed_size);
    743737  if (raw_armap == (bfd_byte *) NULL)
    744     return false;
    745 
    746   if (bfd_read ((PTR) raw_armap, 1, parsed_size, abfd) != parsed_size)
     738    return FALSE;
     739
     740  if (bfd_bread ((PTR) raw_armap, parsed_size, abfd) != parsed_size)
    747741    {
    748742      if (bfd_get_error () != bfd_error_system_call)
     
    750744    byebye:
    751745      bfd_release (abfd, (PTR) raw_armap);
    752       return false;
    753     }
    754 
    755   ardata->symdef_count = bfd_h_get_32 (abfd, raw_armap) / BSD_SYMDEF_SIZE;
     746      return FALSE;
     747    }
     748
     749  ardata->symdef_count = H_GET_32 (abfd, raw_armap) / BSD_SYMDEF_SIZE;
    756750
    757751  if (ardata->symdef_count * BSD_SYMDEF_SIZE >
     
    768762                + ardata->symdef_count * BSD_SYMDEF_SIZE
    769763                + BSD_STRING_COUNT_SIZE);
    770   ardata->symdefs = (carsym *) bfd_alloc (abfd,
    771                                           (ardata->symdef_count
    772                                            * sizeof (carsym)));
     764  amt = (bfd_size_type) ardata->symdef_count * sizeof (carsym);
     765  ardata->symdefs = (carsym *) bfd_alloc (abfd, amt);
    773766  if (!ardata->symdefs)
    774     return false;
     767    return FALSE;
    775768
    776769  for (counter = 0, set = ardata->symdefs;
     
    778771       counter++, set++, rbase += BSD_SYMDEF_SIZE)
    779772    {
    780       set->name = bfd_h_get_32 (abfd, rbase) + stringbase;
    781       set->file_offset = bfd_h_get_32 (abfd, rbase + BSD_SYMDEF_OFFSET_SIZE);
     773      set->name = H_GET_32 (abfd, rbase) + stringbase;
     774      set->file_offset = H_GET_32 (abfd, rbase + BSD_SYMDEF_OFFSET_SIZE);
    782775    }
    783776
     
    788781     we are done using the strings from it.  For now, it seems
    789782     to be allocated on an objalloc anyway...  */
    790   bfd_has_map (abfd) = true;
    791   return true;
    792 }
    793 
    794 /* Returns false on error, true otherwise.  */
    795 
    796 static boolean
     783  bfd_has_map (abfd) = TRUE;
     784  return TRUE;
     785}
     786
     787/* Returns FALSE on error, TRUE otherwise.  */
     788
     789static bfd_boolean
    797790do_slurp_coff_armap (abfd)
    798791     bfd *abfd;
     
    802795  struct artdata *ardata = bfd_ardata (abfd);
    803796  char *stringbase;
    804   unsigned int stringsize;
     797  bfd_size_type stringsize;
    805798  unsigned int parsed_size;
    806799  carsym *carsyms;
    807   unsigned int nsymz;           /* Number of symbols in armap.  */
     800  bfd_size_type nsymz;          /* Number of symbols in armap.  */
    808801  bfd_vma (*swap) PARAMS ((const bfd_byte *));
    809802  char int_buf[sizeof (long)];
    810   unsigned int carsym_size, ptrsize, i;
     803  bfd_size_type carsym_size, ptrsize;
     804  unsigned int i;
    811805
    812806  mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd);
    813807  if (mapdata == NULL)
    814     return false;
     808    return FALSE;
    815809  parsed_size = mapdata->parsed_size;
    816810  bfd_release (abfd, (PTR) mapdata);    /* Don't need it any more.  */
    817811
    818   if (bfd_read ((PTR) int_buf, 1, 4, abfd) != 4)
     812  if (bfd_bread ((PTR) int_buf, (bfd_size_type) 4, abfd) != 4)
    819813    {
    820814      if (bfd_get_error () != bfd_error_system_call)
    821815        bfd_set_error (bfd_error_malformed_archive);
    822       return false;
     816      return FALSE;
    823817    }
    824818  /* It seems that all numeric information in a coff archive is always
     
    853847  ardata->symdefs = (carsym *) bfd_zalloc (abfd, carsym_size + stringsize + 1);
    854848  if (ardata->symdefs == NULL)
    855     return false;
     849    return FALSE;
    856850  carsyms = ardata->symdefs;
    857851  stringbase = ((char *) ardata->symdefs) + carsym_size;
     
    861855  if (raw_armap == NULL)
    862856    goto release_symdefs;
    863   if (bfd_read ((PTR) raw_armap, 1, ptrsize, abfd) != ptrsize
    864       || bfd_read ((PTR) stringbase, 1, stringsize, abfd) != stringsize)
     857  if (bfd_bread ((PTR) raw_armap, ptrsize, abfd) != ptrsize
     858      || (bfd_bread ((PTR) stringbase, stringsize, abfd) != stringsize))
    865859    {
    866860      if (bfd_get_error () != bfd_error_system_call)
     
    885879  ardata->first_file_filepos += (ardata->first_file_filepos) % 2;
    886880
    887   bfd_has_map (abfd) = true;
     881  bfd_has_map (abfd) = TRUE;
    888882  bfd_release (abfd, (PTR) raw_armap);
    889883
     
    892886    struct areltdata *tmp;
    893887
    894     bfd_seek (abfd,   ardata->first_file_filepos, SEEK_SET);
     888    bfd_seek (abfd, ardata->first_file_filepos, SEEK_SET);
    895889    tmp = (struct areltdata *) _bfd_read_ar_hdr (abfd);
    896890    if (tmp != NULL)
     
    900894          {
    901895            ardata->first_file_filepos +=
    902               (tmp->parsed_size + sizeof (struct ar_hdr) + 1) & ~1;
     896              (tmp->parsed_size + sizeof (struct ar_hdr) + 1) & ~(unsigned) 1;
    903897          }
    904898        bfd_release (abfd, tmp);
     
    906900  }
    907901
    908   return true;
     902  return TRUE;
    909903
    910904release_raw_armap:
     
    912906release_symdefs:
    913907  bfd_release (abfd, (PTR) (ardata)->symdefs);
    914   return false;
     908  return FALSE;
    915909}
    916910
    917911/* This routine can handle either coff-style or bsd-style armaps.
    918    Returns false on error, true otherwise */
    919 
    920 boolean
     912   Returns FALSE on error, TRUE otherwise */
     913
     914bfd_boolean
    921915bfd_slurp_armap (abfd)
    922916     bfd *abfd;
    923917{
    924918  char nextname[17];
    925   int i = bfd_read ((PTR) nextname, 1, 16, abfd);
     919  int i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd);
    926920
    927921  if (i == 0)
    928     return true;
     922    return TRUE;
    929923  if (i != 16)
    930     return false;
    931 
    932   if (bfd_seek (abfd, (file_ptr) - 16, SEEK_CUR) != 0)
    933     return false;
     924    return FALSE;
     925
     926  if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0)
     927    return FALSE;
    934928
    935929  if (!strncmp (nextname, "__.SYMDEF       ", 16)
     
    940934  else if (!strncmp (nextname, "/SYM64/         ", 16))
    941935    {
    942       /* Irix 6 archive--must be recognized by code in elf64-mips.c.  */
     936      /* 64bit ELF (Irix 6) archive.  */
     937#ifdef BFD64
     938      return bfd_elf64_archive_slurp_armap (abfd);
     939#else
    943940      bfd_set_error (bfd_error_wrong_format);
    944       return false;
    945     }
    946 
    947   bfd_has_map (abfd) = false;
    948   return true;
    949 }
    950 
    951 
    952 /* Returns false on error, true otherwise */
     941      return FALSE;
     942#endif
     943    }
     944
     945  bfd_has_map (abfd) = FALSE;
     946  return TRUE;
     947}
     948
     949
     950/* Returns FALSE on error, TRUE otherwise */
    953951/* flavor 2 of a bsd armap, similar to bfd_slurp_bsd_armap except the
    954952   header is in a slightly different order and the map name is '/'.
     
    957955#define HPUX_SYMDEF_COUNT_SIZE 2
    958956
    959 boolean
     957bfd_boolean
    960958bfd_slurp_bsd_armap_f2 (abfd)
    961959     bfd *abfd;
     
    968966  char *stringbase;
    969967  unsigned int stringsize;
     968  bfd_size_type amt;
    970969  carsym *set;
    971   int i = bfd_read ((PTR) nextname, 1, 16, abfd);
     970  int i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd);
    972971
    973972  if (i == 0)
    974     return true;
     973    return TRUE;
    975974  if (i != 16)
    976     return false;
     975    return FALSE;
    977976
    978977  /* The archive has at least 16 bytes in it.  */
    979   if (bfd_seek (abfd, -16L, SEEK_CUR) != 0)
    980     return false;
     978  if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0)
     979    return FALSE;
    981980
    982981  if (!strncmp (nextname, "__.SYMDEF       ", 16)
     
    986985  if (strncmp (nextname, "/               ", 16))
    987986    {
    988       bfd_has_map (abfd) = false;
    989       return true;
     987      bfd_has_map (abfd) = FALSE;
     988      return TRUE;
    990989    }
    991990
    992991  mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd);
    993992  if (mapdata == NULL)
    994     return false;
    995 
    996   raw_armap = (bfd_byte *) bfd_zalloc (abfd, mapdata->parsed_size);
     993    return FALSE;
     994
     995  amt = mapdata->parsed_size;
     996  raw_armap = (bfd_byte *) bfd_zalloc (abfd, amt);
    997997  if (raw_armap == NULL)
    998998    {
    999999    byebye:
    10001000      bfd_release (abfd, (PTR) mapdata);
    1001       return false;
    1002     }
    1003 
    1004   if (bfd_read ((PTR) raw_armap, 1, mapdata->parsed_size, abfd) !=
    1005       mapdata->parsed_size)
     1001      return FALSE;
     1002    }
     1003
     1004  if (bfd_bread ((PTR) raw_armap, amt, abfd) != amt)
    10061005    {
    10071006      if (bfd_get_error () != bfd_error_system_call)
     
    10121011    }
    10131012
    1014   ardata->symdef_count = bfd_h_get_16 (abfd, (PTR) raw_armap);
     1013  ardata->symdef_count = H_GET_16 (abfd, (PTR) raw_armap);
    10151014
    10161015  if (ardata->symdef_count * BSD_SYMDEF_SIZE
     
    10241023  ardata->cache = 0;
    10251024
    1026   stringsize = bfd_h_get_32 (abfd, raw_armap + HPUX_SYMDEF_COUNT_SIZE);
     1025  stringsize = H_GET_32 (abfd, raw_armap + HPUX_SYMDEF_COUNT_SIZE);
    10271026  /* Skip sym count and string sz.  */
    10281027  stringbase = ((char *) raw_armap
     
    10301029                + BSD_STRING_COUNT_SIZE);
    10311030  rbase = (bfd_byte *) stringbase + stringsize;
    1032   ardata->symdefs = (carsym *) bfd_alloc (abfd,
    1033                                           (ardata->symdef_count
    1034                                            * BSD_SYMDEF_SIZE));
     1031  amt = (bfd_size_type) ardata->symdef_count * BSD_SYMDEF_SIZE;
     1032  ardata->symdefs = (carsym *) bfd_alloc (abfd, amt);
    10351033  if (!ardata->symdefs)
    1036     return false;
     1034    return FALSE;
    10371035
    10381036  for (counter = 0, set = ardata->symdefs;
     
    10401038       counter++, set++, rbase += BSD_SYMDEF_SIZE)
    10411039    {
    1042       set->name = bfd_h_get_32 (abfd, rbase) + stringbase;
    1043       set->file_offset = bfd_h_get_32 (abfd, rbase + BSD_SYMDEF_OFFSET_SIZE);
     1040      set->name = H_GET_32 (abfd, rbase) + stringbase;
     1041      set->file_offset = H_GET_32 (abfd, rbase + BSD_SYMDEF_OFFSET_SIZE);
    10441042    }
    10451043
     
    10501048     we are done using the strings from it.  For now, it seems
    10511049     to be allocated on an objalloc anyway...  */
    1052   bfd_has_map (abfd) = true;
    1053   return true;
     1050  bfd_has_map (abfd) = TRUE;
     1051  return TRUE;
    10541052}
    10551053
     
    10651063  extended the format by using the prefix // for the special element.  */
    10661064
    1067 /* Returns false on error, true otherwise.  */
    1068 
    1069 boolean
     1065/* Returns FALSE on error, TRUE otherwise.  */
     1066
     1067bfd_boolean
    10701068_bfd_slurp_extended_name_table (abfd)
    10711069     bfd *abfd;
     
    10731071  char nextname[17];
    10741072  struct areltdata *namedata;
     1073  bfd_size_type amt;
    10751074
    10761075  /* FIXME:  Formatting sucks here, and in case of failure of BFD_READ,
    1077      we probably don't want to return true.  */
     1076     we probably don't want to return TRUE.  */
    10781077  bfd_seek (abfd, bfd_ardata (abfd)->first_file_filepos, SEEK_SET);
    1079   if (bfd_read ((PTR) nextname, 1, 16, abfd) == 16)
    1080     {
    1081       if (bfd_seek (abfd, (file_ptr) - 16, SEEK_CUR) != 0)
    1082         return false;
     1078  if (bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd) == 16)
     1079    {
     1080      if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0)
     1081        return FALSE;
    10831082
    10841083      if (strncmp (nextname, "ARFILENAMES/    ", 16) != 0 &&
     
    10861085        {
    10871086          bfd_ardata (abfd)->extended_names = NULL;
    1088           return true;
     1087          return TRUE;
    10891088        }
    10901089
    10911090      namedata = (struct areltdata *) _bfd_read_ar_hdr (abfd);
    10921091      if (namedata == NULL)
    1093         return false;
    1094 
    1095       bfd_ardata (abfd)->extended_names =
    1096         bfd_zalloc (abfd, namedata->parsed_size);
     1092        return FALSE;
     1093
     1094      amt = namedata->parsed_size;
     1095      bfd_ardata (abfd)->extended_names = bfd_zalloc (abfd, amt);
    10971096      if (bfd_ardata (abfd)->extended_names == NULL)
    10981097        {
    10991098        byebye:
    11001099          bfd_release (abfd, (PTR) namedata);
    1101           return false;
     1100          return FALSE;
    11021101        }
    11031102
    1104       if (bfd_read ((PTR) bfd_ardata (abfd)->extended_names, 1,
    1105                     namedata->parsed_size, abfd) != namedata->parsed_size)
     1103      if (bfd_bread ((PTR) bfd_ardata (abfd)->extended_names, amt, abfd) != amt)
    11061104        {
    11071105          if (bfd_get_error () != bfd_error_system_call)
     
    11401138#endif
    11411139    }
    1142   return true;
     1140  return TRUE;
    11431141}
    11441142
     
    11531151     const char *file;
    11541152{
    1155   CONST char *first;
    1156   CONST char *last;
     1153  const char *first;
     1154  const char *last;
    11571155  char *copy;
    11581156
     
    11721170    }
    11731171
    1174   copy = (char *) bfd_alloc (abfd, last - first + 1);
     1172  copy = (char *) bfd_alloc (abfd, (bfd_size_type) (last - first + 1));
    11751173  if (copy == NULL)
    11761174    return NULL;
     
    12101208/* Build a BFD style extended name table.  */
    12111209
    1212 boolean
     1210bfd_boolean
    12131211_bfd_archive_bsd_construct_extended_name_table (abfd, tabloc, tablen, name)
    12141212     bfd *abfd;
     
    12181216{
    12191217  *name = "ARFILENAMES/";
    1220   return _bfd_construct_extended_name_table (abfd, false, tabloc, tablen);
     1218  return _bfd_construct_extended_name_table (abfd, FALSE, tabloc, tablen);
    12211219}
    12221220
    12231221/* Build an SVR4 style extended name table.  */
    12241222
    1225 boolean
     1223bfd_boolean
    12261224_bfd_archive_coff_construct_extended_name_table (abfd, tabloc, tablen, name)
    12271225     bfd *abfd;
     
    12311229{
    12321230  *name = "//";
    1233   return _bfd_construct_extended_name_table (abfd, true, tabloc, tablen);
     1231  return _bfd_construct_extended_name_table (abfd, TRUE, tabloc, tablen);
    12341232}
    12351233
     
    12381236   table, and in tablen the length of the table.  If it makes an entry
    12391237   it clobbers the filename so that the element may be written without
    1240    further massage.  Returns true if it ran successfully, false if
     1238   further massage.  Returns TRUE if it ran successfully, FALSE if
    12411239   something went wrong.  A successful return may still involve a
    12421240   zero-length tablen!  */
    12431241
    1244 boolean
     1242bfd_boolean
    12451243_bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen)
    12461244     bfd *abfd;
    1247      boolean trailing_slash;
     1245     bfd_boolean trailing_slash;
    12481246     char **tabloc;
    12491247     bfd_size_type *tablen;
    12501248{
    12511249  unsigned int maxname = abfd->xvec->ar_max_namelen;
    1252   unsigned int total_namelen = 0;
     1250  bfd_size_type total_namelen = 0;
    12531251  bfd *current;
    12541252  char *strptr;
     
    12641262      normal = normalize (current, current->filename);
    12651263      if (normal == NULL)
    1266         return false;
     1264        return FALSE;
    12671265
    12681266      thislen = strlen (normal);
     
    13001298
    13011299  if (total_namelen == 0)
    1302     return true;
     1300    return TRUE;
    13031301
    13041302  *tabloc = bfd_zalloc (abfd, total_namelen);
    13051303  if (*tabloc == NULL)
    1306     return false;
     1304    return FALSE;
    13071305
    13081306  *tablen = total_namelen;
     
    13171315      normal = normalize (current, current->filename);
    13181316      if (normal == NULL)
    1319         return false;
     1317        return FALSE;
    13201318
    13211319      thislen = strlen (normal);
     
    13521350    }
    13531351
    1354   return true;
     1352  return TRUE;
    13551353}
    13561354
     
    13991397  struct ar_hdr *hdr;
    14001398  char *temp, *temp1;
     1399  bfd_size_type amt;
    14011400
    14021401  if (member && (member->flags & BFD_IN_MEMORY) != 0)
     
    14161415    }
    14171416
    1418   ared = (struct areltdata *) bfd_zalloc (abfd, sizeof (struct ar_hdr) +
    1419                                           sizeof (struct areltdata));
     1417  amt = sizeof (struct ar_hdr) + sizeof (struct areltdata);
     1418  ared = (struct areltdata *) bfd_zalloc (abfd, amt);
    14201419  if (ared == NULL)
    14211420    return NULL;
     
    14691468   stronger stomach to try to code around such a thing!  */
    14701469
    1471 struct ar_hdr *bfd_special_undocumented_glue PARAMS ((bfd *, const char *));
     1470struct ar_hdr *bfd_special_undocumented_glue
     1471  PARAMS ((bfd *, const char *));
    14721472
    14731473struct ar_hdr *
     
    15441544bfd_dont_truncate_arname (abfd, pathname, arhdr)
    15451545     bfd *abfd;
    1546      CONST char *pathname;
     1546     const char *pathname;
    15471547     char *arhdr;
    15481548{
     
    15841584bfd_bsd_truncate_arname (abfd, pathname, arhdr)
    15851585     bfd *abfd;
    1586      CONST char *pathname;
     1586     const char *pathname;
    15871587     char *arhdr;
    15881588{
    15891589  struct ar_hdr *hdr = (struct ar_hdr *) arhdr;
    1590   int length;
    1591   CONST char *filename = strrchr (pathname, '/');
    1592   int maxlen = ar_maxnamelen (abfd);
     1590  size_t length;
     1591  const char *filename = strrchr (pathname, '/');
     1592  size_t maxlen = ar_maxnamelen (abfd);
    15931593
    15941594#ifdef HAVE_DOS_BASED_FILE_SYSTEM
     
    16351635bfd_gnu_truncate_arname (abfd, pathname, arhdr)
    16361636     bfd *abfd;
    1637      CONST char *pathname;
     1637     const char *pathname;
    16381638     char *arhdr;
    16391639{
    16401640  struct ar_hdr *hdr = (struct ar_hdr *) arhdr;
    1641   int length;
    1642   CONST char *filename = strrchr (pathname, '/');
    1643   int maxlen = ar_maxnamelen (abfd);
     1641  size_t length;
     1642  const char *filename = strrchr (pathname, '/');
     1643  size_t maxlen = ar_maxnamelen (abfd);
    16441644
    16451645#ifdef HAVE_DOS_BASED_FILE_SYSTEM
     
    16811681/* The BFD is open for write and has its format set to bfd_archive.  */
    16821682
    1683 boolean
     1683bfd_boolean
    16841684_bfd_write_archive_contents (arch)
    16851685     bfd *arch;
     
    16891689  bfd_size_type elength = 0;
    16901690  const char *ename = NULL;
    1691   boolean makemap = bfd_has_map (arch);
    1692   boolean hasobjects = false;   /* If no .o's, don't bother to make a map.  */
     1691  bfd_boolean makemap = bfd_has_map (arch);
     1692  /* If no .o's, don't bother to make a map.  */
     1693  bfd_boolean hasobjects = FALSE;
    16931694  bfd_size_type wrote;
    16941695  unsigned int i;
     
    17081709        {
    17091710          bfd_set_error (bfd_error_invalid_operation);
    1710           return false;
     1711          return FALSE;
    17111712        }
    17121713      if (!current->arelt_data)
     
    17151716            (PTR) bfd_ar_hdr_from_filesystem (arch, current->filename, current);
    17161717          if (!current->arelt_data)
    1717             return false;
     1718            return FALSE;
    17181719
    17191720          /* Put in the file name.  */
     
    17301731#endif
    17311732            )
    1732             hasobjects = true;
     1733            hasobjects = TRUE;
    17331734        }
    17341735    }
     
    17361737  if (!BFD_SEND (arch, _bfd_construct_extended_name_table,
    17371738                 (arch, &etable, &elength, &ename)))
    1738     return false;
     1739    return FALSE;
    17391740
    17401741  if (bfd_seek (arch, (file_ptr) 0, SEEK_SET) != 0)
    1741     return false;
     1742    return FALSE;
    17421743#ifdef GNU960
    1743   wrote = bfd_write (BFD_GNU960_ARMAG (arch), 1, SARMAG, arch);
     1744  wrote = bfd_bwrite (BFD_GNU960_ARMAG (arch), (bfd_size_type) SARMAG, arch);
    17441745#else
    1745   wrote = bfd_write (ARMAG, 1, SARMAG, arch);
     1746  wrote = bfd_bwrite (ARMAG, (bfd_size_type) SARMAG, arch);
    17461747#endif
    17471748  if (wrote != SARMAG)
    1748     return false;
     1749    return FALSE;
    17491750
    17501751  if (makemap && hasobjects)
    17511752    {
    1752       if (_bfd_compute_and_write_armap (arch, elength) != true)
    1753         return false;
     1753      if (! _bfd_compute_and_write_armap (arch, (unsigned int) elength))
     1754        return FALSE;
    17541755    }
    17551756
     
    17621763      /* Round size up to even number in archive header.  */
    17631764      sprintf (&(hdr.ar_size[0]), "%-10d",
    1764                (int) ((elength + 1) & ~1));
     1765               (int) ((elength + 1) & ~(bfd_size_type) 1));
    17651766      strncpy (hdr.ar_fmag, ARFMAG, 2);
    17661767      for (i = 0; i < sizeof (struct ar_hdr); i++)
    17671768        if (((char *) (&hdr))[i] == '\0')
    17681769          (((char *) (&hdr))[i]) = ' ';
    1769       if ((bfd_write ((char *) &hdr, 1, sizeof (struct ar_hdr), arch)
     1770      if ((bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch)
    17701771           != sizeof (struct ar_hdr))
    1771           || bfd_write (etable, 1, elength, arch) != elength)
    1772         return false;
     1772          || bfd_bwrite (etable, elength, arch) != elength)
     1773        return FALSE;
    17731774      if ((elength % 2) == 1)
    17741775        {
    1775           if (bfd_write ("\012", 1, 1, arch) != 1)
    1776             return false;
     1776          if (bfd_bwrite ("\012", (bfd_size_type) 1, arch) != 1)
     1777            return FALSE;
    17771778        }
    17781779    }
     
    17851786
    17861787      /* Write ar header.  */
    1787       if (bfd_write ((char *) hdr, 1, sizeof (*hdr), arch) != sizeof (*hdr))
    1788         return false;
     1788      if (bfd_bwrite ((PTR) hdr, (bfd_size_type) sizeof (*hdr), arch)
     1789          != sizeof (*hdr))
     1790        return FALSE;
    17891791      if (bfd_seek (current, (file_ptr) 0, SEEK_SET) != 0)
    1790         return false;
     1792        return FALSE;
    17911793      while (remaining)
    17921794        {
     
    17951797            amt = remaining;
    17961798          errno = 0;
    1797           if (bfd_read (buffer, amt, 1, current) != amt)
     1799          if (bfd_bread (buffer, (bfd_size_type) amt, current) != amt)
    17981800            {
    17991801              if (bfd_get_error () != bfd_error_system_call)
    18001802                bfd_set_error (bfd_error_malformed_archive);
    1801               return false;
     1803              return FALSE;
    18021804            }
    1803           if (bfd_write (buffer, amt, 1, arch) != amt)
    1804             return false;
     1805          if (bfd_bwrite (buffer, (bfd_size_type) amt, arch) != amt)
     1806            return FALSE;
    18051807          remaining -= amt;
    18061808        }
    18071809      if ((arelt_size (current) % 2) == 1)
    18081810        {
    1809           if (bfd_write ("\012", 1, 1, arch) != 1)
    1810             return false;
     1811          if (bfd_bwrite ("\012", (bfd_size_type) 1, arch) != 1)
     1812            return FALSE;
    18111813        }
    18121814    }
     
    18311833    }
    18321834
    1833   return true;
     1835  return TRUE;
    18341836}
    18351837
     
    18371839/* Note that the namidx for the first symbol is 0.  */
    18381840
    1839 boolean
     1841bfd_boolean
    18401842_bfd_compute_and_write_armap (arch, elength)
    18411843     bfd *arch;
     
    18461848  file_ptr elt_no = 0;
    18471849  struct orl *map = NULL;
    1848   int orl_max = 1024;           /* fine initial default */
    1849   int orl_count = 0;
     1850  unsigned int orl_max = 1024;          /* fine initial default */
     1851  unsigned int orl_count = 0;
    18501852  int stridx = 0;               /* string index */
    18511853  asymbol **syms = NULL;
    18521854  long syms_max = 0;
    1853   boolean ret;
     1855  bfd_boolean ret;
     1856  bfd_size_type amt;
    18541857
    18551858  /* Dunno if this is the best place for this info...  */
     
    18581861  elength += elength % 2;
    18591862
    1860   map = (struct orl *) bfd_malloc (orl_max * sizeof (struct orl));
     1863  amt = (bfd_size_type) orl_max * sizeof (struct orl);
     1864  map = (struct orl *) bfd_malloc (amt);
    18611865  if (map == NULL)
    18621866    goto error_return;
     
    18641868  /* We put the symbol names on the arch objalloc, and then discard
    18651869     them when done.  */
    1866   first_name = bfd_alloc (arch, 1);
     1870  first_name = bfd_alloc (arch, (bfd_size_type) 1);
    18671871  if (first_name == NULL)
    18681872    goto error_return;
     
    18781882       current = current->next, elt_no++)
    18791883    {
    1880       if ((bfd_check_format (current, bfd_object) == true)
    1881           && ((bfd_get_file_flags (current) & HAS_SYMS)))
     1884      if (bfd_check_format (current, bfd_object)
     1885          && (bfd_get_file_flags (current) & HAS_SYMS) != 0)
    18821886        {
    18831887          long storage;
     
    18961900                    free (syms);
    18971901                  syms_max = storage;
    1898                   syms = (asymbol **) bfd_malloc ((size_t) syms_max);
     1902                  syms = (asymbol **) bfd_malloc ((bfd_size_type) syms_max);
    18991903                  if (syms == NULL)
    19001904                    goto error_return;
     
    19201924                      && ! bfd_is_und_section (sec))
    19211925                    {
    1922                       size_t namelen;
     1926                      bfd_size_type namelen;
    19231927                      struct orl *new_map;
    19241928
     
    19271931                        {
    19281932                          orl_max *= 2;
    1929                           new_map =
    1930                             ((struct orl *)
    1931                              bfd_realloc (map, orl_max * sizeof (struct orl)));
     1933                          amt = (bfd_size_type) orl_max * sizeof (struct orl);
     1934                          new_map = (struct orl *) bfd_realloc (map, amt);
    19321935                          if (new_map == (struct orl *) NULL)
    19331936                            goto error_return;
     
    19371940
    19381941                      namelen = strlen (syms[src_count]->name);
    1939                       map[orl_count].name = ((char **)
    1940                                              bfd_alloc (arch,
    1941                                                         sizeof (char *)));
     1942                      amt = sizeof (char *);
     1943                      map[orl_count].name = (char **) bfd_alloc (arch, amt);
    19421944                      if (map[orl_count].name == NULL)
    19431945                        goto error_return;
     
    19461948                        goto error_return;
    19471949                      strcpy (*(map[orl_count].name), syms[src_count]->name);
    1948                       (map[orl_count]).pos = (file_ptr) current;
    1949                       (map[orl_count]).namidx = stridx;
     1950                      map[orl_count].u.abfd = current;
     1951                      map[orl_count].namidx = stridx;
    19501952
    19511953                      stridx += namelen + 1;
     
    19831985    bfd_release (arch, first_name);
    19841986
    1985   return false;
    1986 }
    1987 
    1988 boolean
     1987  return FALSE;
     1988}
     1989
     1990bfd_boolean
    19891991bsd_write_armap (arch, elength, map, orl_count, stridx)
    19901992     bfd *arch;
     
    20252027    if (((char *) (&hdr))[i] == '\0')
    20262028      (((char *) (&hdr))[i]) = ' ';
    2027   if (bfd_write ((char *) &hdr, 1, sizeof (struct ar_hdr), arch)
     2029  if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch)
    20282030      != sizeof (struct ar_hdr))
    2029     return false;
    2030   bfd_h_put_32 (arch, (bfd_vma) ranlibsize, temp);
    2031   if (bfd_write (temp, 1, sizeof (temp), arch) != sizeof (temp))
    2032     return false;
     2031    return FALSE;
     2032  H_PUT_32 (arch, ranlibsize, temp);
     2033  if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), arch) != sizeof (temp))
     2034    return FALSE;
    20332035
    20342036  for (count = 0; count < orl_count; count++)
     
    20362038      bfd_byte buf[BSD_SYMDEF_SIZE];
    20372039
    2038       if (((bfd *) (map[count]).pos) != last_elt)
     2040      if (map[count].u.abfd != last_elt)
    20392041        {
    20402042          do
     
    20442046              current = current->next;
    20452047            }
    2046           while (current != (bfd *) (map[count]).pos);
     2048          while (current != map[count].u.abfd);
    20472049        }                       /* if new archive element */
    20482050
    20492051      last_elt = current;
    2050       bfd_h_put_32 (arch, map[count].namidx, buf);
    2051       bfd_h_put_32 (arch, firstreal, buf + BSD_SYMDEF_OFFSET_SIZE);
    2052       if (bfd_write (buf, BSD_SYMDEF_SIZE, 1, arch) != BSD_SYMDEF_SIZE)
    2053         return false;
     2052      H_PUT_32 (arch, map[count].namidx, buf);
     2053      H_PUT_32 (arch, firstreal, buf + BSD_SYMDEF_OFFSET_SIZE);
     2054      if (bfd_bwrite (buf, (bfd_size_type) BSD_SYMDEF_SIZE, arch)
     2055          != BSD_SYMDEF_SIZE)
     2056        return FALSE;
    20542057    }
    20552058
    20562059  /* Now write the strings themselves.  */
    2057   bfd_h_put_32 (arch, stringsize, temp);
    2058   if (bfd_write (temp, 1, sizeof (temp), arch) != sizeof (temp))
    2059     return false;
     2060  H_PUT_32 (arch, stringsize, temp);
     2061  if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), arch) != sizeof (temp))
     2062    return FALSE;
    20602063  for (count = 0; count < orl_count; count++)
    20612064    {
    20622065      size_t len = strlen (*map[count].name) + 1;
    20632066
    2064       if (bfd_write (*map[count].name, 1, len, arch) != len)
    2065         return false;
     2067      if (bfd_bwrite (*map[count].name, (bfd_size_type) len, arch) != len)
     2068        return FALSE;
    20662069    }
    20672070
     
    20702073  if (padit)
    20712074    {
    2072       if (bfd_write ("", 1, 1, arch) != 1)
    2073         return false;
    2074     }
    2075 
    2076   return true;
     2075      if (bfd_bwrite ("", (bfd_size_type) 1, arch) != 1)
     2076        return FALSE;
     2077    }
     2078
     2079  return TRUE;
    20772080}
    20782081
     
    20802083   file, so the linker will accept it.
    20812084
    2082    Return true if the timestamp was OK, or an unusual problem happened.
    2083    Return false if we updated the timestamp.  */
    2084 
    2085 boolean
     2085   Return TRUE if the timestamp was OK, or an unusual problem happened.
     2086   Return FALSE if we updated the timestamp.  */
     2087
     2088bfd_boolean
    20862089_bfd_archive_bsd_update_armap_timestamp (arch)
    20872090     bfd *arch;
     
    20962099  if (bfd_stat (arch, &archstat) == -1)
    20972100    {
    2098       perror (_("Reading archive file mod timestamp"));
     2101      bfd_perror (_("Reading archive file mod timestamp"));
    20992102
    21002103      /* Can't read mod time for some reason.  */
    2101       return true;
     2104      return TRUE;
    21022105    }
    21032106  if (archstat.st_mtime <= bfd_ardata (arch)->armap_timestamp)
    21042107    /* OK by the linker's rules.  */
    2105     return true;
     2108    return TRUE;
    21062109
    21072110  /* Update the timestamp.  */
     
    21192122                                      + offsetof (struct ar_hdr, ar_date[0]));
    21202123  if (bfd_seek (arch, bfd_ardata (arch)->armap_datepos, SEEK_SET) != 0
    2121       || (bfd_write (hdr.ar_date, sizeof (hdr.ar_date), 1, arch)
     2124      || (bfd_bwrite (hdr.ar_date, (bfd_size_type) sizeof (hdr.ar_date), arch)
    21222125          != sizeof (hdr.ar_date)))
    21232126    {
    2124       /* FIXME: bfd can't call perror.  */
    2125       perror (_("Writing updated armap timestamp"));
     2127      bfd_perror (_("Writing updated armap timestamp"));
    21262128
    21272129      /* Some error while writing.  */
    2128       return true;
     2130      return TRUE;
    21292131    }
    21302132
    21312133  /* We updated the timestamp successfully.  */
    2132   return false;
     2134  return FALSE;
    21332135}
    21342136
     
    21482150*/
    21492151
    2150 boolean
     2152bfd_boolean
    21512153coff_write_armap (arch, elength, map, symbol_count, stridx)
    21522154     bfd *arch;
     
    21572159{
    21582160  /* The size of the ranlib is the number of exported symbols in the
    2159      archive * the number of bytes in a int, + an int for the count.  */
     2161     archive * the number of bytes in an int, + an int for the count.  */
    21602162  unsigned int ranlibsize = (symbol_count * 4) + 4;
    21612163  unsigned int stringsize = stridx;
    21622164  unsigned int mapsize = stringsize + ranlibsize;
    2163   file_ptr archive_member_file_ptr;
     2165  unsigned int archive_member_file_ptr;
    21642166  bfd *current = arch->archive_head;
    21652167  unsigned int count;
     
    21932195  /* Write the ar header for this item and the number of symbols.  */
    21942196
    2195   if (bfd_write ((PTR) &hdr, 1, sizeof (struct ar_hdr), arch)
     2197  if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch)
    21962198      != sizeof (struct ar_hdr))
    2197     return false;
    2198 
    2199   bfd_write_bigendian_4byte_int (arch, symbol_count);
     2199    return FALSE;
     2200
     2201  if (!bfd_write_bigendian_4byte_int (arch, symbol_count))
     2202    return FALSE;
    22002203
    22012204  /* Two passes, first write the file offsets for each symbol -
     
    22122215         out the object file's address in the archive.  */
    22132216
    2214       while (count < symbol_count && ((bfd *) (map[count]).pos) == current)
     2217      while (count < symbol_count && map[count].u.abfd == current)
    22152218        {
    2216           bfd_write_bigendian_4byte_int (arch, archive_member_file_ptr);
     2219          if (!bfd_write_bigendian_4byte_int (arch, archive_member_file_ptr))
     2220            return FALSE;
    22172221          count++;
    22182222        }
     
    22302234      size_t len = strlen (*map[count].name) + 1;
    22312235
    2232       if (bfd_write (*map[count].name, 1, len, arch) != len)
    2233         return false;
     2236      if (bfd_bwrite (*map[count].name, (bfd_size_type) len, arch) != len)
     2237        return FALSE;
    22342238    }
    22352239
     
    22382242  if (padit)
    22392243    {
    2240       if (bfd_write ("", 1, 1, arch) != 1)
    2241         return false;
    2242     }
    2243 
    2244   return true;
    2245 }
     2244      if (bfd_bwrite ("", (bfd_size_type) 1, arch) != 1)
     2245        return FALSE;
     2246    }
     2247
     2248  return TRUE;
     2249}
  • trunk/src/binutils/bfd/bfd-in2.h

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r617 r618  
     1/* DO NOT EDIT!  -*- buffer-read-only: t -*-  This file is automatically
     2   generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
     3   "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
     4   "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
     5   "linker.c" and "simple.c".
     6   Run "make headers" in your build bfd/ to regenerate.  */
     7
    18/* Main header file for the bfd library -- portable access to object files.
    2    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    3    2000, 2001
    4    Free Software Foundation, Inc.
     9
     10   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
     11   1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
     12
    513   Contributed by Cygnus Support.
    614
    7 ** NOTE: bfd.h and bfd-in2.h are GENERATED files.  Don't change them;
    8 ** instead, change bfd-in.h or the other BFD source files processed to
    9 ** generate these files.
    10 
    11 This file is part of BFD, the Binary File Descriptor library.
    12 
    13 This program is free software; you can redistribute it and/or modify
    14 it under the terms of the GNU General Public License as published by
    15 the Free Software Foundation; either version 2 of the License, or
    16 (at your option) any later version.
    17 
    18 This program is distributed in the hope that it will be useful,
    19 but WITHOUT ANY WARRANTY; without even the implied warranty of
    20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    21 GNU General Public License for more details.
    22 
    23 You should have received a copy of the GNU General Public License
    24 along with this program; if not, write to the Free Software
    25 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    26 
    27 /* bfd.h -- The only header file required by users of the bfd library
    28 
    29 The bfd.h file is generated from bfd-in.h and various .c files; if you
    30 change it, your changes will probably be lost.
    31 
    32 All the prototypes and definitions following the comment "THE FOLLOWING
    33 IS EXTRACTED FROM THE SOURCE" are extracted from the source files for
    34 BFD.  If you change it, someone oneday will extract it from the source
    35 again, and your changes will be lost.  To save yourself from this bind,
    36 change the definitions in the source in the bfd directory.  Type "make
    37 docs" and then "make headers" in that directory, and magically this file
    38 will change to reflect your changes.
    39 
    40 If you don't have the tools to perform the extraction, then you are
    41 safe from someone on your system trampling over your header files.
    42 You should still maintain the equivalence between the source and this
    43 file though; every change you make to the .c file should be reflected
    44 here.  */
     15   This file is part of BFD, the Binary File Descriptor library.
     16
     17   This program is free software; you can redistribute it and/or modify
     18   it under the terms of the GNU General Public License as published by
     19   the Free Software Foundation; either version 2 of the License, or
     20   (at your option) any later version.
     21
     22   This program is distributed in the hope that it will be useful,
     23   but WITHOUT ANY WARRANTY; without even the implied warranty of
     24   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     25   GNU General Public License for more details.
     26
     27   You should have received a copy of the GNU General Public License
     28   along with this program; if not, write to the Free Software
     29   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    4530
    4631#ifndef __BFD_H_SEEN__
     
    5237
    5338#include "ansidecl.h"
    54 
    55 /* These two lines get substitutions done by commands in Makefile.in.  */
    56 #define BFD_VERSION  "@VERSION@"
     39#include "symcat.h"
     40#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
     41#ifndef SABER
     42/* This hack is to avoid a problem with some strict ANSI C preprocessors.
     43   The problem is, "32_" is not a valid preprocessing token, and we don't
     44   want extra underscores (e.g., "nlm_32_").  The XCONCAT2 macro will
     45   cause the inner CONCAT2 macros to be evaluated first, producing
     46   still-valid pp-tokens.  Then the final concatenation can be done.  */
     47#undef CONCAT4
     48#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
     49#endif
     50#endif
     51
     52/* The word size used by BFD on the host.  This may be 64 with a 32
     53   bit target if the host is 64 bit, or if other 64 bit targets have
     54   been selected with --enable-targets, or if --enable-64-bit-bfd.  */
    5755#define BFD_ARCH_SIZE @wordsize@
     56
     57/* The word size of the default bfd target.  */
     58#define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@
     59
    5860#define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@
    5961#if @BFD_HOST_64_BIT_DEFINED@
     
    7476#endif
    7577
    76 /* forward declaration */
    77 typedef struct _bfd bfd;
    78 
    79 /* To squelch erroneous compiler warnings ("illegal pointer
    80    combination") from the SVR3 compiler, we would like to typedef
    81    boolean to int (it doesn't like functions which return boolean.
    82    Making sure they are never implicitly declared to return int
    83    doesn't seem to help).  But this file is not configured based on
    84    the host.  */
    85 /* General rules: functions which are boolean return true on success
    86    and false on failure (unless they're a predicate).   -- bfd.doc */
    87 /* I'm sure this is going to break something and someone is going to
    88    force me to change it.  */
    89 /* typedef enum boolean {false, true} boolean; */
    90 /* Yup, SVR4 has a "typedef enum boolean" in <sys/types.h>  -fnf */
    91 /* It gets worse if the host also defines a true/false enum... -sts */
    92 /* And even worse if your compiler has built-in boolean types... -law */
    93 #if defined (__GNUG__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6))
    94 #define TRUE_FALSE_ALREADY_DEFINED
     78/* Forward declaration.  */
     79typedef struct bfd bfd;
     80
     81/* Boolean type used in bfd.  Too many systems define their own
     82   versions of "boolean" for us to safely typedef a "boolean" of
     83   our own.  Using an enum for "bfd_boolean" has its own set of
     84   problems, with strange looking casts required to avoid warnings
     85   on some older compilers.  Thus we just use an int.
     86
     87   General rule: Functions which are bfd_boolean return TRUE on
     88   success and FALSE on failure (unless they're a predicate).  */
     89
     90typedef int bfd_boolean;
     91#undef FALSE
     92#undef TRUE
     93#define FALSE 0
     94#define TRUE 1
     95
     96#if 0
     97/* Poison.  */
     98#undef false
     99#undef true
     100#define false dont_use_false_in_bfd
     101#define true dont_use_true_in_bfd
    95102#endif
    96 #ifdef MPW
    97 /* Pre-emptive strike - get the file with the enum.  */
    98 #include <Types.h>
    99 #define TRUE_FALSE_ALREADY_DEFINED
    100 #endif /* MPW */
    101 #ifndef TRUE_FALSE_ALREADY_DEFINED
    102 typedef enum bfd_boolean {false, true} boolean;
    103 #define BFD_TRUE_FALSE
    104 #else
    105 /* Use enum names that will appear nowhere else.  */
    106 typedef enum bfd_boolean {bfd_fffalse, bfd_tttrue} boolean;
    107 #endif
    108 
    109 /* A pointer to a position in a file.  */
    110 /* FIXME:  This should be using off_t from <sys/types.h>.
    111    For now, try to avoid breaking stuff by not including <sys/types.h> here.
    112    This will break on systems with 64-bit file offsets (e.g. 4.4BSD).
    113    Probably the best long-term answer is to avoid using file_ptr AND off_t
    114    in this header file, and to handle this in the BFD implementation
    115    rather than in its interface.  */
    116 /* typedef off_t        file_ptr; */
    117 typedef long int file_ptr;
    118103
    119104/* Support for different sizes of target format ints and addresses.
     
    184169#endif /* not BFD64  */
    185170
     171/* A pointer to a position in a file.  */
     172/* FIXME:  This should be using off_t from <sys/types.h>.
     173   For now, try to avoid breaking stuff by not including <sys/types.h> here.
     174   This will break on systems with 64-bit file offsets (e.g. 4.4BSD).
     175   Probably the best long-term answer is to avoid using file_ptr AND off_t
     176   in this header file, and to handle this in the BFD implementation
     177   rather than in its interface.  */
     178/* typedef off_t        file_ptr; */
     179typedef bfd_signed_vma file_ptr;
     180typedef bfd_vma ufile_ptr;
     181
     182extern void bfd_sprintf_vma
     183  PARAMS ((bfd *, char *, bfd_vma));
     184extern void bfd_fprintf_vma
     185  PARAMS ((bfd *, PTR, bfd_vma));
     186
    186187#define printf_vma(x) fprintf_vma(stdout,x)
     188#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
    187189
    188190typedef unsigned int flagword;  /* 32 bits of flags */
     
    190192
    191193
    192 /** File formats */
    193 
    194 typedef enum bfd_format {
    195               bfd_unknown = 0,  /* file format is unknown */
    196               bfd_object,       /* linker/assember/compiler output */
    197               bfd_archive,      /* object archive file */
    198               bfd_core,         /* core dump */
    199               bfd_type_end}     /* marks the end; don't use it! */
    200          bfd_format;
     194/* File formats.  */
     195
     196typedef enum bfd_format
     197{
     198  bfd_unknown = 0,      /* File format is unknown.  */
     199  bfd_object,           /* Linker/assember/compiler output.  */
     200  bfd_archive,          /* Object archive file.  */
     201  bfd_core,             /* Core dump.  */
     202  bfd_type_end          /* Marks the end; don't use it!  */
     203}
     204bfd_format;
    201205
    202206/* Values that may appear in the flags field of a BFD.  These also
     
    257261#define BFD_IN_MEMORY 0x800
    258262
    259 
    260 /* symbols and relocation */
     263/* The sections in this BFD specify a memory page.  */
     264#define HAS_LOAD_PAGE 0x1000
     265
     266
     267/* Symbols and relocation.  */
    261268
    262269/* A count of carsyms (canonical archive symbols).  */
     
    282289
    283290/* A canonical archive symbol.  */
    284 /* This is a type pun with struct ranlib on purpose! */
    285 typedef struct carsym {
     291/* This is a type pun with struct ranlib on purpose!  */
     292typedef struct carsym
     293{
    286294  char *name;
    287   file_ptr file_offset;         /* look here to find the file */
    288 } carsym;                       /* to make these you call a carsymogen */
     295  file_ptr file_offset; /* Look here to find the file.  */
     296}
     297carsym;                 /* To make these you call a carsymogen.  */
    289298
    290299/* Used in generating armaps (archive tables of contents).
    291    Perhaps just a forward definition would do? */
    292 struct orl {                    /* output ranlib */
    293   char **name;                  /* symbol name */
    294   file_ptr pos;                 /* bfd* or file position */
    295   int namidx;                   /* index into string table */
     300   Perhaps just a forward definition would do?  */
     301struct orl                      /* Output ranlib.  */
     302{
     303  char **name;          /* Symbol name.  */
     304  union
     305  {
     306    file_ptr pos;
     307    bfd *abfd;
     308  } u;                  /* bfd* or file position.  */
     309  int namidx;           /* Index into string table.  */
    296310};
    297311
    298312
    299 /* Linenumber stuff */
    300 typedef struct lineno_cache_entry {
    301   unsigned int line_number;     /* Linenumber from start of function*/
    302   union {
    303     struct symbol_cache_entry *sym; /* Function name */
    304     unsigned long offset;       /* Offset into section */
     313/* Linenumber stuff.  */
     314typedef struct lineno_cache_entry
     315{
     316  unsigned int line_number;     /* Linenumber from start of function.  */
     317  union
     318  {
     319    struct symbol_cache_entry *sym;     /* Function name.  */
     320    bfd_vma offset;                     /* Offset into section.  */
    305321  } u;
    306 } alent;
    307 
    308 
    309 /* object and core file sections */
     322}
     323alent;
     324
     325
     326/* Object and core file sections.  */
    310327
    311328#define align_power(addr, align)        \
    312         ( ((addr) + ((1<<(align))-1)) & (-1 << (align)))
     329  (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align)))
    313330
    314331typedef struct sec *sec_ptr;
     
    316333#define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0)
    317334#define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0)
     335#define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0)
    318336#define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
    319337#define bfd_section_name(bfd, ptr) ((ptr)->name)
     
    327345#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
    328346
    329 #define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma= (val)), ((ptr)->user_set_vma = (boolean)true), true)
    330 #define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),true)
    331 #define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),true)
     347#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
     348#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
     349#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
    332350
    333351typedef struct stat stat_type;
     
    347365  symvalue value;
    348366  char type;
    349   CONST char *name;            /* Symbol name.  */
     367  const char *name;            /* Symbol name.  */
    350368  unsigned char stab_type;     /* Stab type.  */
    351369  char stab_other;             /* Stab other.  */
    352370  short stab_desc;             /* Stab desc.  */
    353   CONST char *stab_name;       /* String for stab type.  */
     371  const char *stab_name;       /* String for stab type.  */
    354372} symbol_info;
    355373
    356374/* Get the name of a stabs type code.  */
    357375
    358 extern const char *bfd_get_stab_name PARAMS ((int));
     376extern const char *bfd_get_stab_name
     377  PARAMS ((int));
    359378
    360379
     
    390409     each function should be written to allocate a new block of memory
    391410     only if the argument is NULL.  */
    392   struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *,
    393                                              struct bfd_hash_table *,
    394                                              const char *));
     411  struct bfd_hash_entry *(*newfunc)
     412    PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
    395413   /* An objalloc for this hash table.  This is a struct objalloc *,
    396414     but we use PTR to avoid requiring the inclusion of objalloc.h.  */
     
    399417
    400418/* Initialize a hash table.  */
    401 extern boolean bfd_hash_table_init
     419extern bfd_boolean bfd_hash_table_init
    402420  PARAMS ((struct bfd_hash_table *,
    403421           struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
     
    406424
    407425/* Initialize a hash table specifying a size.  */
    408 extern boolean bfd_hash_table_init_n
     426extern bfd_boolean bfd_hash_table_init_n
    409427  PARAMS ((struct bfd_hash_table *,
    410428           struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
     
    414432
    415433/* Free up a hash table.  */
    416 extern void bfd_hash_table_free PARAMS ((struct bfd_hash_table *));
    417 
    418 /* Look up a string in a hash table.  If CREATE is true, a new entry
     434extern void bfd_hash_table_free
     435  PARAMS ((struct bfd_hash_table *));
     436
     437/* Look up a string in a hash table.  If CREATE is TRUE, a new entry
    419438   will be created for this string if one does not already exist.  The
    420    COPY argument must be true if this routine should copy the string
     439   COPY argument must be TRUE if this routine should copy the string
    421440   into newly allocated memory when adding an entry.  */
    422441extern struct bfd_hash_entry *bfd_hash_lookup
    423   PARAMS ((struct bfd_hash_table *, const char *, boolean create,
    424            boolean copy));
     442  PARAMS ((struct bfd_hash_table *, const char *, bfd_boolean create,
     443           bfd_boolean copy));
    425444
    426445/* Replace an entry in a hash table.  */
     
    435454
    436455/* Grab some space for a hash table entry.  */
    437 extern PTR bfd_hash_allocate PARAMS ((struct bfd_hash_table *,
    438                                       unsigned int));
     456extern PTR bfd_hash_allocate
     457  PARAMS ((struct bfd_hash_table *, unsigned int));
    439458
    440459/* Traverse a hash table in a random order, calling a function on each
    441    element.  If the function returns false, the traversal stops.  The
     460   element.  If the function returns FALSE, the traversal stops.  The
    442461   INFO argument is passed to the function.  */
    443 extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *,
    444                                        boolean (*) (struct bfd_hash_entry *,
    445                                                     PTR),
    446                                        PTR info));
    447 
    448 
    449 /* Semi-portable string concatenation in cpp.
    450    The CAT4 hack is to avoid a problem with some strict ANSI C preprocessors.
    451    The problem is, "32_" is not a valid preprocessing token, and we don't
    452    want extra underscores (e.g., "nlm_32_").  The XCAT2 macro will cause the
    453    inner CAT macros to be evaluated first, producing still-valid pp-tokens.
    454    Then the final concatenation can be done.  (Sigh.)  */
    455 #ifndef CAT
    456 #ifdef SABER
    457 #define CAT(a,b)        a##b
    458 #define CAT3(a,b,c)     a##b##c
    459 #define CAT4(a,b,c,d)   a##b##c##d
    460 #else
    461 #if defined(__STDC__) || defined(ALMOST_STDC)
    462 #define CAT(a,b) a##b
    463 #define CAT3(a,b,c) a##b##c
    464 #define XCAT2(a,b)      CAT(a,b)
    465 #define CAT4(a,b,c,d)   XCAT2(CAT(a,b),CAT(c,d))
    466 #else
    467 #define CAT(a,b) a/**/b
    468 #define CAT3(a,b,c) a/**/b/**/c
    469 #define CAT4(a,b,c,d)   a/**/b/**/c/**/d
    470 #endif
    471 #endif
    472 #endif
     462extern void bfd_hash_traverse
     463  PARAMS ((struct bfd_hash_table *,
     464           bfd_boolean (*) (struct bfd_hash_entry *, PTR),
     465           PTR info));
    473466
    474467#define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table
    475468
    476 
    477 /* User program access to BFD facilities */
     469/* User program access to BFD facilities.  */
    478470
    479471/* Direct I/O routines, for programs which know more about the object
    480472   file than BFD does.  Use higher level routines if possible.  */
    481473
    482 extern bfd_size_type bfd_read
    483   PARAMS ((PTR, bfd_size_type size, bfd_size_type nitems, bfd *abfd));
    484 extern bfd_size_type bfd_write
    485   PARAMS ((const PTR, bfd_size_type size, bfd_size_type nitems, bfd *abfd));
    486 extern int bfd_seek PARAMS ((bfd *abfd, file_ptr fp, int direction));
    487 extern long bfd_tell PARAMS ((bfd *abfd));
    488 extern int bfd_flush PARAMS ((bfd *abfd));
    489 extern int bfd_stat PARAMS ((bfd *abfd, struct stat *));
     474extern bfd_size_type bfd_bread
     475  PARAMS ((PTR, bfd_size_type, bfd *));
     476extern bfd_size_type bfd_bwrite
     477  PARAMS ((const PTR, bfd_size_type, bfd *));
     478extern int bfd_seek
     479  PARAMS ((bfd *, file_ptr, int));
     480extern ufile_ptr bfd_tell
     481  PARAMS ((bfd *));
     482extern int bfd_flush
     483  PARAMS ((bfd *));
     484extern int bfd_stat
     485  PARAMS ((bfd *, struct stat *));
     486
     487/* Deprecated old routines.  */
     488#if __GNUC__
     489#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD)                            \
     490  (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__),      \
     491   bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
     492#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD)                           \
     493  (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__),     \
     494   bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
     495#else
     496#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD)                            \
     497  (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
     498   bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
     499#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD)                           \
     500  (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
     501   bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
     502#endif
     503extern void warn_deprecated
     504  PARAMS ((const char *, const char *, int, const char *));
    490505
    491506/* Cast from const char * to char * so that caller can assign to
     
    519534#define bfd_count_sections(abfd) ((abfd)->section_count)
    520535
     536#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
     537
    521538#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
    522539
    523 #define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean) (bool)), true)
    524 
    525 extern boolean bfd_record_phdr
    526   PARAMS ((bfd *, unsigned long, boolean, flagword, boolean, bfd_vma,
    527            boolean, boolean, unsigned int, struct sec **));
     540#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
     541
     542extern bfd_boolean bfd_cache_close
     543  PARAMS ((bfd *abfd));
     544/* NB: This declaration should match the autogenerated one in libbfd.h.  */
     545
     546extern bfd_boolean bfd_record_phdr
     547  PARAMS ((bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
     548           bfd_boolean, bfd_boolean, unsigned int, struct sec **));
    528549
    529550/* Byte swapping routines.  */
    530551
    531 bfd_vma         bfd_getb64         PARAMS ((const unsigned char *));
    532 bfd_vma         bfd_getl64         PARAMS ((const unsigned char *));
    533 bfd_signed_vma  bfd_getb_signed_64 PARAMS ((const unsigned char *));
    534 bfd_signed_vma  bfd_getl_signed_64 PARAMS ((const unsigned char *));
    535 bfd_vma         bfd_getb32         PARAMS ((const unsigned char *));
    536 bfd_vma         bfd_getl32         PARAMS ((const unsigned char *));
    537 bfd_signed_vma  bfd_getb_signed_32 PARAMS ((const unsigned char *));
    538 bfd_signed_vma  bfd_getl_signed_32 PARAMS ((const unsigned char *));
    539 bfd_vma         bfd_getb16         PARAMS ((const unsigned char *));
    540 bfd_vma         bfd_getl16         PARAMS ((const unsigned char *));
    541 bfd_signed_vma  bfd_getb_signed_16 PARAMS ((const unsigned char *));
    542 bfd_signed_vma  bfd_getl_signed_16 PARAMS ((const unsigned char *));
    543 void            bfd_putb64         PARAMS ((bfd_vma, unsigned char *));
    544 void            bfd_putl64         PARAMS ((bfd_vma, unsigned char *));
    545 void            bfd_putb32         PARAMS ((bfd_vma, unsigned char *));
    546 void            bfd_putl32         PARAMS ((bfd_vma, unsigned char *));
    547 void            bfd_putb16         PARAMS ((bfd_vma, unsigned char *));
    548 void            bfd_putl16         PARAMS ((bfd_vma, unsigned char *));
     552bfd_vma bfd_getb64
     553  PARAMS ((const unsigned char *));
     554bfd_vma bfd_getl64
     555  PARAMS ((const unsigned char *));
     556bfd_signed_vma bfd_getb_signed_64
     557  PARAMS ((const unsigned char *));
     558bfd_signed_vma bfd_getl_signed_64
     559  PARAMS ((const unsigned char *));
     560bfd_vma bfd_getb32
     561  PARAMS ((const unsigned char *));
     562bfd_vma bfd_getl32
     563  PARAMS ((const unsigned char *));
     564bfd_signed_vma bfd_getb_signed_32
     565  PARAMS ((const unsigned char *));
     566bfd_signed_vma bfd_getl_signed_32
     567  PARAMS ((const unsigned char *));
     568bfd_vma bfd_getb16
     569  PARAMS ((const unsigned char *));
     570bfd_vma bfd_getl16
     571  PARAMS ((const unsigned char *));
     572bfd_signed_vma bfd_getb_signed_16
     573  PARAMS ((const unsigned char *));
     574bfd_signed_vma bfd_getl_signed_16
     575  PARAMS ((const unsigned char *));
     576void bfd_putb64
     577  PARAMS ((bfd_vma, unsigned char *));
     578void bfd_putl64
     579  PARAMS ((bfd_vma, unsigned char *));
     580void bfd_putb32
     581  PARAMS ((bfd_vma, unsigned char *));
     582void bfd_putl32
     583  PARAMS ((bfd_vma, unsigned char *));
     584void bfd_putb16
     585  PARAMS ((bfd_vma, unsigned char *));
     586void bfd_putl16
     587  PARAMS ((bfd_vma, unsigned char *));
    549588
    550589/* Byte swapping routines which take size and endiannes as arguments.  */
    551590
    552 bfd_vma         bfd_get_bits       PARAMS ((bfd_byte *, int, boolean));
    553 void            bfd_put_bits       PARAMS ((bfd_vma, bfd_byte *, int, boolean));
     591bfd_vma bfd_get_bits
     592  PARAMS ((bfd_byte *, int, bfd_boolean));
     593void bfd_put_bits
     594  PARAMS ((bfd_vma, bfd_byte *, int, bfd_boolean));
    554595
    555596
     
    565606struct bfd_elf_version_tree;
    566607#endif
    567 extern bfd_vma bfd_ecoff_get_gp_value PARAMS ((bfd * abfd));
    568 extern boolean bfd_ecoff_set_gp_value PARAMS ((bfd *abfd, bfd_vma gp_value));
    569 extern boolean bfd_ecoff_set_regmasks
     608extern bfd_vma bfd_ecoff_get_gp_value
     609  PARAMS ((bfd * abfd));
     610extern bfd_boolean bfd_ecoff_set_gp_value
     611  PARAMS ((bfd *abfd, bfd_vma gp_value));
     612extern bfd_boolean bfd_ecoff_set_regmasks
    570613  PARAMS ((bfd *abfd, unsigned long gprmask, unsigned long fprmask,
    571614           unsigned long *cprmask));
     
    578621           const struct ecoff_debug_swap *output_swap,
    579622           struct bfd_link_info *));
    580 extern boolean bfd_ecoff_debug_accumulate
     623extern bfd_boolean bfd_ecoff_debug_accumulate
    581624  PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
    582625           const struct ecoff_debug_swap *output_swap,
     
    584627           const struct ecoff_debug_swap *input_swap,
    585628           struct bfd_link_info *));
    586 extern boolean bfd_ecoff_debug_accumulate_other
     629extern bfd_boolean bfd_ecoff_debug_accumulate_other
    587630  PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
    588631           const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
    589632           struct bfd_link_info *));
    590 extern boolean bfd_ecoff_debug_externals
     633extern bfd_boolean bfd_ecoff_debug_externals
    591634  PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
    592635           const struct ecoff_debug_swap *swap,
    593            boolean relocateable,
    594            boolean (*get_extr) (struct symbol_cache_entry *,
    595                                 struct ecoff_extr *),
     636           bfd_boolean relocateable,
     637           bfd_boolean (*get_extr) (struct symbol_cache_entry *,
     638                                    struct ecoff_extr *),
    596639           void (*set_index) (struct symbol_cache_entry *,
    597640                              bfd_size_type)));
    598 extern boolean bfd_ecoff_debug_one_external
     641extern bfd_boolean bfd_ecoff_debug_one_external
    599642  PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
    600643           const struct ecoff_debug_swap *swap,
     
    603646  PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
    604647           const struct ecoff_debug_swap *swap));
    605 extern boolean bfd_ecoff_write_debug
     648extern bfd_boolean bfd_ecoff_write_debug
    606649  PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
    607650           const struct ecoff_debug_swap *swap, file_ptr where));
    608 extern boolean bfd_ecoff_write_accumulated_debug
     651extern bfd_boolean bfd_ecoff_write_accumulated_debug
    609652  PARAMS ((PTR handle, bfd *abfd, struct ecoff_debug_info *debug,
    610653           const struct ecoff_debug_swap *swap,
    611654           struct bfd_link_info *info, file_ptr where));
    612 extern boolean bfd_mips_ecoff_create_embedded_relocs
     655extern bfd_boolean bfd_mips_ecoff_create_embedded_relocs
    613656  PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
    614657           char **));
     
    623666};
    624667
    625 extern boolean bfd_elf32_record_link_assignment
    626   PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean));
    627 extern boolean bfd_elf64_record_link_assignment
    628   PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean));
     668extern bfd_boolean bfd_elf32_record_link_assignment
     669  PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean));
     670extern bfd_boolean bfd_elf64_record_link_assignment
     671  PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean));
    629672extern struct bfd_link_needed_list *bfd_elf_get_needed_list
    630673  PARAMS ((bfd *, struct bfd_link_info *));
    631 extern boolean bfd_elf_get_bfd_needed_list
     674extern bfd_boolean bfd_elf_get_bfd_needed_list
    632675  PARAMS ((bfd *, struct bfd_link_needed_list **));
    633 extern boolean bfd_elf32_size_dynamic_sections
    634   PARAMS ((bfd *, const char *, const char *, boolean, const char *,
     676extern bfd_boolean bfd_elf32_size_dynamic_sections
     677  PARAMS ((bfd *, const char *, const char *, const char *,
    635678           const char * const *, struct bfd_link_info *, struct sec **,
    636679           struct bfd_elf_version_tree *));
    637 extern boolean bfd_elf64_size_dynamic_sections
    638   PARAMS ((bfd *, const char *, const char *, boolean, const char *,
     680extern bfd_boolean bfd_elf64_size_dynamic_sections
     681  PARAMS ((bfd *, const char *, const char *, const char *,
    639682           const char * const *, struct bfd_link_info *, struct sec **,
    640683           struct bfd_elf_version_tree *));
    641 extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
    642 extern void bfd_elf_set_dt_needed_soname PARAMS ((bfd *, const char *));
    643 extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *));
     684extern void bfd_elf_set_dt_needed_name
     685  PARAMS ((bfd *, const char *));
     686extern void bfd_elf_set_dt_needed_soname
     687  PARAMS ((bfd *, const char *));
     688extern const char *bfd_elf_get_dt_soname
     689  PARAMS ((bfd *));
    644690extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
     691  PARAMS ((bfd *, struct bfd_link_info *));
     692extern bfd_boolean bfd_elf32_discard_info
     693  PARAMS ((bfd *, struct bfd_link_info *));
     694extern bfd_boolean bfd_elf64_discard_info
    645695  PARAMS ((bfd *, struct bfd_link_info *));
    646696
     
    648698   copy of ABFD's program header table entries.  Return -1 if an error
    649699   occurs; bfd_get_error will return an appropriate code.  */
    650 extern long bfd_get_elf_phdr_upper_bound PARAMS ((bfd *abfd));
     700extern long bfd_get_elf_phdr_upper_bound
     701  PARAMS ((bfd *abfd));
    651702
    652703/* Copy ABFD's program header table entries to *PHDRS.  The entries
     
    657708   Return the number of program header table entries read, or -1 if an
    658709   error occurs; bfd_get_error will return an appropriate code.  */
    659 extern int bfd_get_elf_phdrs PARAMS ((bfd *abfd, void *phdrs));
     710extern int bfd_get_elf_phdrs
     711  PARAMS ((bfd *abfd, void *phdrs));
    660712
    661713/* Return the arch_size field of an elf bfd, or -1 if not elf.  */
    662 extern int bfd_get_arch_size PARAMS ((bfd *));
    663 
    664 /* Return true if address "naturally" sign extends, or -1 if not elf.  */
    665 extern int bfd_get_sign_extend_vma PARAMS ((bfd *));
    666 
    667 extern boolean bfd_m68k_elf32_create_embedded_relocs
     714extern int bfd_get_arch_size
     715  PARAMS ((bfd *));
     716
     717/* Return TRUE if address "naturally" sign extends, or -1 if not elf.  */
     718extern int bfd_get_sign_extend_vma
     719  PARAMS ((bfd *));
     720
     721extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
    668722  PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
    669723           char **));
     724extern bfd_boolean bfd_mips_elf32_create_embedded_relocs
     725  PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
     726           char **));
    670727
    671728/* SunOS shared library support routines for the linker.  */
     
    673730extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
    674731  PARAMS ((bfd *, struct bfd_link_info *));
    675 extern boolean bfd_sunos_record_link_assignment
     732extern bfd_boolean bfd_sunos_record_link_assignment
    676733  PARAMS ((bfd *, struct bfd_link_info *, const char *));
    677 extern boolean bfd_sunos_size_dynamic_sections
     734extern bfd_boolean bfd_sunos_size_dynamic_sections
    678735  PARAMS ((bfd *, struct bfd_link_info *, struct sec **, struct sec **,
    679736           struct sec **));
     
    681738/* Linux shared library support routines for the linker.  */
    682739
    683 extern boolean bfd_i386linux_size_dynamic_sections
     740extern bfd_boolean bfd_i386linux_size_dynamic_sections
    684741  PARAMS ((bfd *, struct bfd_link_info *));
    685 extern boolean bfd_m68klinux_size_dynamic_sections
     742extern bfd_boolean bfd_m68klinux_size_dynamic_sections
    686743  PARAMS ((bfd *, struct bfd_link_info *));
    687 extern boolean bfd_sparclinux_size_dynamic_sections
     744extern bfd_boolean bfd_sparclinux_size_dynamic_sections
    688745  PARAMS ((bfd *, struct bfd_link_info *));
    689746
     
    693750typedef struct _bfd_window_internal bfd_window_internal;
    694751
    695 typedef struct _bfd_window {
     752typedef struct _bfd_window
     753{
    696754  /* What the user asked for.  */
    697755  PTR data;
     
    704762     application wants two writable copies!  */
    705763  struct _bfd_window_internal *i;
    706 } bfd_window;
    707 
    708 extern void bfd_init_window PARAMS ((bfd_window *));
    709 extern void bfd_free_window PARAMS ((bfd_window *));
    710 extern boolean bfd_get_file_window
    711   PARAMS ((bfd *, file_ptr, bfd_size_type, bfd_window *, boolean));
     764}
     765bfd_window;
     766
     767extern void bfd_init_window
     768  PARAMS ((bfd_window *));
     769extern void bfd_free_window
     770  PARAMS ((bfd_window *));
     771extern bfd_boolean bfd_get_file_window
     772  PARAMS ((bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean));
    712773
    713774/* XCOFF support routines for the linker.  */
    714775
    715 extern boolean bfd_xcoff_link_record_set
     776extern bfd_boolean bfd_xcoff_link_record_set
    716777  PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
    717778           bfd_size_type));
    718 extern boolean bfd_xcoff_import_symbol
     779extern bfd_boolean bfd_xcoff_import_symbol
    719780  PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
    720            bfd_vma, const char *, const char *, const char *));
    721 extern boolean bfd_xcoff_export_symbol
    722   PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
    723            boolean));
    724 extern boolean bfd_xcoff_link_count_reloc
     781           bfd_vma, const char *, const char *, const char *, unsigned int));
     782extern bfd_boolean bfd_xcoff_export_symbol
     783  PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *));
     784extern bfd_boolean bfd_xcoff_link_count_reloc
    725785  PARAMS ((bfd *, struct bfd_link_info *, const char *));
    726 extern boolean bfd_xcoff_record_link_assignment
     786extern bfd_boolean bfd_xcoff_record_link_assignment
    727787  PARAMS ((bfd *, struct bfd_link_info *, const char *));
    728 extern boolean bfd_xcoff_size_dynamic_sections
     788extern bfd_boolean bfd_xcoff_size_dynamic_sections
    729789  PARAMS ((bfd *, struct bfd_link_info *, const char *, const char *,
    730            unsigned long, unsigned long, unsigned long, boolean,
    731            int, boolean, boolean, struct sec **));
     790           unsigned long, unsigned long, unsigned long, bfd_boolean,
     791           int, bfd_boolean, bfd_boolean, struct sec **, bfd_boolean));
     792extern bfd_boolean bfd_xcoff_link_generate_rtinit
     793  PARAMS ((bfd *, const char *, const char *, bfd_boolean));
     794
     795/* XCOFF support routines for ar.  */
     796extern bfd_boolean bfd_xcoff_ar_archive_set_magic
     797  PARAMS ((bfd *, char *));
    732798
    733799/* Externally visible COFF routines.  */
     
    738804#endif
    739805
    740 extern boolean bfd_coff_get_syment
     806extern bfd_boolean bfd_coff_get_syment
    741807  PARAMS ((bfd *, struct symbol_cache_entry *, struct internal_syment *));
    742808
    743 extern boolean bfd_coff_get_auxent
     809extern bfd_boolean bfd_coff_get_auxent
    744810  PARAMS ((bfd *, struct symbol_cache_entry *, int, union internal_auxent *));
    745811
    746 extern boolean bfd_coff_set_symbol_class
     812extern bfd_boolean bfd_coff_set_symbol_class
    747813  PARAMS ((bfd *, struct symbol_cache_entry *, unsigned int));
    748814
    749 extern boolean bfd_m68k_coff_create_embedded_relocs
     815extern bfd_boolean bfd_m68k_coff_create_embedded_relocs
    750816  PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
    751817           char **));
    752818
    753819/* ARM Interworking support.  Called from linker.  */
    754 extern boolean bfd_arm_allocate_interworking_sections
     820extern bfd_boolean bfd_arm_allocate_interworking_sections
    755821  PARAMS ((struct bfd_link_info *));
    756822
    757 extern boolean bfd_arm_process_before_allocation
     823extern bfd_boolean bfd_arm_process_before_allocation
    758824  PARAMS ((bfd *, struct bfd_link_info *, int));
    759825
    760 extern boolean bfd_arm_get_bfd_for_interworking
     826extern bfd_boolean bfd_arm_get_bfd_for_interworking
    761827  PARAMS ((bfd *, struct bfd_link_info *));
    762828
    763829/* PE ARM Interworking support.  Called from linker.  */
    764 extern boolean bfd_arm_pe_allocate_interworking_sections
     830extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
    765831  PARAMS ((struct bfd_link_info *));
    766832
    767 extern boolean bfd_arm_pe_process_before_allocation
     833extern bfd_boolean bfd_arm_pe_process_before_allocation
    768834  PARAMS ((bfd *, struct bfd_link_info *, int));
    769835
    770 extern boolean bfd_arm_pe_get_bfd_for_interworking
     836extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
    771837  PARAMS ((bfd *, struct bfd_link_info *));
    772838
    773839/* ELF ARM Interworking support.  Called from linker.  */
    774 extern boolean bfd_elf32_arm_allocate_interworking_sections
     840extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
    775841  PARAMS ((struct bfd_link_info *));
    776842
    777 extern boolean bfd_elf32_arm_process_before_allocation
     843extern bfd_boolean bfd_elf32_arm_process_before_allocation
    778844  PARAMS ((bfd *, struct bfd_link_info *, int));
    779845
    780 extern boolean bfd_elf32_arm_get_bfd_for_interworking
     846extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
    781847  PARAMS ((bfd *, struct bfd_link_info *));
     848
     849extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
     850  PARAMS ((bfd *, struct bfd_link_info *));
     851
     852/* ARM Note section processing.  */
     853extern bfd_boolean bfd_arm_merge_machines
     854  PARAMS ((bfd *, bfd *));
     855
     856extern bfd_boolean bfd_arm_update_notes
     857  PARAMS ((bfd *, const char *));
     858
     859extern unsigned int bfd_arm_get_mach_from_notes
     860  PARAMS ((bfd *, const char *));
    782861
    783862/* TI COFF load page support.  */
     
    788867  PARAMS ((struct sec *));
    789868
    790 /* And more from the source.  */
     869/* Extracted from init.c.  */
    791870void
    792871bfd_init PARAMS ((void));
    793872
     873/* Extracted from opncls.c.  */
    794874bfd *
    795 bfd_openr PARAMS ((CONST char *filename, CONST char *target));
     875bfd_openr PARAMS ((const char *filename, const char *target));
    796876
    797877bfd *
    798 bfd_fdopenr PARAMS ((CONST char *filename, CONST char *target, int fd));
     878bfd_fdopenr PARAMS ((const char *filename, const char *target, int fd));
    799879
    800880bfd *
     
    802882
    803883bfd *
    804 bfd_openw PARAMS ((CONST char *filename, CONST char *target));
    805 
    806 boolean
     884bfd_openw PARAMS ((const char *filename, const char *target));
     885
     886bfd_boolean
    807887bfd_close PARAMS ((bfd *abfd));
    808888
    809 boolean
     889bfd_boolean
    810890bfd_close_all_done PARAMS ((bfd *));
    811891
    812892bfd *
    813 bfd_create PARAMS ((CONST char *filename, bfd *templ));
    814 
    815 boolean
     893bfd_create PARAMS ((const char *filename, bfd *templ));
     894
     895bfd_boolean
    816896bfd_make_writable PARAMS ((bfd *abfd));
    817897
    818 boolean
     898bfd_boolean
    819899bfd_make_readable PARAMS ((bfd *abfd));
    820900
     901char *
     902bfd_follow_gnu_debuglink PARAMS ((bfd *abfd, const char *dir));
     903
     904/* Extracted from libbfd.c.  */
    821905
    822906/* Byte swapping macros for user section data.  */
     
    827911               bfd_put_8
    828912#define bfd_get_8(abfd, ptr) \
    829                 (*(unsigned char *) (ptr))
     913                (*(unsigned char *) (ptr) & 0xff)
    830914#define bfd_get_signed_8(abfd, ptr) \
    831                ((*(unsigned char *) (ptr) ^ 0x80) - 0x80)
     915               (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
    832916
    833917#define bfd_put_16(abfd, val, ptr) \
     
    859943
    860944#define bfd_get(bits, abfd, ptr)                               \
    861                 ((bits) == 8 ? bfd_get_8 (abfd, ptr)           \
     945                ( (bits) ==  8 ? (bfd_vma) bfd_get_8 (abfd, ptr)       \
    862946                : (bits) == 16 ? bfd_get_16 (abfd, ptr)        \
    863947                : (bits) == 32 ? bfd_get_32 (abfd, ptr)        \
     
    866950
    867951#define bfd_put(bits, abfd, val, ptr)                          \
    868                 ((bits) == 8 ? bfd_put_8 (abfd, val, ptr)      \
     952                ( (bits) ==  8 ? bfd_put_8  (abfd, val, ptr)   \
    869953                : (bits) == 16 ? bfd_put_16 (abfd, val, ptr)   \
    870954                : (bits) == 32 ? bfd_put_32 (abfd, val, ptr)   \
     
    876960
    877961#define bfd_h_put_8(abfd, val, ptr) \
    878                bfd_put_8 (abfd, val, ptr)
     962  bfd_put_8 (abfd, val, ptr)
    879963#define bfd_h_put_signed_8(abfd, val, ptr) \
    880                bfd_put_8 (abfd, val, ptr)
     964  bfd_put_8 (abfd, val, ptr)
    881965#define bfd_h_get_8(abfd, ptr) \
    882                bfd_get_8 (abfd, ptr)
     966  bfd_get_8 (abfd, ptr)
    883967#define bfd_h_get_signed_8(abfd, ptr) \
    884                bfd_get_signed_8 (abfd, ptr)
     968  bfd_get_signed_8 (abfd, ptr)
    885969
    886970#define bfd_h_put_16(abfd, val, ptr) \
    887                 BFD_SEND(abfd, bfd_h_putx16,(val,ptr))
     971  BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
    888972#define bfd_h_put_signed_16 \
    889                 bfd_h_put_16
     973  bfd_h_put_16
    890974#define bfd_h_get_16(abfd, ptr) \
    891                 BFD_SEND(abfd, bfd_h_getx16,(ptr))
     975  BFD_SEND (abfd, bfd_h_getx16, (ptr))
    892976#define bfd_h_get_signed_16(abfd, ptr) \
    893                 BFD_SEND(abfd, bfd_h_getx_signed_16, (ptr))
     977  BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
    894978
    895979#define bfd_h_put_32(abfd, val, ptr) \
    896                 BFD_SEND(abfd, bfd_h_putx32,(val,ptr))
     980  BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
    897981#define bfd_h_put_signed_32 \
    898                 bfd_h_put_32
     982  bfd_h_put_32
    899983#define bfd_h_get_32(abfd, ptr) \
    900                 BFD_SEND(abfd, bfd_h_getx32,(ptr))
     984  BFD_SEND (abfd, bfd_h_getx32, (ptr))
    901985#define bfd_h_get_signed_32(abfd, ptr) \
    902                 BFD_SEND(abfd, bfd_h_getx_signed_32, (ptr))
     986  BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
    903987
    904988#define bfd_h_put_64(abfd, val, ptr) \
    905                 BFD_SEND(abfd, bfd_h_putx64,(val, ptr))
     989  BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
    906990#define bfd_h_put_signed_64 \
    907                 bfd_h_put_64
     991  bfd_h_put_64
    908992#define bfd_h_get_64(abfd, ptr) \
    909                 BFD_SEND(abfd, bfd_h_getx64,(ptr))
     993  BFD_SEND (abfd, bfd_h_getx64, (ptr))
    910994#define bfd_h_get_signed_64(abfd, ptr) \
    911                 BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr))
    912 
     995  BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
     996
     997/* Refinements on the above, which should eventually go away.  Save
     998   cluttering the source with (bfd_vma) and (bfd_byte *) casts.  */
     999
     1000#define H_PUT_64(abfd, val, where) \
     1001  bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
     1002
     1003#define H_PUT_32(abfd, val, where) \
     1004  bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
     1005
     1006#define H_PUT_16(abfd, val, where) \
     1007  bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
     1008
     1009#define H_PUT_8 bfd_h_put_8
     1010
     1011#define H_PUT_S64(abfd, val, where) \
     1012  bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
     1013
     1014#define H_PUT_S32(abfd, val, where) \
     1015  bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
     1016
     1017#define H_PUT_S16(abfd, val, where) \
     1018  bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
     1019
     1020#define H_PUT_S8 bfd_h_put_signed_8
     1021
     1022#define H_GET_64(abfd, where) \
     1023  bfd_h_get_64 ((abfd), (bfd_byte *) (where))
     1024
     1025#define H_GET_32(abfd, where) \
     1026  bfd_h_get_32 ((abfd), (bfd_byte *) (where))
     1027
     1028#define H_GET_16(abfd, where) \
     1029  bfd_h_get_16 ((abfd), (bfd_byte *) (where))
     1030
     1031#define H_GET_8 bfd_h_get_8
     1032
     1033#define H_GET_S64(abfd, where) \
     1034  bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where))
     1035
     1036#define H_GET_S32(abfd, where) \
     1037  bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where))
     1038
     1039#define H_GET_S16(abfd, where) \
     1040  bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where))
     1041
     1042#define H_GET_S8 bfd_h_get_signed_8
     1043
     1044
     1045/* Extracted from bfdio.c.  */
     1046long
     1047bfd_get_mtime PARAMS ((bfd *abfd));
     1048
     1049long
     1050bfd_get_size PARAMS ((bfd *abfd));
     1051
     1052/* Extracted from bfdwin.c.  */
     1053/* Extracted from section.c.  */
    9131054/* This structure is used for a comdat section, as in PE.  A comdat
    9141055   section is associated with a particular symbol.  When the linker
     
    9321073  /* The name of the section; the name isn't a copy, the pointer is
    9331074     the same as that passed to bfd_make_section.  */
    934 
    9351075  const char *name;
    9361076
    9371077  /* A unique sequence number.  */
    938 
    9391078  int id;
    9401079
    941   /* Which section is it; 0..nth.  */
    942 
     1080  /* Which section in the bfd; 0..n-1 as sections are created in a bfd.  */
    9431081  int index;
    9441082
    9451083  /* The next section in the list belonging to the BFD, or NULL.  */
    946 
    9471084  struct sec *next;
    9481085
     
    9501087     flags are read in from the object file, and some are
    9511088     synthesized from other information.  */
    952 
    9531089  flagword flags;
    9541090
     
    9671103#define SEC_RELOC      0x004
    9681104
    969 #if 0   /* Obsolete ? */
    970 #define SEC_BALIGN     0x008
    971 #endif
     1105  /* ELF reserves 4 processor specific bits and 8 operating system
     1106     specific bits in sh_flags; at present we can get away with just
     1107     one in communicating between the assembler and BFD, but this
     1108     isn't a good long-term solution.  */
     1109#define SEC_ARCH_BIT_0 0x008
    9721110
    9731111  /* A signal to the OS that the section contains read only data.  */
     
    9951133#define SEC_CONSTRUCTOR 0x100
    9961134
    997   /* The section is a constructor, and should be placed at the
    998      end of the text, data, or bss section(?).  */
    999 #define SEC_CONSTRUCTOR_TEXT 0x1100
    1000 #define SEC_CONSTRUCTOR_DATA 0x2100
    1001 #define SEC_CONSTRUCTOR_BSS  0x3100
    1002 
    10031135  /* The section has contents - a data section could be
    10041136     <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
     
    10211153#define SEC_COFF_SHARED_LIBRARY 0x800
    10221154
     1155  /* The section contains thread local data.  */
     1156#define SEC_THREAD_LOCAL 0x1000
     1157
    10231158  /* The section has GOT references.  This flag is only for the
    10241159     linker, and is currently only used by the elf32-hppa back end.
     
    10521187#define SEC_EXCLUDE 0x40000
    10531188
    1054   /* The contents of this section are to be sorted by the
    1055      based on the address specified in the associated symbol
    1056      table.  */
     1189  /* The contents of this section are to be sorted based on the sum of
     1190     the symbol and addend values specified by the associated relocation
     1191     entries.  Entries without associated relocation entries will be
     1192     appended to the end of the section in an unspecified order.  */
    10571193#define SEC_SORT_ENTRIES 0x80000
    10581194
     
    11121248#define SEC_CLINK 0x10000000
    11131249
     1250  /* Attempt to merge identical entities in the section.
     1251     Entity size is given in the entsize field.  */
     1252#define SEC_MERGE 0x20000000
     1253
     1254  /* If given with SEC_MERGE, entities to merge are zero terminated
     1255     strings where entsize specifies character size instead of fixed
     1256     size entries.  */
     1257#define SEC_STRINGS 0x40000000
     1258
     1259  /* This section contains data about section groups.  */
     1260#define SEC_GROUP 0x80000000
     1261
    11141262  /*  End of section flags.  */
    11151263
     
    11261274
    11271275  /* Another mark flag used by some of the linker backends.  Set for
    1128      output sections that have a input section.  */
     1276     output sections that have an input section.  */
    11291277  unsigned int linker_has_input : 1;
    11301278
     
    11321280  unsigned int gc_mark : 1;
    11331281
    1134   /* Used by the ELF code to mark sections which have been allocated to segments.  */
     1282  /* The following flags are used by the ELF linker. */
     1283
     1284  /* Mark sections which have been allocated to segments.  */
    11351285  unsigned int segment_mark : 1;
     1286
     1287  /* Type of sec_info information.  */
     1288  unsigned int sec_info_type:3;
     1289#define ELF_INFO_TYPE_NONE      0
     1290#define ELF_INFO_TYPE_STABS     1
     1291#define ELF_INFO_TYPE_MERGE     2
     1292#define ELF_INFO_TYPE_EH_FRAME  3
     1293#define ELF_INFO_TYPE_JUST_SYMS 4
     1294
     1295  /* Nonzero if this section uses RELA relocations, rather than REL.  */
     1296  unsigned int use_rela_p:1;
     1297
     1298  /* Bits used by various backends.  */
     1299  unsigned int has_tls_reloc:1;
     1300
     1301  /* Nonzero if this section needs the relax finalize pass.  */
     1302  unsigned int need_finalize_relax:1;
     1303
     1304  /* Usused bits.  */
     1305  unsigned int flag12:1;
     1306  unsigned int flag13:1;
     1307  unsigned int flag14:1;
     1308  unsigned int flag15:1;
     1309  unsigned int flag16:4;
     1310  unsigned int flag20:4;
     1311  unsigned int flag24:8;
    11361312
    11371313  /* End of internal packed boolean fields.  */
     
    11431319      the default address for <<.data>> is dependent on the specific
    11441320      target and various flags).  */
    1145 
    11461321  bfd_vma vma;
    11471322
    11481323  /*  The load address of the section - where it would be in a
    11491324      rom image; really only used for writing section header
    1150       information. */
    1151 
     1325      information.  */
    11521326  bfd_vma lma;
    11531327
     
    11551329     Contains a value even if the section has no contents (e.g., the
    11561330     size of <<.bss>>).  This will be filled in after relocation.  */
    1157 
    11581331  bfd_size_type _cooked_size;
    11591332
     
    11611334     value is the same as the size, but if some relaxing has
    11621335     been done, then this value will be bigger.  */
    1163 
    11641336  bfd_size_type _raw_size;
    11651337
     
    11711343     would be 100.  However, if the target byte size is 16 bits
    11721344     (bfd_octets_per_byte is "2"), this value would be 50.  */
    1173 
    11741345  bfd_vma output_offset;
    11751346
    11761347  /* The output section through which to map on output.  */
    1177 
    11781348  struct sec *output_section;
    11791349
    11801350  /* The alignment requirement of the section, as an exponent of 2 -
    11811351     e.g., 3 aligns to 2^3 (or 8).  */
    1182 
    11831352  unsigned int alignment_power;
    11841353
    11851354  /* If an input section, a pointer to a vector of relocation
    11861355     records for the data in this section.  */
    1187 
    11881356  struct reloc_cache_entry *relocation;
    11891357
    11901358  /* If an output section, a pointer to a vector of pointers to
    11911359     relocation records for the data in this section.  */
    1192 
    11931360  struct reloc_cache_entry **orelocation;
    11941361
    1195   /* The number of relocation records in one of the above  */
    1196 
     1362  /* The number of relocation records in one of the above.  */
    11971363  unsigned reloc_count;
    11981364
     
    12011367
    12021368  /* File position of section data.  */
    1203 
    12041369  file_ptr filepos;
    12051370
    12061371  /* File position of relocation info.  */
    1207 
    12081372  file_ptr rel_filepos;
    12091373
    12101374  /* File position of line data.  */
    1211 
    12121375  file_ptr line_filepos;
    12131376
    12141377  /* Pointer to data for applications.  */
    1215 
    12161378  PTR userdata;
    12171379
     
    12211383
    12221384  /* Attached line number information.  */
    1223 
    12241385  alent *lineno;
    12251386
    12261387  /* Number of line number records.  */
    1227 
    12281388  unsigned int lineno_count;
    12291389
     1390  /* Entity size for merging purposes.  */
     1391  unsigned int entsize;
     1392
    12301393  /* Optional information about a COMDAT entry; NULL if not COMDAT.  */
    1231 
    12321394  struct bfd_comdat_info *comdat;
    1233 
    1234   /* Points to the kept section if this section is a link-once section,
    1235      and is discarded.  */
    1236   struct sec *kept_section;
    12371395
    12381396  /* When a section is being output, this value changes as more
    12391397     linenumbers are written out.  */
    1240 
    12411398  file_ptr moving_line_filepos;
    12421399
    12431400  /* What the section number is in the target world.  */
    1244 
    12451401  int target_index;
    12461402
     
    12491405  /* If this is a constructor section then here is a list of the
    12501406     relocations created to relocate items within it.  */
    1251 
    12521407  struct relent_chain *constructor_chain;
    12531408
    12541409  /* The BFD which owns the section.  */
    1255 
    12561410  bfd *owner;
    12571411
    1258   /* A symbol which points at this section only */
     1412  /* A symbol which points at this section only. */
    12591413  struct symbol_cache_entry *symbol;
    12601414  struct symbol_cache_entry **symbol_ptr_ptr;
     
    12621416  struct bfd_link_order *link_order_head;
    12631417  struct bfd_link_order *link_order_tail;
    1264 } asection ;
     1418} asection;
    12651419
    12661420/* These sections are global, and are managed by BFD.  The application
     
    12741428#define BFD_IND_SECTION_NAME "*IND*"
    12751429
    1276 /* the absolute section */
     1430/* The absolute section. */
    12771431extern const asection bfd_abs_section;
    12781432#define bfd_abs_section_ptr ((asection *) &bfd_abs_section)
    12791433#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
    1280 /* Pointer to the undefined section */
     1434/* Pointer to the undefined section. */
    12811435extern const asection bfd_und_section;
    12821436#define bfd_und_section_ptr ((asection *) &bfd_und_section)
    12831437#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
    1284 /* Pointer to the common section */
     1438/* Pointer to the common section. */
    12851439extern const asection bfd_com_section;
    12861440#define bfd_com_section_ptr ((asection *) &bfd_com_section)
    1287 /* Pointer to the indirect section */
     1441/* Pointer to the indirect section. */
    12881442extern const asection bfd_ind_section;
    12891443#define bfd_ind_section_ptr ((asection *) &bfd_ind_section)
    12901444#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
     1445
     1446#define bfd_is_const_section(SEC)              \
     1447 (   ((SEC) == bfd_abs_section_ptr)            \
     1448  || ((SEC) == bfd_und_section_ptr)            \
     1449  || ((SEC) == bfd_com_section_ptr)            \
     1450  || ((SEC) == bfd_ind_section_ptr))
    12911451
    12921452extern const struct symbol_cache_entry * const bfd_abs_symbol;
     
    13001460     ((section)->reloc_done ? (section)->_cooked_size \
    13011461                            : (abort (), (bfd_size_type) 1))
     1462
     1463/* Macros to handle insertion and deletion of a bfd's sections.  These
     1464   only handle the list pointers, ie. do not adjust section_count,
     1465   target_index etc.  */
     1466#define bfd_section_list_remove(ABFD, PS) \
     1467  do                                                   \
     1468    {                                                  \
     1469      asection **_ps = PS;                             \
     1470      asection *_s = *_ps;                             \
     1471      *_ps = _s->next;                                 \
     1472      if (_s->next == NULL)                            \
     1473        (ABFD)->section_tail = _ps;                    \
     1474    }                                                  \
     1475  while (0)
     1476#define bfd_section_list_insert(ABFD, PS, S) \
     1477  do                                                   \
     1478    {                                                  \
     1479      asection **_ps = PS;                             \
     1480      asection *_s = S;                                \
     1481      _s->next = *_ps;                                 \
     1482      *_ps = _s;                                       \
     1483      if (_s->next == NULL)                            \
     1484        (ABFD)->section_tail = &_s->next;              \
     1485    }                                                  \
     1486  while (0)
     1487
     1488void
     1489bfd_section_list_clear PARAMS ((bfd *));
     1490
    13021491asection *
    13031492bfd_get_section_by_name PARAMS ((bfd *abfd, const char *name));
     
    13171506bfd_make_section PARAMS ((bfd *, const char *name));
    13181507
    1319 boolean
     1508bfd_boolean
    13201509bfd_set_section_flags PARAMS ((bfd *abfd, asection *sec, flagword flags));
    13211510
     
    13271516    PTR obj));
    13281517
    1329 boolean
     1518bfd_boolean
    13301519bfd_set_section_size PARAMS ((bfd *abfd, asection *sec, bfd_size_type val));
    13311520
    1332 boolean
    1333 bfd_set_section_contents PARAMS ((bfd *abfd,
    1334     asection *section,
    1335     PTR data,
    1336     file_ptr offset,
     1521bfd_boolean
     1522bfd_set_section_contents PARAMS ((bfd *abfd, asection *section,
     1523    PTR data, file_ptr offset,
    13371524    bfd_size_type count));
    13381525
    1339 boolean
    1340 bfd_get_section_contents PARAMS ((bfd *abfd, asection *section, PTR location,
    1341     file_ptr offset, bfd_size_type count));
    1342 
    1343 boolean
    1344 bfd_copy_private_section_data PARAMS ((bfd *ibfd, asection *isec, bfd *obfd, asection *osec));
     1526bfd_boolean
     1527bfd_get_section_contents PARAMS ((bfd *abfd, asection *section,
     1528    PTR location, file_ptr offset,
     1529    bfd_size_type count));
     1530
     1531bfd_boolean
     1532bfd_copy_private_section_data PARAMS ((bfd *ibfd, asection *isec,
     1533    bfd *obfd, asection *osec));
    13451534
    13461535#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
     
    13501539_bfd_strip_section_from_output PARAMS ((struct bfd_link_info *info, asection *section));
    13511540
     1541bfd_boolean
     1542bfd_generic_discard_group PARAMS ((bfd *abfd, asection *group));
     1543
     1544/* Extracted from archures.c.  */
    13521545enum bfd_architecture
    13531546{
    1354   bfd_arch_unknown,   /* File arch not known */
    1355   bfd_arch_obscure,   /* Arch known, not one of these */
     1547  bfd_arch_unknown,   /* File arch not known. */
     1548  bfd_arch_obscure,   /* Arch known, not one of these. */
    13561549  bfd_arch_m68k,      /* Motorola 68xxx */
    13571550#define bfd_mach_m68000 1
     
    13751568       The exception is the "ca", which is
    13761569       incompatible with all other machines except
    1377        "core". */
     1570       "core".  */
    13781571
    13791572#define bfd_mach_i960_core      1
     
    13861579#define bfd_mach_i960_hx        8
    13871580
     1581  bfd_arch_or32,      /* OpenRISC 32 */
     1582
    13881583  bfd_arch_a29k,      /* AMD 29000 */
    13891584  bfd_arch_sparc,     /* SPARC */
     
    13931588#define bfd_mach_sparc_sparclite       3
    13941589#define bfd_mach_sparc_v8plus          4
    1395 #define bfd_mach_sparc_v8plusa         5 /* with ultrasparc add'ns */
     1590#define bfd_mach_sparc_v8plusa         5 /* with ultrasparc add'ns. */
    13961591#define bfd_mach_sparc_sparclite_le    6
    13971592#define bfd_mach_sparc_v9              7
    1398 #define bfd_mach_sparc_v9a             8 /* with ultrasparc add'ns */
    1399 #define bfd_mach_sparc_v8plusb         9 /* with cheetah add'ns */
    1400 #define bfd_mach_sparc_v9b             10 /* with cheetah add'ns */
     1593#define bfd_mach_sparc_v9a             8 /* with ultrasparc add'ns. */
     1594#define bfd_mach_sparc_v8plusb         9 /* with cheetah add'ns. */
     1595#define bfd_mach_sparc_v9b             10 /* with cheetah add'ns. */
    14011596/* Nonzero if MACH has the v9 instruction set.  */
    14021597#define bfd_mach_sparc_v9_p(mach) \
     
    14101605#define bfd_mach_mips4100              4100
    14111606#define bfd_mach_mips4111              4111
     1607#define bfd_mach_mips4120              4120
    14121608#define bfd_mach_mips4300              4300
    14131609#define bfd_mach_mips4400              4400
     
    14151611#define bfd_mach_mips4650              4650
    14161612#define bfd_mach_mips5000              5000
     1613#define bfd_mach_mips5400              5400
     1614#define bfd_mach_mips5500              5500
    14171615#define bfd_mach_mips6000              6000
    14181616#define bfd_mach_mips8000              8000
     
    14201618#define bfd_mach_mips12000             12000
    14211619#define bfd_mach_mips16                16
    1422 #define bfd_mach_mips32                32
    1423 #define bfd_mach_mips32_4k             3204113 /* 32, 04, octal 'K' */
    14241620#define bfd_mach_mips5                 5
    1425 #define bfd_mach_mips64                64
    14261621#define bfd_mach_mips_sb1              12310201 /* octal 'SB', 01 */
     1622#define bfd_mach_mipsisa32             32
     1623#define bfd_mach_mipsisa32r2           33
     1624#define bfd_mach_mipsisa64             64
    14271625  bfd_arch_i386,      /* Intel 386 */
    1428 #define bfd_mach_i386_i386 0
    1429 #define bfd_mach_i386_i8086 1
    1430 #define bfd_mach_i386_i386_intel_syntax 2
    1431 #define bfd_mach_x86_64 3
    1432 #define bfd_mach_x86_64_intel_syntax 4
     1626#define bfd_mach_i386_i386 1
     1627#define bfd_mach_i386_i8086 2
     1628#define bfd_mach_i386_i386_intel_syntax 3
     1629#define bfd_mach_x86_64 64
     1630#define bfd_mach_x86_64_intel_syntax 65
    14331631  bfd_arch_we32k,     /* AT&T WE32xxx */
    14341632  bfd_arch_tahoe,     /* CCI/Harris Tahoe */
     
    14391637  bfd_arch_convex,    /* Convex */
    14401638  bfd_arch_m88k,      /* Motorola 88xxx */
     1639  bfd_arch_m98k,      /* Motorola 98xxx */
    14411640  bfd_arch_pyramid,   /* Pyramid Technology */
    1442   bfd_arch_h8300,     /* Hitachi H8/300 */
    1443 #define bfd_mach_h8300   1
    1444 #define bfd_mach_h8300h  2
    1445 #define bfd_mach_h8300s  3
     1641  bfd_arch_h8300,     /* Renesas H8/300 (formerly Hitachi H8/300) */
     1642#define bfd_mach_h8300    1
     1643#define bfd_mach_h8300h   2
     1644#define bfd_mach_h8300s   3
     1645#define bfd_mach_h8300hn  4
     1646#define bfd_mach_h8300sn  5
     1647  bfd_arch_pdp11,     /* DEC PDP-11 */
    14461648  bfd_arch_powerpc,   /* PowerPC */
    1447 #define bfd_mach_ppc           0
     1649#define bfd_mach_ppc           32
     1650#define bfd_mach_ppc64         64
    14481651#define bfd_mach_ppc_403       403
    14491652#define bfd_mach_ppc_403gc     4030
     
    14621665#define bfd_mach_ppc_rs64iii   643
    14631666#define bfd_mach_ppc_7400      7400
     1667#define bfd_mach_ppc_e500      500
    14641668  bfd_arch_rs6000,    /* IBM RS/6000 */
    1465 #define bfd_mach_rs6k          0
     1669#define bfd_mach_rs6k          6000
    14661670#define bfd_mach_rs6k_rs1      6001
    14671671#define bfd_mach_rs6k_rsc      6003
     
    14691673  bfd_arch_hppa,      /* HP PA RISC */
    14701674  bfd_arch_d10v,      /* Mitsubishi D10V */
    1471 #define bfd_mach_d10v          0
     1675#define bfd_mach_d10v          1
    14721676#define bfd_mach_d10v_ts2      2
    14731677#define bfd_mach_d10v_ts3      3
    14741678  bfd_arch_d30v,      /* Mitsubishi D30V */
     1679  bfd_arch_dlx,       /* DLX */
    14751680  bfd_arch_m68hc11,   /* Motorola 68HC11 */
    14761681  bfd_arch_m68hc12,   /* Motorola 68HC12 */
     1682#define bfd_mach_m6812_default 0
     1683#define bfd_mach_m6812         1
     1684#define bfd_mach_m6812s        2
    14771685  bfd_arch_z8k,       /* Zilog Z8000 */
    14781686#define bfd_mach_z8001         1
    14791687#define bfd_mach_z8002         2
    1480   bfd_arch_h8500,     /* Hitachi H8/500 */
    1481   bfd_arch_sh,        /* Hitachi SH */
    1482 #define bfd_mach_sh            0
     1688  bfd_arch_h8500,     /* Renesas H8/500 (formerly Hitachi H8/500) */
     1689  bfd_arch_sh,        /* Renesas / SuperH SH (formerly Hitachi SH) */
     1690#define bfd_mach_sh            1
    14831691#define bfd_mach_sh2        0x20
    14841692#define bfd_mach_sh_dsp     0x2d
     1693#define bfd_mach_sh2e       0x2e
    14851694#define bfd_mach_sh3        0x30
    14861695#define bfd_mach_sh3_dsp    0x3d
    14871696#define bfd_mach_sh3e       0x3e
    14881697#define bfd_mach_sh4        0x40
     1698#define bfd_mach_sh5        0x50
    14891699  bfd_arch_alpha,     /* Dec Alpha */
    14901700#define bfd_mach_alpha_ev4  0x10
    14911701#define bfd_mach_alpha_ev5  0x20
    14921702#define bfd_mach_alpha_ev6  0x30
    1493   bfd_arch_arm,       /* Advanced Risc Machines ARM */
     1703  bfd_arch_arm,       /* Advanced Risc Machines ARM.  */
     1704#define bfd_mach_arm_unknown   0
    14941705#define bfd_mach_arm_2         1
    14951706#define bfd_mach_arm_2a        2
     
    15021713#define bfd_mach_arm_5TE       9
    15031714#define bfd_mach_arm_XScale    10
     1715#define bfd_mach_arm_ep9312    11
     1716#define bfd_mach_arm_iWMMXt    12
    15041717  bfd_arch_ns32k,     /* National Semiconductors ns32000 */
    15051718  bfd_arch_w65,       /* WDC 65816 */
    15061719  bfd_arch_tic30,     /* Texas Instruments TMS320C30 */
     1720  bfd_arch_tic4x,     /* Texas Instruments TMS320C3X/4X */
     1721#define bfd_mach_tic3x         30
     1722#define bfd_mach_tic4x         40
    15071723  bfd_arch_tic54x,    /* Texas Instruments TMS320C54X */
    15081724  bfd_arch_tic80,     /* TI TMS320c80 (MVP) */
    15091725  bfd_arch_v850,      /* NEC V850 */
    1510 #define bfd_mach_v850          0
     1726#define bfd_mach_v850          1
    15111727#define bfd_mach_v850e         'E'
    1512 #define bfd_mach_v850ea        'A'
    15131728  bfd_arch_arc,       /* ARC Cores */
    1514 #define bfd_mach_arc_5         0
    1515 #define bfd_mach_arc_6         1
    1516 #define bfd_mach_arc_7         2
    1517 #define bfd_mach_arc_8         3
    1518   bfd_arch_m32r,      /* Mitsubishi M32R/D */
    1519 #define bfd_mach_m32r          0 /* backwards compatibility */
     1729#define bfd_mach_arc_5         5
     1730#define bfd_mach_arc_6         6
     1731#define bfd_mach_arc_7         7
     1732#define bfd_mach_arc_8         8
     1733  bfd_arch_m32r,      /* Renesas M32R (formerly Mitsubishi M32R/D) */
     1734#define bfd_mach_m32r          1 /* For backwards compatibility. */
    15201735#define bfd_mach_m32rx         'x'
    15211736  bfd_arch_mn10200,   /* Matsushita MN10200 */
     
    15251740  bfd_arch_fr30,
    15261741#define bfd_mach_fr30          0x46523330
     1742  bfd_arch_frv,
     1743#define bfd_mach_frv           1
     1744#define bfd_mach_frvsimple     2
     1745#define bfd_mach_fr300         300
     1746#define bfd_mach_fr400         400
     1747#define bfd_mach_frvtomcat     499     /* fr500 prototype */
     1748#define bfd_mach_fr500         500
    15271749  bfd_arch_mcore,
    15281750  bfd_arch_ia64,      /* HP/Intel ia64 */
    1529 #define bfd_mach_ia64_elf64    0
    1530 #define bfd_mach_ia64_elf32    1
     1751#define bfd_mach_ia64_elf64    64
     1752#define bfd_mach_ia64_elf32    32
     1753  bfd_arch_ip2k,      /* Ubicom IP2K microcontrollers. */
     1754#define bfd_mach_ip2022        1
     1755#define bfd_mach_ip2022ext     2
     1756 bfd_arch_iq2000,     /* Vitesse IQ2000.  */
     1757#define bfd_mach_iq2000        1
     1758#define bfd_mach_iq10          2
    15311759  bfd_arch_pj,
    1532   bfd_arch_avr,       /* Atmel AVR microcontrollers */
     1760  bfd_arch_avr,       /* Atmel AVR microcontrollers. */
    15331761#define bfd_mach_avr1          1
    15341762#define bfd_mach_avr2          2
     
    15371765#define bfd_mach_avr5          5
    15381766  bfd_arch_cris,      /* Axis CRIS */
     1767  bfd_arch_s390,      /* IBM s390 */
     1768#define bfd_mach_s390_31       31
     1769#define bfd_mach_s390_64       64
     1770  bfd_arch_openrisc,  /* OpenRISC */
     1771  bfd_arch_mmix,      /* Donald Knuth's educational processor.  */
     1772  bfd_arch_xstormy16,
     1773#define bfd_mach_xstormy16     1
     1774  bfd_arch_msp430,    /* Texas Instruments MSP430 architecture.  */
     1775#define bfd_mach_msp110         110
     1776#define bfd_mach_msp11          11
     1777#define bfd_mach_msp12          12
     1778#define bfd_mach_msp13          13
     1779#define bfd_mach_msp14          14
     1780#define bfd_mach_msp41          41
     1781#define bfd_mach_msp31          31
     1782#define bfd_mach_msp32          32
     1783#define bfd_mach_msp33          33
     1784#define bfd_mach_msp43          43
     1785#define bfd_mach_msp44          44
     1786#define bfd_mach_msp15          15
     1787#define bfd_mach_msp16          16
     1788  bfd_arch_xtensa,    /* Tensilica's Xtensa cores.  */
     1789#define bfd_mach_xtensa        1
    15391790  bfd_arch_last
    15401791  };
     
    15501801  const char *printable_name;
    15511802  unsigned int section_align_power;
    1552   /* True if this is the default machine for the architecture.  */
    1553   boolean the_default;
     1803  /* TRUE if this is the default machine for the architecture.
     1804     The default arch should be the first entry for an arch so that
     1805     all the entries for that arch can be accessed via <<next>>.  */
     1806  bfd_boolean the_default;
    15541807  const struct bfd_arch_info * (*compatible)
    15551808       PARAMS ((const struct bfd_arch_info *a,
    15561809                const struct bfd_arch_info *b));
    15571810
    1558   boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *));
     1811  bfd_boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *));
    15591812
    15601813  const struct bfd_arch_info *next;
    1561 } bfd_arch_info_type;
     1814}
     1815bfd_arch_info_type;
     1816
    15621817const char *
    15631818bfd_printable_name PARAMS ((bfd *abfd));
     
    15721827bfd_arch_get_compatible PARAMS ((
    15731828    const bfd *abfd,
    1574     const bfd *bbfd));
     1829    const bfd *bbfd,
     1830    bfd_boolean accept_unknowns));
    15751831
    15761832void
     
    16071863    unsigned long machine));
    16081864
     1865/* Extracted from reloc.c.  */
    16091866typedef enum bfd_reloc_status
    16101867{
    1611        /* No errors detected */
     1868  /* No errors detected. */
    16121869  bfd_reloc_ok,
    16131870
    1614        /* The relocation was performed, but there was an overflow. */
     1871  /* The relocation was performed, but there was an overflow. */
    16151872  bfd_reloc_overflow,
    16161873
    1617        /* The address to relocate was not within the section supplied. */
     1874  /* The address to relocate was not within the section supplied. */
    16181875  bfd_reloc_outofrange,
    16191876
    1620        /* Used by special functions */
     1877  /* Used by special functions. */
    16211878  bfd_reloc_continue,
    16221879
    1623        /* Unsupported relocation size requested. */
     1880  /* Unsupported relocation size requested. */
    16241881  bfd_reloc_notsupported,
    16251882
    1626        /* Unused */
     1883  /* Unused. */
    16271884  bfd_reloc_other,
    16281885
    1629        /* The symbol to relocate against was undefined. */
     1886  /* The symbol to relocate against was undefined. */
    16301887  bfd_reloc_undefined,
    16311888
    1632        /* The relocation was performed, but may not be ok - presently
    1633           generated only when linking i960 coff files with i960 b.out
    1634           symbols.  If this type is returned, the error_message argument
    1635           to bfd_perform_relocation will be set.  */
     1889  /* The relocation was performed, but may not be ok - presently
     1890     generated only when linking i960 coff files with i960 b.out
     1891     symbols.  If this type is returned, the error_message argument
     1892     to bfd_perform_relocation will be set.  */
    16361893  bfd_reloc_dangerous
    16371894 }
     
    16411898typedef struct reloc_cache_entry
    16421899{
    1643        /* A pointer into the canonical table of pointers  */
     1900  /* A pointer into the canonical table of pointers.  */
    16441901  struct symbol_cache_entry **sym_ptr_ptr;
    16451902
    1646        /* offset in section */
     1903  /* offset in section. */
    16471904  bfd_size_type address;
    16481905
    1649        /* addend for relocation value */
     1906  /* addend for relocation value. */
    16501907  bfd_vma addend;
    16511908
    1652        /* Pointer to how to perform the required relocation */
     1909  /* Pointer to how to perform the required relocation. */
    16531910  reloc_howto_type *howto;
    16541911
    1655 } arelent;
     1912}
     1913arelent;
     1914
    16561915enum complain_overflow
    16571916{
    1658        /* Do not complain on overflow. */
     1917  /* Do not complain on overflow. */
    16591918  complain_overflow_dont,
    16601919
    1661        /* Complain if the bitfield overflows, whether it is considered
    1662           as signed or unsigned. */
     1920  /* Complain if the bitfield overflows, whether it is considered
     1921     as signed or unsigned. */
    16631922  complain_overflow_bitfield,
    16641923
    1665        /* Complain if the value overflows when considered as signed
    1666           number. */
     1924  /* Complain if the value overflows when considered as signed
     1925     number. */
    16671926  complain_overflow_signed,
    16681927
    1669        /* Complain if the value overflows when considered as an
    1670           unsigned number. */
     1928  /* Complain if the value overflows when considered as an
     1929     unsigned number. */
    16711930  complain_overflow_unsigned
    16721931};
     
    16741933struct reloc_howto_struct
    16751934{
    1676        /*  The type field has mainly a documentary use - the back end can
    1677            do what it wants with it, though normally the back end's
    1678            external idea of what a reloc number is stored
    1679            in this field. For example, a PC relative word relocation
    1680            in a coff environment has the type 023 - because that's
    1681            what the outside world calls a R_PCRWORD reloc. */
     1935  /*  The type field has mainly a documentary use - the back end can
     1936      do what it wants with it, though normally the back end's
     1937      external idea of what a reloc number is stored
     1938      in this field. For example, a PC relative word relocation
     1939      in a coff environment has the type 023 - because that's
     1940      what the outside world calls a R_PCRWORD reloc. */
    16821941  unsigned int type;
    16831942
    1684        /*  The value the final relocation is shifted right by. This drops
    1685            unwanted data from the relocation.  */
     1943  /*  The value the final relocation is shifted right by. This drops
     1944      unwanted data from the relocation.  */
    16861945  unsigned int rightshift;
    16871946
    1688        /*  The size of the item to be relocated.  This is *not* a
    1689            power-of-two measure.  To get the number of bytes operated
    1690            on by a type of relocation, use bfd_get_reloc_size.  */
     1947  /*  The size of the item to be relocated.  This is *not* a
     1948      power-of-two measure.  To get the number of bytes operated
     1949      on by a type of relocation, use bfd_get_reloc_size.  */
    16911950  int size;
    16921951
    1693        /*  The number of bits in the item to be relocated.  This is used
    1694            when doing overflow checking.  */
     1952  /*  The number of bits in the item to be relocated.  This is used
     1953      when doing overflow checking.  */
    16951954  unsigned int bitsize;
    16961955
    1697        /*  Notes that the relocation is relative to the location in the
    1698            data section of the addend. The relocation function will
    1699            subtract from the relocation value the address of the location
    1700            being relocated. */
    1701   boolean pc_relative;
    1702 
    1703        /*  The bit position of the reloc value in the destination.
    1704            The relocated value is left shifted by this amount. */
     1956  /*  Notes that the relocation is relative to the location in the
     1957      data section of the addend. The relocation function will
     1958      subtract from the relocation value the address of the location
     1959      being relocated. */
     1960  bfd_boolean pc_relative;
     1961
     1962  /*  The bit position of the reloc value in the destination.
     1963      The relocated value is left shifted by this amount. */
    17051964  unsigned int bitpos;
    17061965
    1707        /* What type of overflow error should be checked for when
    1708           relocating. */
     1966  /* What type of overflow error should be checked for when
     1967     relocating. */
    17091968  enum complain_overflow complain_on_overflow;
    17101969
    1711        /* If this field is non null, then the supplied function is
    1712           called rather than the normal function. This allows really
    1713           strange relocation methods to be accomodated (e.g., i960 callj
    1714           instructions). */
     1970  /* If this field is non null, then the supplied function is
     1971     called rather than the normal function. This allows really
     1972     strange relocation methods to be accomodated (e.g., i960 callj
     1973     instructions). */
    17151974  bfd_reloc_status_type (*special_function)
    1716                                    PARAMS ((bfd *abfd,
    1717                                             arelent *reloc_entry,
    1718                                             struct symbol_cache_entry *symbol,
    1719                                             PTR data,
    1720                                             asection *input_section,
    1721                                             bfd *output_bfd,
    1722                                             char **error_message));
    1723 
    1724        /* The textual name of the relocation type. */
     1975    PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *,
     1976             bfd *, char **));
     1977
     1978  /* The textual name of the relocation type.  */
    17251979  char *name;
    17261980
    1727        /* Some formats record a relocation addend in the section contents
    1728           rather than with the relocation.  For ELF formats this is the
    1729           distinction between USE_REL and USE_RELA (though the code checks
    1730           for USE_REL == 1/0).  The value of this field is TRUE if the
    1731           addend is recorded with the section contents; when performing a
    1732           partial link (ld -r) the section contents (the data) will be
    1733           modified.  The value of this field is FALSE if addends are
    1734           recorded with the relocation (in arelent.addend); when performing
    1735           a partial link the relocation will be modified.
    1736           All relocations for all ELF USE_RELA targets should set this field
    1737           to FALSE (values of TRUE should be looked on with suspicion).
    1738           However, the converse is not true: not all relocations of all ELF
    1739           USE_REL targets set this field to TRUE.  Why this is so is peculiar
    1740           to each particular target.  For relocs that aren't used in partial
    1741           links (e.g. GOT stuff) it doesn't matter what this is set to.  */
    1742   boolean partial_inplace;
    1743 
    1744        /* The src_mask selects which parts of the read in data
    1745           are to be used in the relocation sum.  E.g., if this was an 8 bit
    1746           byte of data which we read and relocated, this would be
    1747           0x000000ff. When we have relocs which have an addend, such as
    1748           sun4 extended relocs, the value in the offset part of a
    1749           relocating field is garbage so we never use it. In this case
    1750           the mask would be 0x00000000. */
     1981  /* Some formats record a relocation addend in the section contents
     1982     rather than with the relocation.  For ELF formats this is the
     1983     distinction between USE_REL and USE_RELA (though the code checks
     1984     for USE_REL == 1/0).  The value of this field is TRUE if the
     1985     addend is recorded with the section contents; when performing a
     1986     partial link (ld -r) the section contents (the data) will be
     1987     modified.  The value of this field is FALSE if addends are
     1988     recorded with the relocation (in arelent.addend); when performing
     1989     a partial link the relocation will be modified.
     1990     All relocations for all ELF USE_RELA targets should set this field
     1991     to FALSE (values of TRUE should be looked on with suspicion).
     1992     However, the converse is not true: not all relocations of all ELF
     1993     USE_REL targets set this field to TRUE.  Why this is so is peculiar
     1994     to each particular target.  For relocs that aren't used in partial
     1995     links (e.g. GOT stuff) it doesn't matter what this is set to.  */
     1996  bfd_boolean partial_inplace;
     1997
     1998  /* src_mask selects the part of the instruction (or data) to be used
     1999     in the relocation sum.  If the target relocations don't have an
     2000     addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
     2001     dst_mask to extract the addend from the section contents.  If
     2002     relocations do have an addend in the reloc, eg. ELF USE_RELA, this
     2003     field should be zero.  Non-zero values for ELF USE_RELA targets are
     2004     bogus as in those cases the value in the dst_mask part of the
     2005     section contents should be treated as garbage.  */
    17512006  bfd_vma src_mask;
    17522007
    1753        /* The dst_mask selects which parts of the instruction are replaced
    1754           into the instruction. In most cases src_mask == dst_mask,
    1755           except in the above special case, where dst_mask would be
    1756           0x000000ff, and src_mask would be 0x00000000.   */
     2008  /* dst_mask selects which parts of the instruction (or data) are
     2009     replaced with a relocated value.  */
    17572010  bfd_vma dst_mask;
    17582011
    1759        /* When some formats create PC relative instructions, they leave
    1760           the value of the pc of the place being relocated in the offset
    1761           slot of the instruction, so that a PC relative relocation can
    1762           be made just by adding in an ordinary offset (e.g., sun3 a.out).
    1763           Some formats leave the displacement part of an instruction
    1764           empty (e.g., m88k bcs); this flag signals the fact.*/
    1765   boolean pcrel_offset;
    1766 
     2012  /* When some formats create PC relative instructions, they leave
     2013     the value of the pc of the place being relocated in the offset
     2014     slot of the instruction, so that a PC relative relocation can
     2015     be made just by adding in an ordinary offset (e.g., sun3 a.out).
     2016     Some formats leave the displacement part of an instruction
     2017     empty (e.g., m88k bcs); this flag signals the fact.  */
     2018  bfd_boolean pcrel_offset;
    17672019};
    1768 #define HOWTO(C, R,S,B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
    1769   {(unsigned)C,R,S,B, P, BI, O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC}
    1770 #define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN)
     2020
     2021#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
     2022  { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC }
     2023#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \
     2024  HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \
     2025         NAME, FALSE, 0, 0, IN)
    17712026
    17722027#define EMPTY_HOWTO(C) \
    1773   HOWTO((C),0,0,0,false,0,complain_overflow_dont,NULL,NULL,false,0,0,false)
    1774 
    1775 #define HOWTO_PREPARE(relocation, symbol)      \
    1776   {                                            \
    1777   if (symbol != (asymbol *)NULL) {             \
    1778     if (bfd_is_com_section (symbol->section)) { \
    1779       relocation = 0;                          \
    1780     }                                          \
    1781     else {                                     \
    1782       relocation = symbol->value;              \
    1783     }                                          \
    1784   }                                            \
    1785 }
     2028  HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
     2029         NULL, FALSE, 0, 0, FALSE)
     2030
     2031#define HOWTO_PREPARE(relocation, symbol)               \
     2032  {                                                     \
     2033    if (symbol != (asymbol *) NULL)                     \
     2034      {                                                 \
     2035        if (bfd_is_com_section (symbol->section))       \
     2036          {                                             \
     2037            relocation = 0;                             \
     2038          }                                             \
     2039        else                                            \
     2040          {                                             \
     2041            relocation = symbol->value;                 \
     2042          }                                             \
     2043      }                                                 \
     2044  }
     2045
    17862046unsigned int
    17872047bfd_get_reloc_size PARAMS ((reloc_howto_type *));
    17882048
    1789 typedef struct relent_chain {
     2049typedef struct relent_chain
     2050{
    17902051  arelent relent;
    1791   struct   relent_chain *next;
    1792 } arelent_chain;
     2052  struct relent_chain *next;
     2053}
     2054arelent_chain;
     2055
    17932056bfd_reloc_status_type
    17942057bfd_check_overflow PARAMS ((enum complain_overflow how,
     
    18172080
    18182081
    1819 /* Basic absolute relocations of N bits. */
     2082/* Basic absolute relocations of N bits.  */
    18202083  BFD_RELOC_64,
    18212084  BFD_RELOC_32,
     
    18302093the section containing the relocation.  It depends on the specific target.
    18312094
    1832 The 24-bit relocation is used in some Intel 960 configurations. */
     2095The 24-bit relocation is used in some Intel 960 configurations.  */
    18332096  BFD_RELOC_64_PCREL,
    18342097  BFD_RELOC_32_PCREL,
     
    18382101  BFD_RELOC_8_PCREL,
    18392102
    1840 /* For ELF. */
     2103/* For ELF.  */
    18412104  BFD_RELOC_32_GOT_PCREL,
    18422105  BFD_RELOC_16_GOT_PCREL,
     
    18482111  BFD_RELOC_HI16_S_GOTOFF,
    18492112  BFD_RELOC_8_GOTOFF,
     2113  BFD_RELOC_64_PLT_PCREL,
    18502114  BFD_RELOC_32_PLT_PCREL,
    18512115  BFD_RELOC_24_PLT_PCREL,
    18522116  BFD_RELOC_16_PLT_PCREL,
    18532117  BFD_RELOC_8_PLT_PCREL,
     2118  BFD_RELOC_64_PLTOFF,
    18542119  BFD_RELOC_32_PLTOFF,
    18552120  BFD_RELOC_16_PLTOFF,
     
    18592124  BFD_RELOC_8_PLTOFF,
    18602125
    1861 /* Relocations used by 68K ELF. */
     2126/* Relocations used by 68K ELF.  */
    18622127  BFD_RELOC_68K_GLOB_DAT,
    18632128  BFD_RELOC_68K_JMP_SLOT,
    18642129  BFD_RELOC_68K_RELATIVE,
    18652130
    1866 /* Linkage-table relative. */
     2131/* Linkage-table relative.  */
    18672132  BFD_RELOC_32_BASEREL,
    18682133  BFD_RELOC_16_BASEREL,
     
    18732138  BFD_RELOC_RVA,
    18742139
    1875 /* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */
     2140/* Absolute 8-bit relocation, but used to form an address like 0xFFnn.  */
    18762141  BFD_RELOC_8_FFnn,
    18772142
     
    18812146SPARC.  (SPARC tools generally refer to this as <<WDISP30>>.)  The
    18822147signed 16-bit displacement is used on the MIPS, and the 23-bit
    1883 displacement is used on the Alpha. */
     2148displacement is used on the Alpha.  */
    18842149  BFD_RELOC_32_PCREL_S2,
    18852150  BFD_RELOC_16_PCREL_S2,
     
    18872152
    18882153/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
    1889 the target word.  These are used on the SPARC. */
     2154the target word.  These are used on the SPARC.  */
    18902155  BFD_RELOC_HI22,
    18912156  BFD_RELOC_LO10,
     
    18942159displacements off that register.  These relocation types are
    18952160handled specially, because the value the register will have is
    1896 decided relatively late. */
     2161decided relatively late.  */
    18972162  BFD_RELOC_GPREL16,
    18982163  BFD_RELOC_GPREL32,
    18992164
    1900 /* Reloc types used for i960/b.out. */
     2165/* Reloc types used for i960/b.out.  */
    19012166  BFD_RELOC_I960_CALLJ,
    19022167
    19032168/* SPARC ELF relocations.  There is probably some overlap with other
    1904 relocation types already defined. */
     2169relocation types already defined.  */
    19052170  BFD_RELOC_NONE,
    19062171  BFD_RELOC_SPARC_WDISP22,
     
    19212186  BFD_RELOC_SPARC_UA64,
    19222187
    1923 /* I think these are specific to SPARC a.out (e.g., Sun 4). */
     2188/* I think these are specific to SPARC a.out (e.g., Sun 4).  */
    19242189  BFD_RELOC_SPARC_BASE13,
    19252190  BFD_RELOC_SPARC_BASE22,
    19262191
    1927 /* SPARC64 relocations */
     2192/* SPARC64 relocations  */
    19282193#define BFD_RELOC_SPARC_64 BFD_RELOC_64
    19292194  BFD_RELOC_SPARC_10,
     
    19422207  BFD_RELOC_SPARC_5,
    19432208#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
     2209  BFD_RELOC_SPARC_PLT32,
    19442210  BFD_RELOC_SPARC_PLT64,
    19452211  BFD_RELOC_SPARC_HIX22,
     
    19502216  BFD_RELOC_SPARC_REGISTER,
    19512217
    1952 /* SPARC little endian relocation */
     2218/* SPARC little endian relocation  */
    19532219  BFD_RELOC_SPARC_REV32,
     2220
     2221/* SPARC TLS relocations  */
     2222  BFD_RELOC_SPARC_TLS_GD_HI22,
     2223  BFD_RELOC_SPARC_TLS_GD_LO10,
     2224  BFD_RELOC_SPARC_TLS_GD_ADD,
     2225  BFD_RELOC_SPARC_TLS_GD_CALL,
     2226  BFD_RELOC_SPARC_TLS_LDM_HI22,
     2227  BFD_RELOC_SPARC_TLS_LDM_LO10,
     2228  BFD_RELOC_SPARC_TLS_LDM_ADD,
     2229  BFD_RELOC_SPARC_TLS_LDM_CALL,
     2230  BFD_RELOC_SPARC_TLS_LDO_HIX22,
     2231  BFD_RELOC_SPARC_TLS_LDO_LOX10,
     2232  BFD_RELOC_SPARC_TLS_LDO_ADD,
     2233  BFD_RELOC_SPARC_TLS_IE_HI22,
     2234  BFD_RELOC_SPARC_TLS_IE_LO10,
     2235  BFD_RELOC_SPARC_TLS_IE_LD,
     2236  BFD_RELOC_SPARC_TLS_IE_LDX,
     2237  BFD_RELOC_SPARC_TLS_IE_ADD,
     2238  BFD_RELOC_SPARC_TLS_LE_HIX22,
     2239  BFD_RELOC_SPARC_TLS_LE_LOX10,
     2240  BFD_RELOC_SPARC_TLS_DTPMOD32,
     2241  BFD_RELOC_SPARC_TLS_DTPMOD64,
     2242  BFD_RELOC_SPARC_TLS_DTPOFF32,
     2243  BFD_RELOC_SPARC_TLS_DTPOFF64,
     2244  BFD_RELOC_SPARC_TLS_TPOFF32,
     2245  BFD_RELOC_SPARC_TLS_TPOFF64,
    19542246
    19552247/* Alpha ECOFF and ELF relocations.  Some of these treat the symbol or
     
    19582250writing; when reading, it will be the absolute section symbol.  The
    19592251addend is the displacement in bytes of the "lda" instruction from
    1960 the "ldah" instruction (which is at the address of this reloc). */
     2252the "ldah" instruction (which is at the address of this reloc).  */
    19612253  BFD_RELOC_ALPHA_GPDISP_HI16,
    19622254
     
    19642256with GPDISP_HI16 relocs.  The addend is ignored when writing the
    19652257relocations out, and is filled in with the file's GP value on
    1966 reading, for convenience. */
     2258reading, for convenience.  */
    19672259  BFD_RELOC_ALPHA_GPDISP_LO16,
    19682260
    19692261/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
    19702262relocation except that there is no accompanying GPDISP_LO16
    1971 relocation. */
     2263relocation.  */
    19722264  BFD_RELOC_ALPHA_GPDISP,
    19732265
     
    199422861 - "memory" fmt insn
    199522872 - byte-manipulation (byte offset reg)
    1996 3 - jsr (target of branch)
    1997 
    1998 The GNU linker currently doesn't do any of this optimizing. */
     22883 - jsr (target of branch)  */
    19992289  BFD_RELOC_ALPHA_LITERAL,
    20002290  BFD_RELOC_ALPHA_ELF_LITERAL,
    20012291  BFD_RELOC_ALPHA_LITUSE,
    20022292
    2003 /* The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to
    2004 process the explicit !<reloc>!sequence relocations, and are mapped
    2005 into the normal relocations at the end of processing. */
    2006   BFD_RELOC_ALPHA_USER_LITERAL,
    2007   BFD_RELOC_ALPHA_USER_LITUSE_BASE,
    2008   BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF,
    2009   BFD_RELOC_ALPHA_USER_LITUSE_JSR,
    2010   BFD_RELOC_ALPHA_USER_GPDISP,
    2011   BFD_RELOC_ALPHA_USER_GPRELHIGH,
    2012   BFD_RELOC_ALPHA_USER_GPRELLOW,
    2013 
    20142293/* The HINT relocation indicates a value that should be filled into the
    20152294"hint" field of a jmp/jsr/ret instruction, for possible branch-
    2016 prediction logic which may be provided on some processors. */
     2295prediction logic which may be provided on some processors.  */
    20172296  BFD_RELOC_ALPHA_HINT,
    20182297
    20192298/* The LINKAGE relocation outputs a linkage pair in the object file,
    2020 which is filled by the linker. */
     2299which is filled by the linker.  */
    20212300  BFD_RELOC_ALPHA_LINKAGE,
    20222301
    20232302/* The CODEADDR relocation outputs a STO_CA in the object file,
    2024 which is filled by the linker. */
     2303which is filled by the linker.  */
    20252304  BFD_RELOC_ALPHA_CODEADDR,
    20262305
     2306/* The GPREL_HI/LO relocations together form a 32-bit offset from the
     2307GP register.  */
     2308  BFD_RELOC_ALPHA_GPREL_HI16,
     2309  BFD_RELOC_ALPHA_GPREL_LO16,
     2310
     2311/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
     2312share a common GP, and the target address is adjusted for
     2313STO_ALPHA_STD_GPLOAD.  */
     2314  BFD_RELOC_ALPHA_BRSGP,
     2315
     2316/* Alpha thread-local storage relocations.  */
     2317  BFD_RELOC_ALPHA_TLSGD,
     2318  BFD_RELOC_ALPHA_TLSLDM,
     2319  BFD_RELOC_ALPHA_DTPMOD64,
     2320  BFD_RELOC_ALPHA_GOTDTPREL16,
     2321  BFD_RELOC_ALPHA_DTPREL64,
     2322  BFD_RELOC_ALPHA_DTPREL_HI16,
     2323  BFD_RELOC_ALPHA_DTPREL_LO16,
     2324  BFD_RELOC_ALPHA_DTPREL16,
     2325  BFD_RELOC_ALPHA_GOTTPREL16,
     2326  BFD_RELOC_ALPHA_TPREL64,
     2327  BFD_RELOC_ALPHA_TPREL_HI16,
     2328  BFD_RELOC_ALPHA_TPREL_LO16,
     2329  BFD_RELOC_ALPHA_TPREL16,
     2330
    20272331/* Bits 27..2 of the relocation address shifted right 2 bits;
    2028 simple reloc otherwise. */
     2332simple reloc otherwise.  */
    20292333  BFD_RELOC_MIPS_JMP,
    20302334
    2031 /* The MIPS16 jump instruction. */
     2335/* The MIPS16 jump instruction.  */
    20322336  BFD_RELOC_MIPS16_JMP,
    20332337
    2034 /* MIPS16 GP relative reloc. */
     2338/* MIPS16 GP relative reloc.  */
    20352339  BFD_RELOC_MIPS16_GPREL,
    20362340
    2037 /* High 16 bits of 32-bit value; simple reloc. */
     2341/* High 16 bits of 32-bit value; simple reloc.  */
    20382342  BFD_RELOC_HI16,
    20392343
     
    20412345extended and added to form the final result.  If the low 16
    20422346bits form a negative number, we need to add one to the high value
    2043 to compensate for the borrow when the low bits are added. */
     2347to compensate for the borrow when the low bits are added.  */
    20442348  BFD_RELOC_HI16_S,
    20452349
    2046 /* Low 16 bits. */
     2350/* Low 16 bits.  */
    20472351  BFD_RELOC_LO16,
    20482352
    2049 /* Like BFD_RELOC_HI16_S, but PC relative. */
     2353/* Like BFD_RELOC_HI16_S, but PC relative.  */
    20502354  BFD_RELOC_PCREL_HI16_S,
    20512355
    2052 /* Like BFD_RELOC_LO16, but PC relative. */
     2356/* Like BFD_RELOC_LO16, but PC relative.  */
    20532357  BFD_RELOC_PCREL_LO16,
    20542358
    2055 /* Relocation relative to the global pointer. */
    2056 #define BFD_RELOC_MIPS_GPREL BFD_RELOC_GPREL16
    2057 
    2058 /* Relocation against a MIPS literal section. */
     2359/* Relocation against a MIPS literal section.  */
    20592360  BFD_RELOC_MIPS_LITERAL,
    20602361
    2061 /* MIPS ELF relocations. */
     2362/* MIPS ELF relocations.  */
    20622363  BFD_RELOC_MIPS_GOT16,
    20632364  BFD_RELOC_MIPS_CALL16,
    2064 #define BFD_RELOC_MIPS_GPREL32 BFD_RELOC_GPREL32
    20652365  BFD_RELOC_MIPS_GOT_HI16,
    20662366  BFD_RELOC_MIPS_GOT_LO16,
     
    20832383  BFD_RELOC_MIPS_JALR,
    20842384
    2085 
    2086 /* i386/elf relocations */
     2385/* Fujitsu Frv Relocations.  */
     2386  BFD_RELOC_FRV_LABEL16,
     2387  BFD_RELOC_FRV_LABEL24,
     2388  BFD_RELOC_FRV_LO16,
     2389  BFD_RELOC_FRV_HI16,
     2390  BFD_RELOC_FRV_GPREL12,
     2391  BFD_RELOC_FRV_GPRELU12,
     2392  BFD_RELOC_FRV_GPREL32,
     2393  BFD_RELOC_FRV_GPRELHI,
     2394  BFD_RELOC_FRV_GPRELLO,
     2395
     2396
     2397/* i386/elf relocations  */
    20872398  BFD_RELOC_386_GOT32,
    20882399  BFD_RELOC_386_PLT32,
     
    20932404  BFD_RELOC_386_GOTOFF,
    20942405  BFD_RELOC_386_GOTPC,
    2095 
    2096 /* x86-64/elf relocations */
     2406  BFD_RELOC_386_TLS_TPOFF,
     2407  BFD_RELOC_386_TLS_IE,
     2408  BFD_RELOC_386_TLS_GOTIE,
     2409  BFD_RELOC_386_TLS_LE,
     2410  BFD_RELOC_386_TLS_GD,
     2411  BFD_RELOC_386_TLS_LDM,
     2412  BFD_RELOC_386_TLS_LDO_32,
     2413  BFD_RELOC_386_TLS_IE_32,
     2414  BFD_RELOC_386_TLS_LE_32,
     2415  BFD_RELOC_386_TLS_DTPMOD32,
     2416  BFD_RELOC_386_TLS_DTPOFF32,
     2417  BFD_RELOC_386_TLS_TPOFF32,
     2418
     2419/* x86-64/elf relocations  */
    20972420  BFD_RELOC_X86_64_GOT32,
    20982421  BFD_RELOC_X86_64_PLT32,
     
    21032426  BFD_RELOC_X86_64_GOTPCREL,
    21042427  BFD_RELOC_X86_64_32S,
    2105 
    2106 /* ns32k relocations */
     2428  BFD_RELOC_X86_64_DTPMOD64,
     2429  BFD_RELOC_X86_64_DTPOFF64,
     2430  BFD_RELOC_X86_64_TPOFF64,
     2431  BFD_RELOC_X86_64_TLSGD,
     2432  BFD_RELOC_X86_64_TLSLD,
     2433  BFD_RELOC_X86_64_DTPOFF32,
     2434  BFD_RELOC_X86_64_GOTTPOFF,
     2435  BFD_RELOC_X86_64_TPOFF32,
     2436
     2437/* ns32k relocations  */
    21072438  BFD_RELOC_NS32K_IMM_8,
    21082439  BFD_RELOC_NS32K_IMM_16,
     
    21182449  BFD_RELOC_NS32K_DISP_32_PCREL,
    21192450
    2120 /* Picojava relocs.  Not all of these appear in object files. */
     2451/* PDP11 relocations  */
     2452  BFD_RELOC_PDP11_DISP_8_PCREL,
     2453  BFD_RELOC_PDP11_DISP_6_PCREL,
     2454
     2455/* Picojava relocs.  Not all of these appear in object files.  */
    21212456  BFD_RELOC_PJ_CODE_HI16,
    21222457  BFD_RELOC_PJ_CODE_LO16,
     
    21262461  BFD_RELOC_PJ_CODE_REL32,
    21272462
    2128 /* Power(rs6000) and PowerPC relocations. */
     2463/* Power(rs6000) and PowerPC relocations.  */
    21292464  BFD_RELOC_PPC_B26,
    21302465  BFD_RELOC_PPC_BA26,
     
    21572492  BFD_RELOC_PPC_EMB_BIT_FLD,
    21582493  BFD_RELOC_PPC_EMB_RELSDA,
    2159 
    2160 /* IBM 370/390 relocations */
     2494  BFD_RELOC_PPC64_HIGHER,
     2495  BFD_RELOC_PPC64_HIGHER_S,
     2496  BFD_RELOC_PPC64_HIGHEST,
     2497  BFD_RELOC_PPC64_HIGHEST_S,
     2498  BFD_RELOC_PPC64_TOC16_LO,
     2499  BFD_RELOC_PPC64_TOC16_HI,
     2500  BFD_RELOC_PPC64_TOC16_HA,
     2501  BFD_RELOC_PPC64_TOC,
     2502  BFD_RELOC_PPC64_PLTGOT16,
     2503  BFD_RELOC_PPC64_PLTGOT16_LO,
     2504  BFD_RELOC_PPC64_PLTGOT16_HI,
     2505  BFD_RELOC_PPC64_PLTGOT16_HA,
     2506  BFD_RELOC_PPC64_ADDR16_DS,
     2507  BFD_RELOC_PPC64_ADDR16_LO_DS,
     2508  BFD_RELOC_PPC64_GOT16_DS,
     2509  BFD_RELOC_PPC64_GOT16_LO_DS,
     2510  BFD_RELOC_PPC64_PLT16_LO_DS,
     2511  BFD_RELOC_PPC64_SECTOFF_DS,
     2512  BFD_RELOC_PPC64_SECTOFF_LO_DS,
     2513  BFD_RELOC_PPC64_TOC16_DS,
     2514  BFD_RELOC_PPC64_TOC16_LO_DS,
     2515  BFD_RELOC_PPC64_PLTGOT16_DS,
     2516  BFD_RELOC_PPC64_PLTGOT16_LO_DS,
     2517
     2518/* PowerPC and PowerPC64 thread-local storage relocations.  */
     2519  BFD_RELOC_PPC_TLS,
     2520  BFD_RELOC_PPC_DTPMOD,
     2521  BFD_RELOC_PPC_TPREL16,
     2522  BFD_RELOC_PPC_TPREL16_LO,
     2523  BFD_RELOC_PPC_TPREL16_HI,
     2524  BFD_RELOC_PPC_TPREL16_HA,
     2525  BFD_RELOC_PPC_TPREL,
     2526  BFD_RELOC_PPC_DTPREL16,
     2527  BFD_RELOC_PPC_DTPREL16_LO,
     2528  BFD_RELOC_PPC_DTPREL16_HI,
     2529  BFD_RELOC_PPC_DTPREL16_HA,
     2530  BFD_RELOC_PPC_DTPREL,
     2531  BFD_RELOC_PPC_GOT_TLSGD16,
     2532  BFD_RELOC_PPC_GOT_TLSGD16_LO,
     2533  BFD_RELOC_PPC_GOT_TLSGD16_HI,
     2534  BFD_RELOC_PPC_GOT_TLSGD16_HA,
     2535  BFD_RELOC_PPC_GOT_TLSLD16,
     2536  BFD_RELOC_PPC_GOT_TLSLD16_LO,
     2537  BFD_RELOC_PPC_GOT_TLSLD16_HI,
     2538  BFD_RELOC_PPC_GOT_TLSLD16_HA,
     2539  BFD_RELOC_PPC_GOT_TPREL16,
     2540  BFD_RELOC_PPC_GOT_TPREL16_LO,
     2541  BFD_RELOC_PPC_GOT_TPREL16_HI,
     2542  BFD_RELOC_PPC_GOT_TPREL16_HA,
     2543  BFD_RELOC_PPC_GOT_DTPREL16,
     2544  BFD_RELOC_PPC_GOT_DTPREL16_LO,
     2545  BFD_RELOC_PPC_GOT_DTPREL16_HI,
     2546  BFD_RELOC_PPC_GOT_DTPREL16_HA,
     2547  BFD_RELOC_PPC64_TPREL16_DS,
     2548  BFD_RELOC_PPC64_TPREL16_LO_DS,
     2549  BFD_RELOC_PPC64_TPREL16_HIGHER,
     2550  BFD_RELOC_PPC64_TPREL16_HIGHERA,
     2551  BFD_RELOC_PPC64_TPREL16_HIGHEST,
     2552  BFD_RELOC_PPC64_TPREL16_HIGHESTA,
     2553  BFD_RELOC_PPC64_DTPREL16_DS,
     2554  BFD_RELOC_PPC64_DTPREL16_LO_DS,
     2555  BFD_RELOC_PPC64_DTPREL16_HIGHER,
     2556  BFD_RELOC_PPC64_DTPREL16_HIGHERA,
     2557  BFD_RELOC_PPC64_DTPREL16_HIGHEST,
     2558  BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
     2559
     2560/* IBM 370/390 relocations  */
    21612561  BFD_RELOC_I370_D12,
    21622562
    21632563/* The type of reloc used to build a contructor table - at the moment
    21642564probably a 32 bit wide absolute relocation, but the target can choose.
    2165 It generally does map to one of the other relocation types. */
     2565It generally does map to one of the other relocation types.  */
    21662566  BFD_RELOC_CTOR,
    21672567
    21682568/* ARM 26 bit pc-relative branch.  The lowest two bits must be zero and are
    2169 not stored in the instruction. */
     2569not stored in the instruction.  */
    21702570  BFD_RELOC_ARM_PCREL_BRANCH,
    21712571
    21722572/* ARM 26 bit pc-relative branch.  The lowest bit must be zero and is
    21732573not stored in the instruction.  The 2nd lowest bit comes from a 1 bit
    2174 field in the instruction. */
     2574field in the instruction.  */
    21752575  BFD_RELOC_ARM_PCREL_BLX,
    21762576
    21772577/* Thumb 22 bit pc-relative branch.  The lowest bit must be zero and is
    21782578not stored in the instruction.  The 2nd lowest bit comes from a 1 bit
    2179 field in the instruction. */
     2579field in the instruction.  */
    21802580  BFD_RELOC_THUMB_PCREL_BLX,
    21812581
    21822582/* These relocs are only used within the ARM assembler.  They are not
    2183 (at present) written to any object files. */
     2583(at present) written to any object files.  */
    21842584  BFD_RELOC_ARM_IMMEDIATE,
    21852585  BFD_RELOC_ARM_ADRL_IMMEDIATE,
     
    21892589  BFD_RELOC_ARM_MULTI,
    21902590  BFD_RELOC_ARM_CP_OFF_IMM,
     2591  BFD_RELOC_ARM_CP_OFF_IMM_S2,
    21912592  BFD_RELOC_ARM_ADR_IMM,
    21922593  BFD_RELOC_ARM_LDR_IMM,
     
    22092610  BFD_RELOC_ARM_GOTPC,
    22102611
    2211 /* Hitachi SH relocs.  Not all of these appear in object files. */
     2612/* Renesas / SuperH SH relocs.  Not all of these appear in object files. */
    22122613  BFD_RELOC_SH_PCDISP8BY2,
    22132614  BFD_RELOC_SH_PCDISP12BY2,
     
    22352636  BFD_RELOC_SH_RELATIVE,
    22362637  BFD_RELOC_SH_GOTPC,
     2638  BFD_RELOC_SH_GOT_LOW16,
     2639  BFD_RELOC_SH_GOT_MEDLOW16,
     2640  BFD_RELOC_SH_GOT_MEDHI16,
     2641  BFD_RELOC_SH_GOT_HI16,
     2642  BFD_RELOC_SH_GOTPLT_LOW16,
     2643  BFD_RELOC_SH_GOTPLT_MEDLOW16,
     2644  BFD_RELOC_SH_GOTPLT_MEDHI16,
     2645  BFD_RELOC_SH_GOTPLT_HI16,
     2646  BFD_RELOC_SH_PLT_LOW16,
     2647  BFD_RELOC_SH_PLT_MEDLOW16,
     2648  BFD_RELOC_SH_PLT_MEDHI16,
     2649  BFD_RELOC_SH_PLT_HI16,
     2650  BFD_RELOC_SH_GOTOFF_LOW16,
     2651  BFD_RELOC_SH_GOTOFF_MEDLOW16,
     2652  BFD_RELOC_SH_GOTOFF_MEDHI16,
     2653  BFD_RELOC_SH_GOTOFF_HI16,
     2654  BFD_RELOC_SH_GOTPC_LOW16,
     2655  BFD_RELOC_SH_GOTPC_MEDLOW16,
     2656  BFD_RELOC_SH_GOTPC_MEDHI16,
     2657  BFD_RELOC_SH_GOTPC_HI16,
     2658  BFD_RELOC_SH_COPY64,
     2659  BFD_RELOC_SH_GLOB_DAT64,
     2660  BFD_RELOC_SH_JMP_SLOT64,
     2661  BFD_RELOC_SH_RELATIVE64,
     2662  BFD_RELOC_SH_GOT10BY4,
     2663  BFD_RELOC_SH_GOT10BY8,
     2664  BFD_RELOC_SH_GOTPLT10BY4,
     2665  BFD_RELOC_SH_GOTPLT10BY8,
     2666  BFD_RELOC_SH_GOTPLT32,
     2667  BFD_RELOC_SH_SHMEDIA_CODE,
     2668  BFD_RELOC_SH_IMMU5,
     2669  BFD_RELOC_SH_IMMS6,
     2670  BFD_RELOC_SH_IMMS6BY32,
     2671  BFD_RELOC_SH_IMMU6,
     2672  BFD_RELOC_SH_IMMS10,
     2673  BFD_RELOC_SH_IMMS10BY2,
     2674  BFD_RELOC_SH_IMMS10BY4,
     2675  BFD_RELOC_SH_IMMS10BY8,
     2676  BFD_RELOC_SH_IMMS16,
     2677  BFD_RELOC_SH_IMMU16,
     2678  BFD_RELOC_SH_IMM_LOW16,
     2679  BFD_RELOC_SH_IMM_LOW16_PCREL,
     2680  BFD_RELOC_SH_IMM_MEDLOW16,
     2681  BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
     2682  BFD_RELOC_SH_IMM_MEDHI16,
     2683  BFD_RELOC_SH_IMM_MEDHI16_PCREL,
     2684  BFD_RELOC_SH_IMM_HI16,
     2685  BFD_RELOC_SH_IMM_HI16_PCREL,
     2686  BFD_RELOC_SH_PT_16,
     2687  BFD_RELOC_SH_TLS_GD_32,
     2688  BFD_RELOC_SH_TLS_LD_32,
     2689  BFD_RELOC_SH_TLS_LDO_32,
     2690  BFD_RELOC_SH_TLS_IE_32,
     2691  BFD_RELOC_SH_TLS_LE_32,
     2692  BFD_RELOC_SH_TLS_DTPMOD32,
     2693  BFD_RELOC_SH_TLS_DTPOFF32,
     2694  BFD_RELOC_SH_TLS_TPOFF32,
    22372695
    22382696/* Thumb 23-, 12- and 9-bit pc-relative branches.  The lowest bit must
    2239 be zero and is not stored in the instruction. */
     2697be zero and is not stored in the instruction.  */
    22402698  BFD_RELOC_THUMB_PCREL_BRANCH9,
    22412699  BFD_RELOC_THUMB_PCREL_BRANCH12,
     
    22452703ARC 22 bit pc-relative branch.  The lowest two bits must be zero and are
    22462704not stored in the instruction.  The high 20 bits are installed in bits 26
    2247 through 7 of the instruction. */
     2705through 7 of the instruction.  */
    22482706  BFD_RELOC_ARC_B22_PCREL,
    22492707
    22502708/* ARC 26 bit absolute branch.  The lowest two bits must be zero and are not
    22512709stored in the instruction.  The high 24 bits are installed in bits 23
    2252 through 0. */
     2710through 0.  */
    22532711  BFD_RELOC_ARC_B26,
    22542712
    22552713/* Mitsubishi D10V relocs.
    22562714This is a 10-bit reloc with the right 2 bits
    2257 assumed to be 0. */
     2715assumed to be 0.  */
    22582716  BFD_RELOC_D10V_10_PCREL_R,
    22592717
     
    22622720assumed to be 0.  This is the same as the previous reloc
    22632721except it is in the left container, i.e.,
    2264 shifted left 15 bits. */
     2722shifted left 15 bits.  */
    22652723  BFD_RELOC_D10V_10_PCREL_L,
    22662724
    22672725/* This is an 18-bit reloc with the right 2 bits
    2268 assumed to be 0. */
     2726assumed to be 0.  */
    22692727  BFD_RELOC_D10V_18,
    22702728
    22712729/* This is an 18-bit reloc with the right 2 bits
    2272 assumed to be 0. */
     2730assumed to be 0.  */
    22732731  BFD_RELOC_D10V_18_PCREL,
    22742732
    22752733/* Mitsubishi D30V relocs.
    2276 This is a 6-bit absolute reloc. */
     2734This is a 6-bit absolute reloc.  */
    22772735  BFD_RELOC_D30V_6,
    22782736
    22792737/* This is a 6-bit pc-relative reloc with
    2280 the right 3 bits assumed to be 0. */
     2738the right 3 bits assumed to be 0.  */
    22812739  BFD_RELOC_D30V_9_PCREL,
    22822740
     
    22842742the right 3 bits assumed to be 0. Same
    22852743as the previous reloc but on the right side
    2286 of the container. */
     2744of the container.  */
    22872745  BFD_RELOC_D30V_9_PCREL_R,
    22882746
    22892747/* This is a 12-bit absolute reloc with the
    2290 right 3 bitsassumed to be 0. */
     2748right 3 bitsassumed to be 0.  */
    22912749  BFD_RELOC_D30V_15,
    22922750
    22932751/* This is a 12-bit pc-relative reloc with
    2294 the right 3 bits assumed to be 0. */
     2752the right 3 bits assumed to be 0.  */
    22952753  BFD_RELOC_D30V_15_PCREL,
    22962754
     
    22982756the right 3 bits assumed to be 0. Same
    22992757as the previous reloc but on the right side
    2300 of the container. */
     2758of the container.  */
    23012759  BFD_RELOC_D30V_15_PCREL_R,
    23022760
    23032761/* This is an 18-bit absolute reloc with
    2304 the right 3 bits assumed to be 0. */
     2762the right 3 bits assumed to be 0.  */
    23052763  BFD_RELOC_D30V_21,
    23062764
    23072765/* This is an 18-bit pc-relative reloc with
    2308 the right 3 bits assumed to be 0. */
     2766the right 3 bits assumed to be 0.  */
    23092767  BFD_RELOC_D30V_21_PCREL,
    23102768
     
    23122770the right 3 bits assumed to be 0. Same
    23132771as the previous reloc but on the right side
    2314 of the container. */
     2772of the container.  */
    23152773  BFD_RELOC_D30V_21_PCREL_R,
    23162774
    2317 /* This is a 32-bit absolute reloc. */
     2775/* This is a 32-bit absolute reloc.  */
    23182776  BFD_RELOC_D30V_32,
    23192777
    2320 /* This is a 32-bit pc-relative reloc. */
     2778/* This is a 32-bit pc-relative reloc.  */
    23212779  BFD_RELOC_D30V_32_PCREL,
    23222780
    2323 /* Mitsubishi M32R relocs.
    2324 This is a 24 bit absolute address. */
     2781/* DLX relocs  */
     2782  BFD_RELOC_DLX_HI16_S,
     2783
     2784/* DLX relocs  */
     2785  BFD_RELOC_DLX_LO16,
     2786
     2787/* DLX relocs  */
     2788  BFD_RELOC_DLX_JMP26,
     2789
     2790/* Renesas M32R (formerly Mitsubishi M32R) relocs.
     2791This is a 24 bit absolute address.  */
    23252792  BFD_RELOC_M32R_24,
    23262793
    2327 /* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */
     2794/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0.  */
    23282795  BFD_RELOC_M32R_10_PCREL,
    23292796
    2330 /* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
     2797/* This is an 18-bit reloc with the right 2 bits assumed to be 0.  */
    23312798  BFD_RELOC_M32R_18_PCREL,
    23322799
    2333 /* This is a 26-bit reloc with the right 2 bits assumed to be 0. */
     2800/* This is a 26-bit reloc with the right 2 bits assumed to be 0.  */
    23342801  BFD_RELOC_M32R_26_PCREL,
    23352802
    23362803/* This is a 16-bit reloc containing the high 16 bits of an address
    2337 used when the lower 16 bits are treated as unsigned. */
     2804used when the lower 16 bits are treated as unsigned.  */
    23382805  BFD_RELOC_M32R_HI16_ULO,
    23392806
    23402807/* This is a 16-bit reloc containing the high 16 bits of an address
    2341 used when the lower 16 bits are treated as signed. */
     2808used when the lower 16 bits are treated as signed.  */
    23422809  BFD_RELOC_M32R_HI16_SLO,
    23432810
    2344 /* This is a 16-bit reloc containing the lower 16 bits of an address. */
     2811/* This is a 16-bit reloc containing the lower 16 bits of an address.  */
    23452812  BFD_RELOC_M32R_LO16,
    23462813
    23472814/* This is a 16-bit reloc containing the small data area offset for use in
    2348 add3, load, and store instructions. */
     2815add3, load, and store instructions.  */
    23492816  BFD_RELOC_M32R_SDA16,
    23502817
    2351 /* This is a 9-bit reloc */
     2818/* This is a 9-bit reloc  */
    23522819  BFD_RELOC_V850_9_PCREL,
    23532820
    2354 /* This is a 22-bit reloc */
     2821/* This is a 22-bit reloc  */
    23552822  BFD_RELOC_V850_22_PCREL,
    23562823
    2357 /* This is a 16 bit offset from the short data area pointer. */
     2824/* This is a 16 bit offset from the short data area pointer.  */
    23582825  BFD_RELOC_V850_SDA_16_16_OFFSET,
    23592826
    23602827/* This is a 16 bit offset (of which only 15 bits are used) from the
    2361 short data area pointer. */
     2828short data area pointer.  */
    23622829  BFD_RELOC_V850_SDA_15_16_OFFSET,
    23632830
    2364 /* This is a 16 bit offset from the zero data area pointer. */
     2831/* This is a 16 bit offset from the zero data area pointer.  */
    23652832  BFD_RELOC_V850_ZDA_16_16_OFFSET,
    23662833
    23672834/* This is a 16 bit offset (of which only 15 bits are used) from the
    2368 zero data area pointer. */
     2835zero data area pointer.  */
    23692836  BFD_RELOC_V850_ZDA_15_16_OFFSET,
    23702837
    23712838/* This is an 8 bit offset (of which only 6 bits are used) from the
    2372 tiny data area pointer. */
     2839tiny data area pointer.  */
    23732840  BFD_RELOC_V850_TDA_6_8_OFFSET,
    23742841
    23752842/* This is an 8bit offset (of which only 7 bits are used) from the tiny
    2376 data area pointer. */
     2843data area pointer.  */
    23772844  BFD_RELOC_V850_TDA_7_8_OFFSET,
    23782845
    2379 /* This is a 7 bit offset from the tiny data area pointer. */
     2846/* This is a 7 bit offset from the tiny data area pointer.  */
    23802847  BFD_RELOC_V850_TDA_7_7_OFFSET,
    23812848
    2382 /* This is a 16 bit offset from the tiny data area pointer. */
     2849/* This is a 16 bit offset from the tiny data area pointer.  */
    23832850  BFD_RELOC_V850_TDA_16_16_OFFSET,
    23842851
    23852852/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
    2386 data area pointer. */
     2853data area pointer.  */
    23872854  BFD_RELOC_V850_TDA_4_5_OFFSET,
    23882855
    2389 /* This is a 4 bit offset from the tiny data area pointer. */
     2856/* This is a 4 bit offset from the tiny data area pointer.  */
    23902857  BFD_RELOC_V850_TDA_4_4_OFFSET,
    23912858
    23922859/* This is a 16 bit offset from the short data area pointer, with the
    2393 bits placed non-contigously in the instruction. */
     2860bits placed non-contigously in the instruction.  */
    23942861  BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
    23952862
    23962863/* This is a 16 bit offset from the zero data area pointer, with the
    2397 bits placed non-contigously in the instruction. */
     2864bits placed non-contigously in the instruction.  */
    23982865  BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
    23992866
    2400 /* This is a 6 bit offset from the call table base pointer. */
     2867/* This is a 6 bit offset from the call table base pointer.  */
    24012868  BFD_RELOC_V850_CALLT_6_7_OFFSET,
    24022869
    2403 /* This is a 16 bit offset from the call table base pointer. */
     2870/* This is a 16 bit offset from the call table base pointer.  */
    24042871  BFD_RELOC_V850_CALLT_16_16_OFFSET,
    24052872
     2873/* Used for relaxing indirect function calls.  */
     2874  BFD_RELOC_V850_LONGCALL,
     2875
     2876/* Used for relaxing indirect jumps.  */
     2877  BFD_RELOC_V850_LONGJUMP,
     2878
     2879/* Used to maintain alignment whilst relaxing.  */
     2880  BFD_RELOC_V850_ALIGN,
    24062881
    24072882/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
    2408 instruction. */
     2883instruction.  */
    24092884  BFD_RELOC_MN10300_32_PCREL,
    24102885
    24112886/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
    2412 instruction. */
     2887instruction.  */
    24132888  BFD_RELOC_MN10300_16_PCREL,
    24142889
    24152890/* This is a 8bit DP reloc for the tms320c30, where the most
    24162891significant 8 bits of a 24 bit word are placed into the least
    2417 significant 8 bits of the opcode. */
     2892significant 8 bits of the opcode.  */
    24182893  BFD_RELOC_TIC30_LDP,
    24192894
    24202895/* This is a 7bit reloc for the tms320c54x, where the least
    24212896significant 7 bits of a 16 bit word are placed into the least
    2422 significant 7 bits of the opcode. */
     2897significant 7 bits of the opcode.  */
    24232898  BFD_RELOC_TIC54X_PARTLS7,
    24242899
    24252900/* This is a 9bit DP reloc for the tms320c54x, where the most
    24262901significant 9 bits of a 16 bit word are placed into the least
    2427 significant 9 bits of the opcode. */
     2902significant 9 bits of the opcode.  */
    24282903  BFD_RELOC_TIC54X_PARTMS9,
    24292904
    2430 /* This is an extended address 23-bit reloc for the tms320c54x. */
     2905/* This is an extended address 23-bit reloc for the tms320c54x.  */
    24312906  BFD_RELOC_TIC54X_23,
    24322907
    24332908/* This is a 16-bit reloc for the tms320c54x, where the least
    24342909significant 16 bits of a 23-bit extended address are placed into
    2435 the opcode. */
     2910the opcode.  */
    24362911  BFD_RELOC_TIC54X_16_OF_23,
    24372912
    24382913/* This is a reloc for the tms320c54x, where the most
    24392914significant 7 bits of a 23-bit extended address are placed into
    2440 the opcode. */
     2915the opcode.  */
    24412916  BFD_RELOC_TIC54X_MS7_OF_23,
    24422917
    2443 /* This is a 48 bit reloc for the FR30 that stores 32 bits. */
     2918/* This is a 48 bit reloc for the FR30 that stores 32 bits.  */
    24442919  BFD_RELOC_FR30_48,
    24452920
    24462921/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
    2447 two sections. */
     2922two sections.  */
    24482923  BFD_RELOC_FR30_20,
    24492924
    24502925/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
    2451 4 bits. */
     29264 bits.  */
    24522927  BFD_RELOC_FR30_6_IN_4,
    24532928
    24542929/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
    2455 into 8 bits. */
     2930into 8 bits.  */
    24562931  BFD_RELOC_FR30_8_IN_8,
    24572932
    24582933/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
    2459 into 8 bits. */
     2934into 8 bits.  */
    24602935  BFD_RELOC_FR30_9_IN_8,
    24612936
    24622937/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
    2463 into 8 bits. */
     2938into 8 bits.  */
    24642939  BFD_RELOC_FR30_10_IN_8,
    24652940
    24662941/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
    2467 short offset into 8 bits. */
     2942short offset into 8 bits.  */
    24682943  BFD_RELOC_FR30_9_PCREL,
    24692944
    24702945/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
    2471 short offset into 11 bits. */
     2946short offset into 11 bits.  */
    24722947  BFD_RELOC_FR30_12_PCREL,
    24732948
    2474 /* Motorola Mcore relocations. */
     2949/* Motorola Mcore relocations.  */
    24752950  BFD_RELOC_MCORE_PCREL_IMM8BY4,
    24762951  BFD_RELOC_MCORE_PCREL_IMM11BY2,
     
    24802955  BFD_RELOC_MCORE_RVA,
    24812956
     2957/* These are relocations for the GETA instruction.  */
     2958  BFD_RELOC_MMIX_GETA,
     2959  BFD_RELOC_MMIX_GETA_1,
     2960  BFD_RELOC_MMIX_GETA_2,
     2961  BFD_RELOC_MMIX_GETA_3,
     2962
     2963/* These are relocations for a conditional branch instruction.  */
     2964  BFD_RELOC_MMIX_CBRANCH,
     2965  BFD_RELOC_MMIX_CBRANCH_J,
     2966  BFD_RELOC_MMIX_CBRANCH_1,
     2967  BFD_RELOC_MMIX_CBRANCH_2,
     2968  BFD_RELOC_MMIX_CBRANCH_3,
     2969
     2970/* These are relocations for the PUSHJ instruction.  */
     2971  BFD_RELOC_MMIX_PUSHJ,
     2972  BFD_RELOC_MMIX_PUSHJ_1,
     2973  BFD_RELOC_MMIX_PUSHJ_2,
     2974  BFD_RELOC_MMIX_PUSHJ_3,
     2975
     2976/* These are relocations for the JMP instruction.  */
     2977  BFD_RELOC_MMIX_JMP,
     2978  BFD_RELOC_MMIX_JMP_1,
     2979  BFD_RELOC_MMIX_JMP_2,
     2980  BFD_RELOC_MMIX_JMP_3,
     2981
     2982/* This is a relocation for a relative address as in a GETA instruction or
     2983a branch.  */
     2984  BFD_RELOC_MMIX_ADDR19,
     2985
     2986/* This is a relocation for a relative address as in a JMP instruction.  */
     2987  BFD_RELOC_MMIX_ADDR27,
     2988
     2989/* This is a relocation for an instruction field that may be a general
     2990register or a value 0..255.  */
     2991  BFD_RELOC_MMIX_REG_OR_BYTE,
     2992
     2993/* This is a relocation for an instruction field that may be a general
     2994register.  */
     2995  BFD_RELOC_MMIX_REG,
     2996
     2997/* This is a relocation for two instruction fields holding a register and
     2998an offset, the equivalent of the relocation.  */
     2999  BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
     3000
     3001/* This relocation is an assertion that the expression is not allocated as
     3002a global register.  It does not modify contents.  */
     3003  BFD_RELOC_MMIX_LOCAL,
     3004
    24823005/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
    2483 short offset into 7 bits. */
     3006short offset into 7 bits.  */
    24843007  BFD_RELOC_AVR_7_PCREL,
    24853008
    24863009/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
    2487 short offset into 12 bits. */
     3010short offset into 12 bits.  */
    24883011  BFD_RELOC_AVR_13_PCREL,
    24893012
    24903013/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
    2491 program memory address) into 16 bits. */
     3014program memory address) into 16 bits.  */
    24923015  BFD_RELOC_AVR_16_PM,
    24933016
    24943017/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
    2495 data memory address) into 8 bit immediate value of LDI insn. */
     3018data memory address) into 8 bit immediate value of LDI insn.  */
    24963019  BFD_RELOC_AVR_LO8_LDI,
    24973020
    24983021/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
    2499 of data memory address) into 8 bit immediate value of LDI insn. */
     3022of data memory address) into 8 bit immediate value of LDI insn.  */
    25003023  BFD_RELOC_AVR_HI8_LDI,
    25013024
    25023025/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
    2503 of program memory address) into 8 bit immediate value of LDI insn. */
     3026of program memory address) into 8 bit immediate value of LDI insn.  */
    25043027  BFD_RELOC_AVR_HH8_LDI,
    25053028
    25063029/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
    2507 (usually data memory address) into 8 bit immediate value of SUBI insn. */
     3030(usually data memory address) into 8 bit immediate value of SUBI insn.  */
    25083031  BFD_RELOC_AVR_LO8_LDI_NEG,
    25093032
    25103033/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
    25113034(high 8 bit of data memory address) into 8 bit immediate value of
    2512 SUBI insn. */
     3035SUBI insn.  */
    25133036  BFD_RELOC_AVR_HI8_LDI_NEG,
    25143037
    25153038/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
    25163039(most high 8 bit of program memory address) into 8 bit immediate value
    2517 of LDI or SUBI insn. */
     3040of LDI or SUBI insn.  */
    25183041  BFD_RELOC_AVR_HH8_LDI_NEG,
    25193042
    25203043/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
    2521 command address) into 8 bit immediate value of LDI insn. */
     3044command address) into 8 bit immediate value of LDI insn.  */
    25223045  BFD_RELOC_AVR_LO8_LDI_PM,
    25233046
    25243047/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
    2525 of command address) into 8 bit immediate value of LDI insn. */
     3048of command address) into 8 bit immediate value of LDI insn.  */
    25263049  BFD_RELOC_AVR_HI8_LDI_PM,
    25273050
    25283051/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
    2529 of command address) into 8 bit immediate value of LDI insn. */
     3052of command address) into 8 bit immediate value of LDI insn.  */
    25303053  BFD_RELOC_AVR_HH8_LDI_PM,
    25313054
    25323055/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
    2533 (usually command address) into 8 bit immediate value of SUBI insn. */
     3056(usually command address) into 8 bit immediate value of SUBI insn.  */
    25343057  BFD_RELOC_AVR_LO8_LDI_PM_NEG,
    25353058
    25363059/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
    25373060(high 8 bit of 16 bit command address) into 8 bit immediate value
    2538 of SUBI insn. */
     3061of SUBI insn.  */
    25393062  BFD_RELOC_AVR_HI8_LDI_PM_NEG,
    25403063
    25413064/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
    25423065(high 6 bit of 22 bit command address) into 8 bit immediate
    2543 value of SUBI insn. */
     3066value of SUBI insn.  */
    25443067  BFD_RELOC_AVR_HH8_LDI_PM_NEG,
    25453068
    25463069/* This is a 32 bit reloc for the AVR that stores 23 bit value
    2547 into 22 bits. */
     3070into 22 bits.  */
    25483071  BFD_RELOC_AVR_CALL,
     3072
     3073/* Direct 12 bit.  */
     3074  BFD_RELOC_390_12,
     3075
     3076/* 12 bit GOT offset.  */
     3077  BFD_RELOC_390_GOT12,
     3078
     3079/* 32 bit PC relative PLT address.  */
     3080  BFD_RELOC_390_PLT32,
     3081
     3082/* Copy symbol at runtime.  */
     3083  BFD_RELOC_390_COPY,
     3084
     3085/* Create GOT entry.  */
     3086  BFD_RELOC_390_GLOB_DAT,
     3087
     3088/* Create PLT entry.  */
     3089  BFD_RELOC_390_JMP_SLOT,
     3090
     3091/* Adjust by program base.  */
     3092  BFD_RELOC_390_RELATIVE,
     3093
     3094/* 32 bit PC relative offset to GOT.  */
     3095  BFD_RELOC_390_GOTPC,
     3096
     3097/* 16 bit GOT offset.  */
     3098  BFD_RELOC_390_GOT16,
     3099
     3100/* PC relative 16 bit shifted by 1.  */
     3101  BFD_RELOC_390_PC16DBL,
     3102
     3103/* 16 bit PC rel. PLT shifted by 1.  */
     3104  BFD_RELOC_390_PLT16DBL,
     3105
     3106/* PC relative 32 bit shifted by 1.  */
     3107  BFD_RELOC_390_PC32DBL,
     3108
     3109/* 32 bit PC rel. PLT shifted by 1.  */
     3110  BFD_RELOC_390_PLT32DBL,
     3111
     3112/* 32 bit PC rel. GOT shifted by 1.  */
     3113  BFD_RELOC_390_GOTPCDBL,
     3114
     3115/* 64 bit GOT offset.  */
     3116  BFD_RELOC_390_GOT64,
     3117
     3118/* 64 bit PC relative PLT address.  */
     3119  BFD_RELOC_390_PLT64,
     3120
     3121/* 32 bit rel. offset to GOT entry.  */
     3122  BFD_RELOC_390_GOTENT,
     3123
     3124/* 64 bit offset to GOT.  */
     3125  BFD_RELOC_390_GOTOFF64,
     3126
     3127/* 12-bit offset to symbol-entry within GOT, with PLT handling.  */
     3128  BFD_RELOC_390_GOTPLT12,
     3129
     3130/* 16-bit offset to symbol-entry within GOT, with PLT handling.  */
     3131  BFD_RELOC_390_GOTPLT16,
     3132
     3133/* 32-bit offset to symbol-entry within GOT, with PLT handling.  */
     3134  BFD_RELOC_390_GOTPLT32,
     3135
     3136/* 64-bit offset to symbol-entry within GOT, with PLT handling.  */
     3137  BFD_RELOC_390_GOTPLT64,
     3138
     3139/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling.  */
     3140  BFD_RELOC_390_GOTPLTENT,
     3141
     3142/* 16-bit rel. offset from the GOT to a PLT entry.  */
     3143  BFD_RELOC_390_PLTOFF16,
     3144
     3145/* 32-bit rel. offset from the GOT to a PLT entry.  */
     3146  BFD_RELOC_390_PLTOFF32,
     3147
     3148/* 64-bit rel. offset from the GOT to a PLT entry.  */
     3149  BFD_RELOC_390_PLTOFF64,
     3150
     3151/* s390 tls relocations.  */
     3152  BFD_RELOC_390_TLS_LOAD,
     3153  BFD_RELOC_390_TLS_GDCALL,
     3154  BFD_RELOC_390_TLS_LDCALL,
     3155  BFD_RELOC_390_TLS_GD32,
     3156  BFD_RELOC_390_TLS_GD64,
     3157  BFD_RELOC_390_TLS_GOTIE12,
     3158  BFD_RELOC_390_TLS_GOTIE32,
     3159  BFD_RELOC_390_TLS_GOTIE64,
     3160  BFD_RELOC_390_TLS_LDM32,
     3161  BFD_RELOC_390_TLS_LDM64,
     3162  BFD_RELOC_390_TLS_IE32,
     3163  BFD_RELOC_390_TLS_IE64,
     3164  BFD_RELOC_390_TLS_IEENT,
     3165  BFD_RELOC_390_TLS_LE32,
     3166  BFD_RELOC_390_TLS_LE64,
     3167  BFD_RELOC_390_TLS_LDO32,
     3168  BFD_RELOC_390_TLS_LDO64,
     3169  BFD_RELOC_390_TLS_DTPMOD,
     3170  BFD_RELOC_390_TLS_DTPOFF,
     3171  BFD_RELOC_390_TLS_TPOFF,
     3172
     3173/* Scenix IP2K - 9-bit register number / data address  */
     3174  BFD_RELOC_IP2K_FR9,
     3175
     3176/* Scenix IP2K - 4-bit register/data bank number  */
     3177  BFD_RELOC_IP2K_BANK,
     3178
     3179/* Scenix IP2K - low 13 bits of instruction word address  */
     3180  BFD_RELOC_IP2K_ADDR16CJP,
     3181
     3182/* Scenix IP2K - high 3 bits of instruction word address  */
     3183  BFD_RELOC_IP2K_PAGE3,
     3184
     3185/* Scenix IP2K - ext/low/high 8 bits of data address  */
     3186  BFD_RELOC_IP2K_LO8DATA,
     3187  BFD_RELOC_IP2K_HI8DATA,
     3188  BFD_RELOC_IP2K_EX8DATA,
     3189
     3190/* Scenix IP2K - low/high 8 bits of instruction word address  */
     3191  BFD_RELOC_IP2K_LO8INSN,
     3192  BFD_RELOC_IP2K_HI8INSN,
     3193
     3194/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0  */
     3195  BFD_RELOC_IP2K_PC_SKIP,
     3196
     3197/* Scenix IP2K - 16 bit word address in text section.  */
     3198  BFD_RELOC_IP2K_TEXT,
     3199
     3200/* Scenix IP2K - 7-bit sp or dp offset  */
     3201  BFD_RELOC_IP2K_FR_OFFSET,
     3202
     3203/* Scenix VPE4K coprocessor - data/insn-space addressing  */
     3204  BFD_RELOC_VPE4KMATH_DATA,
     3205  BFD_RELOC_VPE4KMATH_INSN,
    25493206
    25503207/* These two relocations are used by the linker to determine which of
     
    25643221describes the entry that is being used.  For Rela hosts, this offset
    25653222is stored in the reloc's addend.  For Rel hosts, we are forced to put
    2566 this offset in the reloc's section offset. */
     3223this offset in the reloc's section offset.  */
    25673224  BFD_RELOC_VTABLE_INHERIT,
    25683225  BFD_RELOC_VTABLE_ENTRY,
    25693226
    2570 /* Intel IA64 Relocations. */
     3227/* Intel IA64 Relocations.  */
    25713228  BFD_RELOC_IA64_IMM14,
    25723229  BFD_RELOC_IA64_IMM22,
     
    26063263  BFD_RELOC_IA64_LTOFF_FPTR22,
    26073264  BFD_RELOC_IA64_LTOFF_FPTR64I,
     3265  BFD_RELOC_IA64_LTOFF_FPTR32MSB,
     3266  BFD_RELOC_IA64_LTOFF_FPTR32LSB,
    26083267  BFD_RELOC_IA64_LTOFF_FPTR64MSB,
    26093268  BFD_RELOC_IA64_LTOFF_FPTR64LSB,
     
    26273286  BFD_RELOC_IA64_IPLTLSB,
    26283287  BFD_RELOC_IA64_COPY,
     3288  BFD_RELOC_IA64_LTOFF22X,
     3289  BFD_RELOC_IA64_LDXMOV,
     3290  BFD_RELOC_IA64_TPREL14,
    26293291  BFD_RELOC_IA64_TPREL22,
     3292  BFD_RELOC_IA64_TPREL64I,
    26303293  BFD_RELOC_IA64_TPREL64MSB,
    26313294  BFD_RELOC_IA64_TPREL64LSB,
    2632   BFD_RELOC_IA64_LTOFF_TP22,
    2633   BFD_RELOC_IA64_LTOFF22X,
    2634   BFD_RELOC_IA64_LDXMOV,
     3295  BFD_RELOC_IA64_LTOFF_TPREL22,
     3296  BFD_RELOC_IA64_DTPMOD64MSB,
     3297  BFD_RELOC_IA64_DTPMOD64LSB,
     3298  BFD_RELOC_IA64_LTOFF_DTPMOD22,
     3299  BFD_RELOC_IA64_DTPREL14,
     3300  BFD_RELOC_IA64_DTPREL22,
     3301  BFD_RELOC_IA64_DTPREL64I,
     3302  BFD_RELOC_IA64_DTPREL32MSB,
     3303  BFD_RELOC_IA64_DTPREL32LSB,
     3304  BFD_RELOC_IA64_DTPREL64MSB,
     3305  BFD_RELOC_IA64_DTPREL64LSB,
     3306  BFD_RELOC_IA64_LTOFF_DTPREL22,
    26353307
    26363308/* Motorola 68HC11 reloc.
    2637 This is the 8 bits high part of an absolute address. */
     3309This is the 8 bit high part of an absolute address. */
    26383310  BFD_RELOC_M68HC11_HI8,
    26393311
    26403312/* Motorola 68HC11 reloc.
    2641 This is the 8 bits low part of an absolute address. */
     3313This is the 8 bit low part of an absolute address. */
    26423314  BFD_RELOC_M68HC11_LO8,
    26433315
    26443316/* Motorola 68HC11 reloc.
    2645 This is the 3 bits of a value. */
     3317This is the 3 bit of a value. */
    26463318  BFD_RELOC_M68HC11_3B,
    26473319
     3320/* Motorola 68HC11 reloc.
     3321This reloc marks the beginning of a jump/call instruction.
     3322It is used for linker relaxation to correctly identify beginning
     3323of instruction and change some branchs to use PC-relative
     3324addressing mode.  */
     3325  BFD_RELOC_M68HC11_RL_JUMP,
     3326
     3327/* Motorola 68HC11 reloc.
     3328This reloc marks a group of several instructions that gcc generates
     3329and for which the linker relaxation pass can modify and/or remove
     3330some of them.  */
     3331  BFD_RELOC_M68HC11_RL_GROUP,
     3332
     3333/* Motorola 68HC11 reloc.
     3334This is the 16-bit lower part of an address.  It is used for 'call'
     3335instruction to specify the symbol address without any special
     3336transformation (due to memory bank window).  */
     3337  BFD_RELOC_M68HC11_LO16,
     3338
     3339/* Motorola 68HC11 reloc.
     3340This is a 8-bit reloc that specifies the page number of an address.
     3341It is used by 'call' instruction to specify the page number of
     3342the symbol.  */
     3343  BFD_RELOC_M68HC11_PAGE,
     3344
     3345/* Motorola 68HC11 reloc.
     3346This is a 24-bit reloc that represents the address with a 16-bit
     3347value and a 8-bit page number.  The symbol address is transformed
     3348to follow the 16K memory bank of 68HC12 (seen as mapped in the window).  */
     3349  BFD_RELOC_M68HC11_24,
     3350
    26483351/* These relocs are only used within the CRIS assembler.  They are not
    2649 (at present) written to any object files. */
     3352(at present) written to any object files.  */
    26503353  BFD_RELOC_CRIS_BDISP8,
    26513354  BFD_RELOC_CRIS_UNSIGNED_5,
     
    26543357  BFD_RELOC_CRIS_UNSIGNED_4,
    26553358
    2656 /* Intel i860 Relocations. */
     3359/* Relocs used in ELF shared libraries for CRIS.  */
     3360  BFD_RELOC_CRIS_COPY,
     3361  BFD_RELOC_CRIS_GLOB_DAT,
     3362  BFD_RELOC_CRIS_JUMP_SLOT,
     3363  BFD_RELOC_CRIS_RELATIVE,
     3364
     3365/* 32-bit offset to symbol-entry within GOT.  */
     3366  BFD_RELOC_CRIS_32_GOT,
     3367
     3368/* 16-bit offset to symbol-entry within GOT.  */
     3369  BFD_RELOC_CRIS_16_GOT,
     3370
     3371/* 32-bit offset to symbol-entry within GOT, with PLT handling.  */
     3372  BFD_RELOC_CRIS_32_GOTPLT,
     3373
     3374/* 16-bit offset to symbol-entry within GOT, with PLT handling.  */
     3375  BFD_RELOC_CRIS_16_GOTPLT,
     3376
     3377/* 32-bit offset to symbol, relative to GOT.  */
     3378  BFD_RELOC_CRIS_32_GOTREL,
     3379
     3380/* 32-bit offset to symbol with PLT entry, relative to GOT.  */
     3381  BFD_RELOC_CRIS_32_PLT_GOTREL,
     3382
     3383/* 32-bit offset to symbol with PLT entry, relative to this relocation.  */
     3384  BFD_RELOC_CRIS_32_PLT_PCREL,
     3385
     3386/* Intel i860 Relocations.  */
    26573387  BFD_RELOC_860_COPY,
    26583388  BFD_RELOC_860_GLOB_DAT,
     
    26873417  BFD_RELOC_860_HIGOT,
    26883418  BFD_RELOC_860_HIGOTOFF,
     3419
     3420/* OpenRISC Relocations.  */
     3421  BFD_RELOC_OPENRISC_ABS_26,
     3422  BFD_RELOC_OPENRISC_REL_26,
     3423
     3424/* H8 elf Relocations.  */
     3425  BFD_RELOC_H8_DIR16A8,
     3426  BFD_RELOC_H8_DIR16R8,
     3427  BFD_RELOC_H8_DIR24A8,
     3428  BFD_RELOC_H8_DIR24R8,
     3429  BFD_RELOC_H8_DIR32A16,
     3430
     3431/* Sony Xstormy16 Relocations.  */
     3432  BFD_RELOC_XSTORMY16_REL_12,
     3433  BFD_RELOC_XSTORMY16_12,
     3434  BFD_RELOC_XSTORMY16_24,
     3435  BFD_RELOC_XSTORMY16_FPTR16,
     3436
     3437/* Relocations used by VAX ELF.  */
     3438  BFD_RELOC_VAX_GLOB_DAT,
     3439  BFD_RELOC_VAX_JMP_SLOT,
     3440  BFD_RELOC_VAX_RELATIVE,
     3441
     3442/* msp430 specific relocation codes  */
     3443  BFD_RELOC_MSP430_10_PCREL,
     3444  BFD_RELOC_MSP430_16_PCREL,
     3445  BFD_RELOC_MSP430_16,
     3446  BFD_RELOC_MSP430_16_PCREL_BYTE,
     3447  BFD_RELOC_MSP430_16_BYTE,
     3448
     3449/* IQ2000 Relocations.  */
     3450  BFD_RELOC_IQ2000_OFFSET_16,
     3451  BFD_RELOC_IQ2000_OFFSET_21,
     3452  BFD_RELOC_IQ2000_UHI16,
     3453
     3454/* Special Xtensa relocation used only by PLT entries in ELF shared
     3455objects to indicate that the runtime linker should set the value
     3456to one of its own internal functions or data structures.  */
     3457  BFD_RELOC_XTENSA_RTLD,
     3458
     3459/* Xtensa relocations for ELF shared objects.  */
     3460  BFD_RELOC_XTENSA_GLOB_DAT,
     3461  BFD_RELOC_XTENSA_JMP_SLOT,
     3462  BFD_RELOC_XTENSA_RELATIVE,
     3463
     3464/* Xtensa relocation used in ELF object files for symbols that may require
     3465PLT entries.  Otherwise, this is just a generic 32-bit relocation.  */
     3466  BFD_RELOC_XTENSA_PLT,
     3467
     3468/* Generic Xtensa relocations.  Only the operand number is encoded
     3469in the relocation.  The details are determined by extracting the
     3470instruction opcode.  */
     3471  BFD_RELOC_XTENSA_OP0,
     3472  BFD_RELOC_XTENSA_OP1,
     3473  BFD_RELOC_XTENSA_OP2,
     3474
     3475/* Xtensa relocation to mark that the assembler expanded the
     3476instructions from an original target.  The expansion size is
     3477encoded in the reloc size.  */
     3478  BFD_RELOC_XTENSA_ASM_EXPAND,
     3479
     3480/* Xtensa relocation to mark that the linker should simplify
     3481assembler-expanded instructions.  This is commonly used
     3482internally by the linker after analysis of a
     3483BFD_RELOC_XTENSA_ASM_EXPAND.  */
     3484  BFD_RELOC_XTENSA_ASM_SIMPLIFY,
    26893485  BFD_RELOC_UNUSED };
    26903486typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
     
    26953491bfd_get_reloc_code_name PARAMS ((bfd_reloc_code_real_type code));
    26963492
     3493/* Extracted from syms.c.  */
    26973494
    26983495typedef struct symbol_cache_entry
    26993496{
    2700        /* A pointer to the BFD which owns the symbol. This information
    2701           is necessary so that a back end can work out what additional
    2702           information (invisible to the application writer) is carried
    2703           with the symbol.
    2704 
    2705           This field is *almost* redundant, since you can use section->owner
    2706           instead, except that some symbols point to the global sections
    2707           bfd_{abs,com,und}_section.  This could be fixed by making
    2708           these globals be per-bfd (or per-target-flavor).  FIXME. */
    2709 
    2710   struct _bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
    2711 
    2712        /* The text of the symbol. The name is left alone, and not copied; the
    2713           application may not alter it. */
    2714   CONST char *name;
    2715 
    2716        /* The value of the symbol.  This really should be a union of a
    2717           numeric value with a pointer, since some flags indicate that
    2718           a pointer to another symbol is stored here.  */
     3497  /* A pointer to the BFD which owns the symbol. This information
     3498     is necessary so that a back end can work out what additional
     3499     information (invisible to the application writer) is carried
     3500     with the symbol.
     3501
     3502     This field is *almost* redundant, since you can use section->owner
     3503     instead, except that some symbols point to the global sections
     3504     bfd_{abs,com,und}_section.  This could be fixed by making
     3505     these globals be per-bfd (or per-target-flavor).  FIXME.  */
     3506  struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field.  */
     3507
     3508  /* The text of the symbol. The name is left alone, and not copied; the
     3509     application may not alter it.  */
     3510  const char *name;
     3511
     3512  /* The value of the symbol.  This really should be a union of a
     3513     numeric value with a pointer, since some flags indicate that
     3514     a pointer to another symbol is stored here.  */
    27193515  symvalue value;
    27203516
    2721        /* Attributes of a symbol: */
    2722 
     3517  /* Attributes of a symbol.  */
    27233518#define BSF_NO_FLAGS    0x00
    27243519
    2725        /* The symbol has local scope; <<static>> in <<C>>. The value
    2726           is the offset into the section of the data. */
     3520  /* The symbol has local scope; <<static>> in <<C>>. The value
     3521     is the offset into the section of the data. */
    27273522#define BSF_LOCAL      0x01
    27283523
    2729        /* The symbol has global scope; initialized data in <<C>>. The
    2730           value is the offset into the section of the data. */
     3524  /* The symbol has global scope; initialized data in <<C>>. The
     3525     value is the offset into the section of the data. */
    27313526#define BSF_GLOBAL     0x02
    27323527
    2733        /* The symbol has global scope and is exported. The value is
    2734           the offset into the section of the data. */
    2735 #define BSF_EXPORT     BSF_GLOBAL /* no real difference */
    2736 
    2737        /* A normal C symbol would be one of:
    2738           <<BSF_LOCAL>>, <<BSF_FORT_COMM>>,  <<BSF_UNDEFINED>> or
    2739           <<BSF_GLOBAL>> */
    2740 
    2741        /* The symbol is a debugging record. The value has an arbitary
    2742           meaning, unless BSF_DEBUGGING_RELOC is also set.  */
     3528  /* The symbol has global scope and is exported. The value is
     3529     the offset into the section of the data. */
     3530#define BSF_EXPORT     BSF_GLOBAL /* No real difference. */
     3531
     3532  /* A normal C symbol would be one of:
     3533     <<BSF_LOCAL>>, <<BSF_FORT_COMM>>,  <<BSF_UNDEFINED>> or
     3534     <<BSF_GLOBAL>>. */
     3535
     3536  /* The symbol is a debugging record. The value has an arbitary
     3537     meaning, unless BSF_DEBUGGING_RELOC is also set.  */
    27433538#define BSF_DEBUGGING  0x08
    27443539
    2745        /* The symbol denotes a function entry point.  Used in ELF,
    2746           perhaps others someday.  */
     3540  /* The symbol denotes a function entry point.  Used in ELF,
     3541     perhaps others someday.  */
    27473542#define BSF_FUNCTION    0x10
    27483543
    2749        /* Used by the linker. */
     3544  /* Used by the linker. */
    27503545#define BSF_KEEP        0x20
    27513546#define BSF_KEEP_G      0x40
    27523547
    2753        /* A weak global symbol, overridable without warnings by
    2754           a regular global symbol of the same name.  */
     3548  /* A weak global symbol, overridable without warnings by
     3549     a regular global symbol of the same name.  */
    27553550#define BSF_WEAK        0x80
    27563551
    2757        /* This symbol was created to point to a section, e.g. ELF's
    2758           STT_SECTION symbols.  */
     3552  /* This symbol was created to point to a section, e.g. ELF's
     3553     STT_SECTION symbols.  */
    27593554#define BSF_SECTION_SYM 0x100
    27603555
    2761        /* The symbol used to be a common symbol, but now it is
    2762           allocated. */
     3556  /* The symbol used to be a common symbol, but now it is
     3557     allocated. */
    27633558#define BSF_OLD_COMMON  0x200
    27643559
    2765        /* The default value for common data. */
     3560  /* The default value for common data. */
    27663561#define BFD_FORT_COMM_DEFAULT_VALUE 0
    27673562
    2768        /* In some files the type of a symbol sometimes alters its
    2769           location in an output file - ie in coff a <<ISFCN>> symbol
    2770           which is also <<C_EXT>> symbol appears where it was
    2771           declared and not at the end of a section.  This bit is set
    2772           by the target BFD part to convey this information. */
    2773 
     3563  /* In some files the type of a symbol sometimes alters its
     3564     location in an output file - ie in coff a <<ISFCN>> symbol
     3565     which is also <<C_EXT>> symbol appears where it was
     3566     declared and not at the end of a section.  This bit is set
     3567     by the target BFD part to convey this information.  */
    27743568#define BSF_NOT_AT_END    0x400
    27753569
    2776        /* Signal that the symbol is the label of constructor section. */
     3570  /* Signal that the symbol is the label of constructor section. */
    27773571#define BSF_CONSTRUCTOR   0x800
    27783572
    2779        /* Signal that the symbol is a warning symbol.  The name is a
    2780           warning.  The name of the next symbol is the one to warn about;
    2781           if a reference is made to a symbol with the same name as the next
    2782           symbol, a warning is issued by the linker. */
     3573  /* Signal that the symbol is a warning symbol.  The name is a
     3574     warning.  The name of the next symbol is the one to warn about;
     3575     if a reference is made to a symbol with the same name as the next
     3576     symbol, a warning is issued by the linker. */
    27833577#define BSF_WARNING       0x1000
    27843578
    2785        /* Signal that the symbol is indirect.  This symbol is an indirect
    2786           pointer to the symbol with the same name as the next symbol. */
     3579  /* Signal that the symbol is indirect.  This symbol is an indirect
     3580     pointer to the symbol with the same name as the next symbol. */
    27873581#define BSF_INDIRECT      0x2000
    27883582
    2789        /* BSF_FILE marks symbols that contain a file name.  This is used
    2790           for ELF STT_FILE symbols.  */
     3583  /* BSF_FILE marks symbols that contain a file name.  This is used
     3584     for ELF STT_FILE symbols.  */
    27913585#define BSF_FILE          0x4000
    27923586
    2793        /* Symbol is from dynamic linking information.  */
     3587  /* Symbol is from dynamic linking information.  */
    27943588#define BSF_DYNAMIC       0x8000
    27953589
    2796        /* The symbol denotes a data object.  Used in ELF, and perhaps
    2797           others someday.  */
     3590  /* The symbol denotes a data object.  Used in ELF, and perhaps
     3591     others someday.  */
    27983592#define BSF_OBJECT        0x10000
    27993593
    2800        /* This symbol is a debugging symbol.  The value is the offset
    2801           into the section of the data.  BSF_DEBUGGING should be set
    2802           as well.  */
     3594  /* This symbol is a debugging symbol.  The value is the offset
     3595     into the section of the data.  BSF_DEBUGGING should be set
     3596     as well.  */
    28033597#define BSF_DEBUGGING_RELOC 0x20000
    28043598
    2805          /* Symbol is an emx import reference.  */
     3599  /* This symbol is thread local.  Used in ELF.  */
     3600#define BSF_THREAD_LOCAL  0x40000
     3601
     3602  /* Symbol is an emx import reference.  */
    28063603#define BSF_EMX_IMPORT1   0x20000000
    28073604
    2808         /* Symbol is an emx import definition.  */
     3605  /* Symbol is an emx import definition.  */
    28093606#define BSF_EMX_IMPORT2   0x40000000
    28103607
    28113608  flagword flags;
    28123609
    2813        /* A pointer to the section to which this symbol is
    2814           relative.  This will always be non NULL, there are special
    2815           sections for undefined and absolute symbols.  */
     3610  /* A pointer to the section to which this symbol is
     3611     relative.  This will always be non NULL, there are special
     3612     sections for undefined and absolute symbols.  */
    28163613  struct sec *section;
    28173614
    2818        /* Back end special data.  */
     3615  /* Back end special data.  */
    28193616  union
    28203617    {
    28213618      PTR p;
    28223619      bfd_vma i;
    2823     } udata;
    2824 
    2825 } asymbol;
     3620    }
     3621  udata;
     3622}
     3623asymbol;
     3624
    28263625#define bfd_get_symtab_upper_bound(abfd) \
    28273626     BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
    2828 boolean
     3627
     3628bfd_boolean
    28293629bfd_is_local_label PARAMS ((bfd *abfd, asymbol *sym));
    28303630
    2831 boolean
     3631bfd_boolean
    28323632bfd_is_local_label_name PARAMS ((bfd *abfd, const char *name));
    28333633
    28343634#define bfd_is_local_label_name(abfd, name) \
    28353635     BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
     3636
    28363637#define bfd_canonicalize_symtab(abfd, location) \
    28373638     BFD_SEND (abfd, _bfd_canonicalize_symtab,\
    28383639                  (abfd, location))
    2839 boolean
     3640
     3641bfd_boolean
    28403642bfd_set_symtab PARAMS ((bfd *abfd, asymbol **location, unsigned int count));
    28413643
    28423644void
    2843 bfd_print_symbol_vandf PARAMS ((PTR file, asymbol *symbol));
     3645bfd_print_symbol_vandf PARAMS ((bfd *abfd, PTR file, asymbol *symbol));
    28443646
    28453647#define bfd_make_empty_symbol(abfd) \
    28463648     BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
     3649
     3650asymbol *
     3651_bfd_generic_make_empty_symbol PARAMS ((bfd *));
     3652
    28473653#define bfd_make_debug_symbol(abfd,ptr,size) \
    28483654        BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
     3655
    28493656int
    28503657bfd_decode_symclass PARAMS ((asymbol *symbol));
    28513658
    2852 boolean
     3659bfd_boolean
    28533660bfd_is_undefined_symclass PARAMS ((int symclass));
    28543661
     
    28563663bfd_symbol_info PARAMS ((asymbol *symbol, symbol_info *ret));
    28573664
    2858 boolean
     3665bfd_boolean
    28593666bfd_copy_private_symbol_data PARAMS ((bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym));
    28603667
     
    28623669     BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
    28633670               (ibfd, isymbol, obfd, osymbol))
    2864 struct _bfd
     3671
     3672/* Extracted from bfd.c.  */
     3673struct bfd
    28653674{
    2866     /* The filename the application opened the BFD with.  */
    2867     CONST char *filename;
    2868 
    2869     /* A pointer to the target jump table.             */
    2870     const struct bfd_target *xvec;
    2871 
    2872     /* To avoid dragging too many header files into every file that
    2873        includes `<<bfd.h>>', IOSTREAM has been declared as a "char
    2874        *", and MTIME as a "long".  Their correct types, to which they
    2875        are cast when used, are "FILE *" and "time_t".    The iostream
    2876        is the result of an fopen on the filename.  However, if the
    2877        BFD_IN_MEMORY flag is set, then iostream is actually a pointer
    2878        to a bfd_in_memory struct.  */
    2879     PTR iostream;
    2880 
    2881     /* Is the file descriptor being cached?  That is, can it be closed as
    2882        needed, and re-opened when accessed later?  */
    2883 
    2884     boolean cacheable;
    2885 
    2886     /* Marks whether there was a default target specified when the
    2887        BFD was opened. This is used to select which matching algorithm
    2888        to use to choose the back end. */
    2889 
    2890     boolean target_defaulted;
    2891 
    2892     /* The caching routines use these to maintain a
    2893        least-recently-used list of BFDs */
    2894 
    2895     struct _bfd *lru_prev, *lru_next;
    2896 
    2897     /* When a file is closed by the caching routines, BFD retains
    2898        state information on the file here: */
    2899 
    2900     file_ptr where;
    2901 
    2902     /* and here: (``once'' means at least once) */
    2903 
    2904     boolean opened_once;
    2905 
    2906     /* Set if we have a locally maintained mtime value, rather than
    2907        getting it from the file each time: */
    2908 
    2909     boolean mtime_set;
    2910 
    2911     /* File modified time, if mtime_set is true: */
    2912 
    2913     long mtime;
    2914 
    2915     /* Reserved for an unimplemented file locking extension.*/
    2916 
    2917     int ifd;
    2918 
    2919     /* The format which belongs to the BFD. (object, core, etc.) */
    2920 
    2921     bfd_format format;
    2922 
    2923     /* The direction the BFD was opened with*/
    2924 
    2925     enum bfd_direction {no_direction = 0,
    2926                         read_direction = 1,
    2927                         write_direction = 2,
    2928                         both_direction = 3} direction;
    2929 
    2930     /* Format_specific flags*/
    2931 
    2932     flagword flags;
    2933 
    2934     /* Currently my_archive is tested before adding origin to
    2935        anything. I believe that this can become always an add of
    2936        origin, with origin set to 0 for non archive files.   */
    2937 
    2938     file_ptr origin;
    2939 
    2940     /* Remember when output has begun, to stop strange things
    2941        from happening. */
    2942     boolean output_has_begun;
    2943 
    2944     /* Pointer to linked list of sections*/
    2945     struct sec  *sections;
    2946 
    2947     /* The number of sections */
    2948     unsigned int section_count;
    2949 
    2950     /* Stuff only useful for object files:
    2951        The start address. */
    2952     bfd_vma start_address;
    2953 
    2954     /* Used for input and output*/
    2955     unsigned int symcount;
    2956 
    2957     /* Symbol table for output BFD (with symcount entries) */
    2958     struct symbol_cache_entry  **outsymbols;
    2959 
    2960     /* Pointer to structure which contains architecture information*/
    2961     const struct bfd_arch_info *arch_info;
    2962 
    2963     /* Stuff only useful for archives:*/
    2964     PTR arelt_data;
    2965     struct _bfd *my_archive;     /* The containing archive BFD.  */
    2966     struct _bfd *next;           /* The next BFD in the archive.  */
    2967     struct _bfd *archive_head;   /* The first BFD in the archive.  */
    2968     boolean has_armap;
    2969 
    2970     /* A chain of BFD structures involved in a link.  */
    2971     struct _bfd *link_next;
    2972 
    2973     /* A field used by _bfd_generic_link_add_archive_symbols.  This will
    2974        be used only for archive elements.  */
    2975     int archive_pass;
    2976 
    2977     /* Used by the back end to hold private data. */
    2978 
    2979     union
    2980       {
     3675  /* A unique identifier of the BFD  */
     3676  unsigned int id;
     3677
     3678  /* The filename the application opened the BFD with.  */
     3679  const char *filename;
     3680
     3681  /* A pointer to the target jump table.  */
     3682  const struct bfd_target *xvec;
     3683
     3684  /* To avoid dragging too many header files into every file that
     3685     includes `<<bfd.h>>', IOSTREAM has been declared as a "char *",
     3686     and MTIME as a "long".  Their correct types, to which they
     3687     are cast when used, are "FILE *" and "time_t".    The iostream
     3688     is the result of an fopen on the filename.  However, if the
     3689     BFD_IN_MEMORY flag is set, then iostream is actually a pointer
     3690     to a bfd_in_memory struct.  */
     3691  PTR iostream;
     3692
     3693  /* Is the file descriptor being cached?  That is, can it be closed as
     3694     needed, and re-opened when accessed later?  */
     3695  bfd_boolean cacheable;
     3696
     3697  /* Marks whether there was a default target specified when the
     3698     BFD was opened. This is used to select which matching algorithm
     3699     to use to choose the back end.  */
     3700  bfd_boolean target_defaulted;
     3701
     3702  /* The caching routines use these to maintain a
     3703     least-recently-used list of BFDs.  */
     3704  struct bfd *lru_prev, *lru_next;
     3705
     3706  /* When a file is closed by the caching routines, BFD retains
     3707     state information on the file here...  */
     3708  ufile_ptr where;
     3709
     3710  /* ... and here: (``once'' means at least once).  */
     3711  bfd_boolean opened_once;
     3712
     3713  /* Set if we have a locally maintained mtime value, rather than
     3714     getting it from the file each time.  */
     3715  bfd_boolean mtime_set;
     3716
     3717  /* File modified time, if mtime_set is TRUE.  */
     3718  long mtime;
     3719
     3720  /* Reserved for an unimplemented file locking extension.  */
     3721  int ifd;
     3722
     3723  /* The format which belongs to the BFD. (object, core, etc.)  */
     3724  bfd_format format;
     3725
     3726  /* The direction with which the BFD was opened.  */
     3727  enum bfd_direction
     3728    {
     3729      no_direction = 0,
     3730      read_direction = 1,
     3731      write_direction = 2,
     3732      both_direction = 3
     3733    }
     3734  direction;
     3735
     3736  /* Format_specific flags.  */
     3737  flagword flags;
     3738
     3739  /* Currently my_archive is tested before adding origin to
     3740     anything. I believe that this can become always an add of
     3741     origin, with origin set to 0 for non archive files.  */
     3742  ufile_ptr origin;
     3743
     3744  /* Remember when output has begun, to stop strange things
     3745     from happening.  */
     3746  bfd_boolean output_has_begun;
     3747
     3748  /* A hash table for section names.  */
     3749  struct bfd_hash_table section_htab;
     3750
     3751  /* Pointer to linked list of sections.  */
     3752  struct sec *sections;
     3753
     3754  /* The place where we add to the section list.  */
     3755  struct sec **section_tail;
     3756
     3757  /* The number of sections.  */
     3758  unsigned int section_count;
     3759
     3760  /* Stuff only useful for object files:
     3761     The start address.  */
     3762  bfd_vma start_address;
     3763
     3764  /* Used for input and output.  */
     3765  unsigned int symcount;
     3766
     3767  /* Symbol table for output BFD (with symcount entries).  */
     3768  struct symbol_cache_entry  **outsymbols;
     3769
     3770  /* Used for slurped dynamic symbol tables.  */
     3771  unsigned int dynsymcount;
     3772
     3773  /* Pointer to structure which contains architecture information.  */
     3774  const struct bfd_arch_info *arch_info;
     3775
     3776  /* Stuff only useful for archives.  */
     3777  PTR arelt_data;
     3778  struct bfd *my_archive;      /* The containing archive BFD.  */
     3779  struct bfd *next;            /* The next BFD in the archive.  */
     3780  struct bfd *archive_head;    /* The first BFD in the archive.  */
     3781  bfd_boolean has_armap;
     3782
     3783  /* A chain of BFD structures involved in a link.  */
     3784  struct bfd *link_next;
     3785
     3786  /* A field used by _bfd_generic_link_add_archive_symbols.  This will
     3787     be used only for archive elements.  */
     3788  int archive_pass;
     3789
     3790  /* Used by the back end to hold private data.  */
     3791  union
     3792    {
    29813793      struct aout_data_struct *aout_data;
    29823794      struct artdata *aout_ar_data;
     
    29953807      struct nlm_obj_tdata *nlm_obj_data;
    29963808      struct bout_data_struct *bout_data;
     3809      struct mmo_data_struct *mmo_data;
    29973810      struct sun_core_struct *sun_core_data;
    29983811      struct sco5_core_struct *sco5_core_data;
     
    30073820      struct versados_data_struct *versados_data;
    30083821      struct netbsd_core_struct *netbsd_core_data;
     3822      struct mach_o_data_struct *mach_o_data;
     3823      struct mach_o_fat_data_struct *mach_o_fat_data;
     3824      struct bfd_pef_data_struct *pef_data;
     3825      struct bfd_pef_xlib_data_struct *pef_xlib_data;
     3826      struct bfd_sym_data_struct *sym_data;
    30093827      PTR any;
    3010       } tdata;
    3011 
    3012     /* Used by the application to hold private data*/
    3013     PTR usrdata;
     3828    }
     3829  tdata;
     3830
     3831  /* Used by the application to hold private data.  */
     3832  PTR usrdata;
    30143833
    30153834  /* Where all the allocated stuff under this BFD goes.  This is a
    30163835     struct objalloc *, but we use PTR to avoid requiring the inclusion of
    30173836     objalloc.h.  */
    3018     PTR memory;
     3837  PTR memory;
    30193838};
    30203839
     
    30253844  bfd_error_invalid_target,
    30263845  bfd_error_wrong_format,
     3846  bfd_error_wrong_object_format,
    30273847  bfd_error_invalid_operation,
    30283848  bfd_error_no_memory,
     
    30403860  bfd_error_file_too_big,
    30413861  bfd_error_invalid_error_code
    3042 } bfd_error_type;
     3862}
     3863bfd_error_type;
    30433864
    30443865bfd_error_type
     
    30483869bfd_set_error PARAMS ((bfd_error_type error_tag));
    30493870
    3050 CONST char *
     3871const char *
    30513872bfd_errmsg PARAMS ((bfd_error_type error_tag));
    30523873
    30533874void
    3054 bfd_perror PARAMS ((CONST char *message));
     3875bfd_perror PARAMS ((const char *message));
    30553876
    30563877typedef void (*bfd_error_handler_type) PARAMS ((const char *, ...));
     
    30643885bfd_error_handler_type
    30653886bfd_get_error_handler PARAMS ((void));
     3887
     3888const char *
     3889bfd_archive_filename PARAMS ((bfd *));
    30663890
    30673891long
     
    30753899
    30763900void
    3077 bfd_set_reloc PARAMS ((bfd *abfd, asection *sec, arelent **rel, unsigned int count)
    3078 
    3079     );
    3080 
    3081 boolean
     3901bfd_set_reloc PARAMS ((bfd *abfd, asection *sec, arelent **rel, unsigned int count));
     3902
     3903bfd_boolean
    30823904bfd_set_file_flags PARAMS ((bfd *abfd, flagword flags));
    30833905
     
    30883910bfd_get_sign_extend_vma PARAMS ((bfd *abfd));
    30893911
    3090 boolean
     3912bfd_boolean
    30913913bfd_set_start_address PARAMS ((bfd *abfd, bfd_vma vma));
    30923914
    3093 long
    3094 bfd_get_mtime PARAMS ((bfd *abfd));
    3095 
    3096 long
    3097 bfd_get_size PARAMS ((bfd *abfd));
    3098 
    3099 int
     3915unsigned int
    31003916bfd_get_gp_size PARAMS ((bfd *abfd));
    31013917
    31023918void
    3103 bfd_set_gp_size PARAMS ((bfd *abfd, int i));
     3919bfd_set_gp_size PARAMS ((bfd *abfd, unsigned int i));
    31043920
    31053921bfd_vma
    3106 bfd_scan_vma PARAMS ((CONST char *string, CONST char **end, int base));
    3107 
    3108 boolean
     3922bfd_scan_vma PARAMS ((const char *string, const char **end, int base));
     3923
     3924bfd_boolean
    31093925bfd_copy_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd));
    31103926
     
    31123928     BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
    31133929               (ibfd, obfd))
    3114 boolean
     3930bfd_boolean
    31153931bfd_merge_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd));
    31163932
     
    31183934     BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
    31193935               (ibfd, obfd))
    3120 boolean
     3936bfd_boolean
    31213937bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags));
    31223938
    31233939#define bfd_set_private_flags(abfd, flags) \
    3124      BFD_SEND (abfd, _bfd_set_private_flags, \
    3125                (abfd, flags))
     3940     BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
    31263941#define bfd_sizeof_headers(abfd, reloc) \
    3127      BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
     3942       BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
    31283943
    31293944#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
    3130      BFD_SEND (abfd, _bfd_find_nearest_line,  (abfd, sec, syms, off, file, func, line))
    3131 
    3132        /* Do these three do anything useful at all, for any back end?  */
     3945       BFD_SEND (abfd, _bfd_find_nearest_line, \
     3946                 (abfd, sec, syms, off, file, func, line))
     3947
    31333948#define bfd_debug_info_start(abfd) \
    3134         BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
     3949       BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
    31353950
    31363951#define bfd_debug_info_end(abfd) \
    3137         BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
     3952       BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
    31383953
    31393954#define bfd_debug_info_accumulate(abfd, section) \
    3140         BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
    3141 
     3955       BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
    31423956
    31433957#define bfd_stat_arch_elt(abfd, stat) \
    3144         BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
     3958       BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
    31453959
    31463960#define bfd_update_armap_timestamp(abfd) \
    3147         BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
     3961       BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
    31483962
    31493963#define bfd_set_arch_mach(abfd, arch, mach)\
    3150         BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
     3964       BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
    31513965
    31523966#define bfd_relax_section(abfd, section, link_info, again) \
     
    31563970       BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
    31573971
     3972#define bfd_merge_sections(abfd, link_info) \
     3973       BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
     3974
     3975#define bfd_discard_group(abfd, sec) \
     3976       BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
     3977
    31583978#define bfd_link_hash_table_create(abfd) \
    31593979       BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
    31603980
     3981#define bfd_link_hash_table_free(abfd, hash) \
     3982       BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))
     3983
    31613984#define bfd_link_add_symbols(abfd, info) \
    31623985       BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
     3986
     3987#define bfd_link_just_syms(sec, info) \
     3988       BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
    31633989
    31643990#define bfd_final_link(abfd, info) \
     
    31864012       PARAMS ((bfd *, struct bfd_link_info *,
    31874013                 struct bfd_link_order *, bfd_byte *,
    3188                  boolean, asymbol **));
    3189 
     4014                 bfd_boolean, asymbol **));
     4015
     4016bfd_boolean
     4017bfd_alt_mach_code PARAMS ((bfd *abfd, int alternative));
     4018
     4019struct bfd_preserve
     4020{
     4021  PTR marker;
     4022  PTR tdata;
     4023  flagword flags;
     4024  const struct bfd_arch_info *arch_info;
     4025  struct sec *sections;
     4026  struct sec **section_tail;
     4027  unsigned int section_count;
     4028  struct bfd_hash_table section_htab;
     4029};
     4030
     4031bfd_boolean
     4032bfd_preserve_save PARAMS ((bfd *, struct bfd_preserve *));
     4033
     4034void
     4035bfd_preserve_restore PARAMS ((bfd *, struct bfd_preserve *));
     4036
     4037void
     4038bfd_preserve_finish PARAMS ((bfd *, struct bfd_preserve *));
     4039
     4040/* Extracted from archive.c.  */
    31904041symindex
    31914042bfd_get_next_mapent PARAMS ((bfd *abfd, symindex previous, carsym **sym));
    31924043
    3193 boolean
     4044bfd_boolean
    31944045bfd_set_archive_head PARAMS ((bfd *output, bfd *new_head));
    31954046
     
    31974048bfd_openr_next_archived_file PARAMS ((bfd *archive, bfd *previous));
    31984049
    3199 CONST char *
     4050/* Extracted from corefile.c.  */
     4051const char *
    32004052bfd_core_file_failing_command PARAMS ((bfd *abfd));
    32014053
     
    32034055bfd_core_file_failing_signal PARAMS ((bfd *abfd));
    32044056
    3205 boolean
     4057bfd_boolean
    32064058core_file_matches_executable_p PARAMS ((bfd *core_bfd, bfd *exec_bfd));
    32074059
     4060/* Extracted from targets.c.  */
    32084061#define BFD_SEND(bfd, message, arglist) \
    32094062               ((*((bfd)->xvec->message)) arglist)
     
    32264079   (bfd_assert (__FILE__,__LINE__), NULL))
    32274080#endif
    3228 enum bfd_flavour {
     4081
     4082enum bfd_flavour
     4083{
    32294084  bfd_target_unknown_flavour,
    32304085  bfd_target_aout_flavour,
     
    32444099  bfd_target_msdos_flavour,
    32454100  bfd_target_ovax_flavour,
    3246   bfd_target_evax_flavour
     4101  bfd_target_evax_flavour,
     4102  bfd_target_mmo_flavour,
     4103  bfd_target_mach_o_flavour,
     4104  bfd_target_pef_flavour,
     4105  bfd_target_pef_xlib_flavour,
     4106  bfd_target_sym_flavour
    32474107};
    32484108
     
    32544114typedef struct bfd_target
    32554115{
     4116  /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc.  */
    32564117  char *name;
     4118
     4119 /* The "flavour" of a back end is a general indication about
     4120    the contents of a file.  */
    32574121  enum bfd_flavour flavour;
     4122
     4123  /* The order of bytes within the data area of a file.  */
    32584124  enum bfd_endian byteorder;
     4125
     4126 /* The order of bytes within the header parts of a file.  */
    32594127  enum bfd_endian header_byteorder;
     4128
     4129  /* A mask of all the flags which an executable may have set -
     4130     from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>.  */
    32604131  flagword object_flags;
     4132
     4133 /* A mask of all the flags which a section may have set - from
     4134    the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>.  */
    32614135  flagword section_flags;
     4136
     4137 /* The character normally found at the front of a symbol.
     4138    (if any), perhaps `_'.  */
    32624139  char symbol_leading_char;
     4140
     4141 /* The pad character for file names within an archive header.  */
    32634142  char ar_pad_char;
     4143
     4144  /* The maximum number of characters in an archive header.  */
    32644145  unsigned short ar_max_namelen;
    3265   bfd_vma      (*bfd_getx64) PARAMS ((const bfd_byte *));
     4146
     4147  /* Entries for byte swapping for data. These are different from the
     4148     other entry points, since they don't take a BFD asthe first argument.
     4149     Certain other handlers could do the same.  */
     4150  bfd_vma        (*bfd_getx64) PARAMS ((const bfd_byte *));
    32664151  bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *));
    3267   void         (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));
    3268   bfd_vma      (*bfd_getx32) PARAMS ((const bfd_byte *));
     4152  void           (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));
     4153  bfd_vma        (*bfd_getx32) PARAMS ((const bfd_byte *));
    32694154  bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((const bfd_byte *));
    3270   void         (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *));
    3271   bfd_vma      (*bfd_getx16) PARAMS ((const bfd_byte *));
     4155  void           (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *));
     4156  bfd_vma        (*bfd_getx16) PARAMS ((const bfd_byte *));
    32724157  bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *));
    3273   void         (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *));
    3274   bfd_vma      (*bfd_h_getx64) PARAMS ((const bfd_byte *));
     4158  void           (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *));
     4159
     4160  /* Byte swapping for the headers.  */
     4161  bfd_vma        (*bfd_h_getx64) PARAMS ((const bfd_byte *));
    32754162  bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *));
    3276   void         (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));
    3277   bfd_vma      (*bfd_h_getx32) PARAMS ((const bfd_byte *));
     4163  void           (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));
     4164  bfd_vma        (*bfd_h_getx32) PARAMS ((const bfd_byte *));
    32784165  bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((const bfd_byte *));
    3279   void         (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *));
    3280   bfd_vma      (*bfd_h_getx16) PARAMS ((const bfd_byte *));
     4166  void           (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *));
     4167  bfd_vma        (*bfd_h_getx16) PARAMS ((const bfd_byte *));
    32814168  bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *));
    3282   void         (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *));
     4169  void           (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *));
     4170
     4171  /* Format dependent routines: these are vectors of entry points
     4172     within the target vector structure, one for each format to check.  */
     4173
     4174  /* Check the format of a file being read.  Return a <<bfd_target *>> or zero.  */
    32834175  const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *));
    3284   boolean             (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *));
    3285   boolean             (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *));
     4176
     4177  /* Set the format of a file being written.  */
     4178  bfd_boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *));
     4179
     4180  /* Write cached information into a file being written, at <<bfd_close>>.  */
     4181  bfd_boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *));
     4182
    32864183
    32874184  /* Generic entry points.  */
    3288 #define BFD_JUMP_TABLE_GENERIC(NAME)\
    3289 CAT(NAME,_close_and_cleanup),\
    3290 CAT(NAME,_bfd_free_cached_info),\
    3291 CAT(NAME,_new_section_hook),\
    3292 CAT(NAME,_get_section_contents),\
    3293 CAT(NAME,_get_section_contents_in_window)
     4185#define BFD_JUMP_TABLE_GENERIC(NAME) \
     4186CONCAT2 (NAME,_close_and_cleanup), \
     4187CONCAT2 (NAME,_bfd_free_cached_info), \
     4188CONCAT2 (NAME,_new_section_hook), \
     4189CONCAT2 (NAME,_get_section_contents), \
     4190CONCAT2 (NAME,_get_section_contents_in_window)
    32944191
    32954192  /* Called when the BFD is being closed to do any necessary cleanup.  */
    3296   boolean      (*_close_and_cleanup) PARAMS ((bfd *));
     4193  bfd_boolean (*_close_and_cleanup) PARAMS ((bfd *));
    32974194  /* Ask the BFD to free all cached information.  */
    3298   boolean (*_bfd_free_cached_info) PARAMS ((bfd *));
     4195  bfd_boolean (*_bfd_free_cached_info) PARAMS ((bfd *));
    32994196  /* Called when a new section is created.  */
    3300   boolean      (*_new_section_hook) PARAMS ((bfd *, sec_ptr));
     4197  bfd_boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr));
    33014198  /* Read the contents of a section.  */
    3302   boolean       (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
    3303                                             file_ptr, bfd_size_type));
    3304   boolean       (*_bfd_get_section_contents_in_window)
    3305                           PARAMS ((bfd *, sec_ptr, bfd_window *,
    3306                                    file_ptr, bfd_size_type));
     4199  bfd_boolean (*_bfd_get_section_contents)
     4200    PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type));
     4201  bfd_boolean (*_bfd_get_section_contents_in_window)
     4202    PARAMS ((bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type));
    33074203
    33084204  /* Entry points to copy private data.  */
    3309 #define BFD_JUMP_TABLE_COPY(NAME)\
    3310 CAT(NAME,_bfd_copy_private_bfd_data),\
    3311 CAT(NAME,_bfd_merge_private_bfd_data),\
    3312 CAT(NAME,_bfd_copy_private_section_data),\
    3313 CAT(NAME,_bfd_copy_private_symbol_data),\
    3314 CAT(NAME,_bfd_set_private_flags),\
    3315 CAT(NAME,_bfd_print_private_bfd_data)\
     4205#define BFD_JUMP_TABLE_COPY(NAME) \
     4206CONCAT2 (NAME,_bfd_copy_private_bfd_data), \
     4207CONCAT2 (NAME,_bfd_merge_private_bfd_data), \
     4208CONCAT2 (NAME,_bfd_copy_private_section_data), \
     4209CONCAT2 (NAME,_bfd_copy_private_symbol_data), \
     4210CONCAT2 (NAME,_bfd_set_private_flags), \
     4211CONCAT2 (NAME,_bfd_print_private_bfd_data) \
    33164212  /* Called to copy BFD general private data from one object file
    33174213     to another.  */
    3318   boolean      (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));
     4214  bfd_boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));
    33194215  /* Called to merge BFD general private data from one object file
    33204216     to a common output file when linking.  */
    3321   boolean      (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *));
     4217  bfd_boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *));
    33224218  /* Called to copy BFD private section data from one object file
    33234219     to another.  */
    3324   boolean       (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr,
    3325                                                       bfd *, sec_ptr));
     4220  bfd_boolean (*_bfd_copy_private_section_data)
     4221    PARAMS ((bfd *, sec_ptr, bfd *, sec_ptr));
    33264222  /* Called to copy BFD private symbol data from one symbol
    33274223     to another.  */
    3328   boolean       (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *,
    3329                                                           bfd *, asymbol *));
    3330   /* Called to set private backend flags */
    3331   boolean      (*_bfd_set_private_flags) PARAMS ((bfd *, flagword));
    3332 
    3333   /* Called to print private BFD data */
    3334   boolean      (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR));
     4224  bfd_boolean (*_bfd_copy_private_symbol_data)
     4225    PARAMS ((bfd *, asymbol *, bfd *, asymbol *));
     4226  /* Called to set private backend flags. */
     4227  bfd_boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword));
     4228
     4229  /* Called to print private BFD data. */
     4230  bfd_boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR));
    33354231
    33364232  /* Core file entry points.  */
    3337 #define BFD_JUMP_TABLE_CORE(NAME)\
    3338 CAT(NAME,_core_file_failing_command),\
    3339 CAT(NAME,_core_file_failing_signal),\
    3340 CAT(NAME,_core_file_matches_executable_p)
    3341   char *   (*_core_file_failing_command) PARAMS ((bfd *));
    3342   int      (*_core_file_failing_signal) PARAMS ((bfd *));
    3343   boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *));
     4233#define BFD_JUMP_TABLE_CORE(NAME) \
     4234CONCAT2 (NAME,_core_file_failing_command), \
     4235CONCAT2 (NAME,_core_file_failing_signal), \
     4236CONCAT2 (NAME,_core_file_matches_executable_p)
     4237  char *      (*_core_file_failing_command) PARAMS ((bfd *));
     4238  int         (*_core_file_failing_signal) PARAMS ((bfd *));
     4239  bfd_boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *));
    33444240
    33454241  /* Archive entry points.  */
    3346 #define BFD_JUMP_TABLE_ARCHIVE(NAME)\
    3347 CAT(NAME,_slurp_armap),\
    3348 CAT(NAME,_slurp_extended_name_table),\
    3349 CAT(NAME,_construct_extended_name_table),\
    3350 CAT(NAME,_truncate_arname),\
    3351 CAT(NAME,_write_armap),\
    3352 CAT(NAME,_read_ar_hdr),\
    3353 CAT(NAME,_openr_next_archived_file),\
    3354 CAT(NAME,_get_elt_at_index),\
    3355 CAT(NAME,_generic_stat_arch_elt),\
    3356 CAT(NAME,_update_armap_timestamp)
    3357   boolean  (*_bfd_slurp_armap) PARAMS ((bfd *));
    3358   boolean  (*_bfd_slurp_extended_name_table) PARAMS ((bfd *));
    3359   boolean  (*_bfd_construct_extended_name_table)
    3360              PARAMS ((bfd *, char **, bfd_size_type *, const char **));
    3361   void     (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *));
    3362   boolean  (*write_armap) PARAMS ((bfd *arch,
    3363                               unsigned int elength,
    3364                               struct orl *map,
    3365                               unsigned int orl_count,
    3366                               int stridx));
    3367   PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *));
    3368   bfd *    (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev));
     4242#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
     4243CONCAT2 (NAME,_slurp_armap), \
     4244CONCAT2 (NAME,_slurp_extended_name_table), \
     4245CONCAT2 (NAME,_construct_extended_name_table), \
     4246CONCAT2 (NAME,_truncate_arname), \
     4247CONCAT2 (NAME,_write_armap), \
     4248CONCAT2 (NAME,_read_ar_hdr), \
     4249CONCAT2 (NAME,_openr_next_archived_file), \
     4250CONCAT2 (NAME,_get_elt_at_index), \
     4251CONCAT2 (NAME,_generic_stat_arch_elt), \
     4252CONCAT2 (NAME,_update_armap_timestamp)
     4253  bfd_boolean (*_bfd_slurp_armap) PARAMS ((bfd *));
     4254  bfd_boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *));
     4255  bfd_boolean (*_bfd_construct_extended_name_table)
     4256    PARAMS ((bfd *, char **, bfd_size_type *, const char **));
     4257  void        (*_bfd_truncate_arname) PARAMS ((bfd *, const char *, char *));
     4258  bfd_boolean (*write_armap)
     4259    PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int));
     4260  PTR         (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *));
     4261  bfd *       (*openr_next_archived_file) PARAMS ((bfd *, bfd *));
    33694262#define bfd_get_elt_at_index(b,i) BFD_SEND(b, _bfd_get_elt_at_index, (b,i))
    3370   bfd *    (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex));
    3371   int      (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));
    3372   boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *));
     4263  bfd *       (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex));
     4264  int         (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));
     4265  bfd_boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *));
    33734266
    33744267  /* Entry points used for symbols.  */
    3375 #define BFD_JUMP_TABLE_SYMBOLS(NAME)\
    3376 CAT(NAME,_get_symtab_upper_bound),\
    3377 CAT(NAME,_get_symtab),\
    3378 CAT(NAME,_make_empty_symbol),\
    3379 CAT(NAME,_print_symbol),\
    3380 CAT(NAME,_get_symbol_info),\
    3381 CAT(NAME,_bfd_is_local_label_name),\
    3382 CAT(NAME,_get_lineno),\
    3383 CAT(NAME,_find_nearest_line),\
    3384 CAT(NAME,_bfd_make_debug_symbol),\
    3385 CAT(NAME,_read_minisymbols),\
    3386 CAT(NAME,_minisymbol_to_symbol)
    3387   long  (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *));
    3388   long  (*_bfd_canonicalize_symtab) PARAMS ((bfd *,
    3389                                              struct symbol_cache_entry **));
    3390   struct symbol_cache_entry  *
    3391                 (*_bfd_make_empty_symbol) PARAMS ((bfd *));
    3392   void          (*_bfd_print_symbol) PARAMS ((bfd *, PTR,
    3393                                       struct symbol_cache_entry *,
    3394                                       bfd_print_symbol_type));
     4268#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
     4269CONCAT2 (NAME,_get_symtab_upper_bound), \
     4270CONCAT2 (NAME,_get_symtab), \
     4271CONCAT2 (NAME,_make_empty_symbol), \
     4272CONCAT2 (NAME,_print_symbol), \
     4273CONCAT2 (NAME,_get_symbol_info), \
     4274CONCAT2 (NAME,_bfd_is_local_label_name), \
     4275CONCAT2 (NAME,_get_lineno), \
     4276CONCAT2 (NAME,_find_nearest_line), \
     4277CONCAT2 (NAME,_bfd_make_debug_symbol), \
     4278CONCAT2 (NAME,_read_minisymbols), \
     4279CONCAT2 (NAME,_minisymbol_to_symbol)
     4280  long        (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *));
     4281  long        (*_bfd_canonicalize_symtab) PARAMS ((bfd *,
     4282                                                struct symbol_cache_entry **));
     4283  struct symbol_cache_entry *
     4284              (*_bfd_make_empty_symbol) PARAMS ((bfd *));
     4285  void        (*_bfd_print_symbol)
     4286    PARAMS ((bfd *, PTR, struct symbol_cache_entry *, bfd_print_symbol_type));
    33954287#define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e))
    3396   void          (*_bfd_get_symbol_info) PARAMS ((bfd *,
    3397                                       struct symbol_cache_entry *,
    3398                                       symbol_info *));
     4288  void        (*_bfd_get_symbol_info)
     4289    PARAMS ((bfd *, struct symbol_cache_entry *, symbol_info *));
    33994290#define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e))
    3400   boolean       (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *));
    3401 
    3402   alent *    (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *));
    3403   boolean    (*_bfd_find_nearest_line) PARAMS ((bfd *abfd,
    3404                     struct sec *section, struct symbol_cache_entry **symbols,
    3405                     bfd_vma offset, CONST char **file, CONST char **func,
    3406                     unsigned int *line));
     4291  bfd_boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *));
     4292
     4293  alent *     (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *));
     4294  bfd_boolean (*_bfd_find_nearest_line)
     4295    PARAMS ((bfd *, struct sec *, struct symbol_cache_entry **, bfd_vma,
     4296             const char **, const char **, unsigned int *));
    34074297 /* Back-door to allow format-aware applications to create debug symbols
    34084298    while using BFD for everything else.  Currently used by the assembler
    34094299    when creating COFF files.  */
    3410   asymbol *  (*_bfd_make_debug_symbol) PARAMS ((
    3411        bfd *abfd,
    3412        void *ptr,
    3413        unsigned long size));
     4300  asymbol *   (*_bfd_make_debug_symbol)
     4301    PARAMS ((bfd *, void *, unsigned long size));
    34144302#define bfd_read_minisymbols(b, d, m, s) \
    34154303  BFD_SEND (b, _read_minisymbols, (b, d, m, s))
    3416   long  (*_read_minisymbols) PARAMS ((bfd *, boolean, PTR *,
    3417                                       unsigned int *));
     4304  long        (*_read_minisymbols)
     4305    PARAMS ((bfd *, bfd_boolean, PTR *, unsigned int *));
    34184306#define bfd_minisymbol_to_symbol(b, d, m, f) \
    34194307  BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
    3420   asymbol *(*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR,
    3421                                             asymbol *));
     4308  asymbol *   (*_minisymbol_to_symbol)
     4309    PARAMS ((bfd *, bfd_boolean, const PTR, asymbol *));
    34224310
    34234311  /* Routines for relocs.  */
    3424 #define BFD_JUMP_TABLE_RELOCS(NAME)\
    3425 CAT(NAME,_get_reloc_upper_bound),\
    3426 CAT(NAME,_canonicalize_reloc),\
    3427 CAT(NAME,_bfd_reloc_type_lookup)
    3428   long  (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));
    3429   long  (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **,
    3430                                             struct symbol_cache_entry **));
     4312#define BFD_JUMP_TABLE_RELOCS(NAME) \
     4313CONCAT2 (NAME,_get_reloc_upper_bound), \
     4314CONCAT2 (NAME,_canonicalize_reloc), \
     4315CONCAT2 (NAME,_bfd_reloc_type_lookup)
     4316  long        (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));
     4317  long        (*_bfd_canonicalize_reloc)
     4318    PARAMS ((bfd *, sec_ptr, arelent **, struct symbol_cache_entry **));
    34314319  /* See documentation on reloc types.  */
    34324320  reloc_howto_type *
    3433        (*reloc_type_lookup) PARAMS ((bfd *abfd,
    3434                                      bfd_reloc_code_real_type code));
     4321              (*reloc_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type));
    34354322
    34364323  /* Routines used when writing an object file.  */
    3437 #define BFD_JUMP_TABLE_WRITE(NAME)\
    3438 CAT(NAME,_set_arch_mach),\
    3439 CAT(NAME,_set_section_contents)
    3440   boolean    (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture,
    3441                     unsigned long));
    3442   boolean       (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
    3443                                             file_ptr, bfd_size_type));
     4324#define BFD_JUMP_TABLE_WRITE(NAME) \
     4325CONCAT2 (NAME,_set_arch_mach), \
     4326CONCAT2 (NAME,_set_section_contents)
     4327  bfd_boolean (*_bfd_set_arch_mach)
     4328    PARAMS ((bfd *, enum bfd_architecture, unsigned long));
     4329  bfd_boolean (*_bfd_set_section_contents)
     4330    PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type));
    34444331
    34454332  /* Routines used by the linker.  */
    3446 #define BFD_JUMP_TABLE_LINK(NAME)\
    3447 CAT(NAME,_sizeof_headers),\
    3448 CAT(NAME,_bfd_get_relocated_section_contents),\
    3449 CAT(NAME,_bfd_relax_section),\
    3450 CAT(NAME,_bfd_link_hash_table_create),\
    3451 CAT(NAME,_bfd_link_add_symbols),\
    3452 CAT(NAME,_bfd_final_link),\
    3453 CAT(NAME,_bfd_link_split_section),\
    3454 CAT(NAME,_bfd_gc_sections)
    3455   int        (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean));
    3456   bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *,
    3457                     struct bfd_link_info *, struct bfd_link_order *,
    3458                     bfd_byte *data, boolean relocateable,
    3459                     struct symbol_cache_entry **));
    3460 
    3461   boolean    (*_bfd_relax_section) PARAMS ((bfd *, struct sec *,
    3462                     struct bfd_link_info *, boolean *again));
     4333#define BFD_JUMP_TABLE_LINK(NAME) \
     4334CONCAT2 (NAME,_sizeof_headers), \
     4335CONCAT2 (NAME,_bfd_get_relocated_section_contents), \
     4336CONCAT2 (NAME,_bfd_relax_section), \
     4337CONCAT2 (NAME,_bfd_link_hash_table_create), \
     4338CONCAT2 (NAME,_bfd_link_hash_table_free), \
     4339CONCAT2 (NAME,_bfd_link_add_symbols), \
     4340CONCAT2 (NAME,_bfd_link_just_syms), \
     4341CONCAT2 (NAME,_bfd_final_link), \
     4342CONCAT2 (NAME,_bfd_link_split_section), \
     4343CONCAT2 (NAME,_bfd_gc_sections), \
     4344CONCAT2 (NAME,_bfd_merge_sections), \
     4345CONCAT2 (NAME,_bfd_discard_group)
     4346  int         (*_bfd_sizeof_headers) PARAMS ((bfd *, bfd_boolean));
     4347  bfd_byte *  (*_bfd_get_relocated_section_contents)
     4348    PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *,
     4349             bfd_byte *, bfd_boolean, struct symbol_cache_entry **));
     4350
     4351  bfd_boolean (*_bfd_relax_section)
     4352    PARAMS ((bfd *, struct sec *, struct bfd_link_info *, bfd_boolean *));
    34634353
    34644354  /* Create a hash table for the linker.  Different backends store
    34654355     different information in this table.  */
    3466   struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *));
     4356  struct bfd_link_hash_table *
     4357              (*_bfd_link_hash_table_create) PARAMS ((bfd *));
     4358
     4359  /* Release the memory associated with the linker hash table.  */
     4360  void        (*_bfd_link_hash_table_free)
     4361    PARAMS ((struct bfd_link_hash_table *));
    34674362
    34684363  /* Add symbols from this object file into the hash table.  */
    3469   boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *));
     4364  bfd_boolean (*_bfd_link_add_symbols)
     4365    PARAMS ((bfd *, struct bfd_link_info *));
     4366
     4367  /* Indicate that we are only retrieving symbol values from this section.  */
     4368  void        (*_bfd_link_just_syms)
     4369    PARAMS ((asection *, struct bfd_link_info *));
    34704370
    34714371  /* Do a link based on the link_order structures attached to each
    34724372     section of the BFD.  */
    3473   boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));
     4373  bfd_boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));
    34744374
    34754375  /* Should this section be split up into smaller pieces during linking.  */
    3476   boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *));
     4376  bfd_boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *));
    34774377
    34784378  /* Remove sections that are not referenced from the output.  */
    3479   boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *));
     4379  bfd_boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *));
     4380
     4381  /* Attempt to merge SEC_MERGE sections.  */
     4382  bfd_boolean (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *));
     4383
     4384  /* Discard members of a group.  */
     4385  bfd_boolean (*_bfd_discard_group) PARAMS ((bfd *, struct sec *));
    34804386
    34814387  /* Routines to handle dynamic symbols and relocs.  */
    3482 #define BFD_JUMP_TABLE_DYNAMIC(NAME)\
    3483 CAT(NAME,_get_dynamic_symtab_upper_bound),\
    3484 CAT(NAME,_canonicalize_dynamic_symtab),\
    3485 CAT(NAME,_get_dynamic_reloc_upper_bound),\
    3486 CAT(NAME,_canonicalize_dynamic_reloc)
    3487   /* Get the amount of memory required to hold the dynamic symbols. */
    3488   long  (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *));
     4388#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
     4389CONCAT2 (NAME,_get_dynamic_symtab_upper_bound), \
     4390CONCAT2 (NAME,_canonicalize_dynamic_symtab), \
     4391CONCAT2 (NAME,_get_dynamic_reloc_upper_bound), \
     4392CONCAT2 (NAME,_canonicalize_dynamic_reloc)
     4393  /* Get the amount of memory required to hold the dynamic symbols.  */
     4394  long        (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *));
    34894395  /* Read in the dynamic symbols.  */
    3490   long  (*_bfd_canonicalize_dynamic_symtab)
     4396  long        (*_bfd_canonicalize_dynamic_symtab)
    34914397    PARAMS ((bfd *, struct symbol_cache_entry **));
    34924398  /* Get the amount of memory required to hold the dynamic relocs.  */
    3493   long  (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *));
     4399  long        (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *));
    34944400  /* Read in the dynamic relocs.  */
    3495   long  (*_bfd_canonicalize_dynamic_reloc)
     4401  long        (*_bfd_canonicalize_dynamic_reloc)
    34964402    PARAMS ((bfd *, arelent **, struct symbol_cache_entry **));
    34974403
    3498  /* Opposite endian version of this target.  */
    3499  const struct bfd_target * alternative_target;
    3500 
    3501  PTR backend_data;
     4404  /* Opposite endian version of this target.  */
     4405  const struct bfd_target * alternative_target;
     4406
     4407  /* Data for use by back-end routines, which isn't
     4408     generic enough to belong in this structure.  */
     4409  PTR backend_data;
    35024410
    35034411} bfd_target;
    3504 boolean
     4412
     4413bfd_boolean
    35054414bfd_set_default_target PARAMS ((const char *name));
    35064415
    35074416const bfd_target *
    3508 bfd_find_target PARAMS ((CONST char *target_name, bfd *abfd));
     4417bfd_find_target PARAMS ((const char *target_name, bfd *abfd));
    35094418
    35104419const char **
     
    35124421
    35134422const bfd_target *
    3514 bfd_search_for_target PARAMS ((int (* search_func) (const bfd_target *, void *), void *));
    3515 
    3516 boolean
     4423bfd_search_for_target PARAMS ((int (* search_func)
     4424       (const bfd_target *, void *),
     4425    void *));
     4426
     4427/* Extracted from format.c.  */
     4428bfd_boolean
    35174429bfd_check_format PARAMS ((bfd *abfd, bfd_format format));
    35184430
    3519 boolean
    3520 bfd_check_format_matches PARAMS ((bfd *abfd, bfd_format format, char ***matching));
    3521 
    3522 boolean
     4431bfd_boolean
     4432bfd_check_format_matches PARAMS ((bfd *abfd, bfd_format format,
     4433    char ***matching));
     4434
     4435bfd_boolean
    35234436bfd_set_format PARAMS ((bfd *abfd, bfd_format format));
    35244437
    3525 CONST char *
     4438const char *
    35264439bfd_format_string PARAMS ((bfd_format format));
     4440
     4441/* Extracted from linker.c.  */
     4442bfd_boolean
     4443bfd_link_split_section PARAMS ((bfd *abfd, asection *sec));
     4444
     4445#define bfd_link_split_section(abfd, sec) \
     4446       BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
     4447
     4448/* Extracted from simple.c.  */
     4449bfd_byte *
     4450bfd_simple_get_relocated_section_contents PARAMS ((bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table));
    35274451
    35284452#ifdef __cplusplus
  • trunk/src/binutils/bfd/config.bfd

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r617 r618  
    66#  targ_defvec          Default vector for this target
    77#  targ_selvecs         Vectors to build for this target
     8#  targ64_selvecs       Vectors to build if --enable-64-bit-bfd is given
     9#                       or if host is 64 bit.
    810#  targ_archs           Architectures for this target
    911#  targ_cflags          $(CFLAGS) for this target (FIXME: pretty bogus)
     
    2426targ_defvec=
    2527targ_selvecs=
     28targ64_selvecs=
    2629targ_cflags=
    2730targ_underscore=no
     
    2932targ_cpu=`echo $targ | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
    3033case "${targ_cpu}" in
    31 alpha*) targ_archs=bfd_alpha_arch ;;
    32 arm*)   targ_archs=bfd_arm_arch ;;
    33 strongarm*) targ_archs=bfd_arm_arch ;;
    34 thumb*) targ_archs=bfd_arm_arch ;;
    35 xscale*) targ_archs=bfd_arm_arch ;;
    36 c30*)   targ_archs=bfd_tic30_arch ;;
    37 c54x*)  targ_archs=bfd_tic54x_arch ;;
    38 hppa*)  targ_archs=bfd_hppa_arch ;;
    39 x86_64) targ_archs=bfd_i386_arch ;;
    40 i[3456]86) targ_archs=bfd_i386_arch ;;
    41 i370)   targ_archs=bfd_i370_arch ;;
     34alpha*)          targ_archs=bfd_alpha_arch ;;
     35arm*)            targ_archs=bfd_arm_arch ;;
     36c30*)            targ_archs=bfd_tic30_arch ;;
     37c4x*)            targ_archs=bfd_tic4x_arch ;;
     38c54x*)           targ_archs=bfd_tic54x_arch ;;
     39dlx*)            targ_archs=bfd_dlx_arch ;;
     40hppa*)           targ_archs=bfd_hppa_arch ;;
     41i[3456]86)       targ_archs=bfd_i386_arch ;;
     42i370)            targ_archs=bfd_i370_arch ;;
    4243m6811*|m68hc11*) targ_archs="bfd_m68hc11_arch bfd_m68hc12_arch" ;;
    4344m6812*|m68hc12*) targ_archs="bfd_m68hc12_arch bfd_m68hc11_arch" ;;
    44 m68*)   targ_archs=bfd_m68k_arch ;;
    45 m88*)   targ_archs=bfd_m88k_arch ;;
    46 mips*)  targ_archs=bfd_mips_arch ;;
    47 pj*)    targ_archs="bfd_pj_arch bfd_i386_arch";;
    48 powerpc*) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
    49 rs6000) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
    50 sparc*) targ_archs=bfd_sparc_arch ;;
    51 v850*)  targ_archs=bfd_v850_arch ;;
    52 z8k*)   targ_archs=bfd_z8k_arch ;;
    53 *)      targ_archs=bfd_${targ_cpu}_arch ;;
     45m68*)            targ_archs=bfd_m68k_arch ;;
     46m88*)            targ_archs=bfd_m88k_arch ;;
     47mips*)           targ_archs=bfd_mips_arch ;;
     48or32*)           targ_archs=bfd_or32_arch ;;
     49pdp11*)          targ_archs=bfd_pdp11_arch ;;
     50pj*)             targ_archs="bfd_pj_arch bfd_i386_arch";;
     51powerpc*)        targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
     52rs6000)          targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
     53s390*)           targ_archs=bfd_s390_arch ;;
     54sh*)             targ_archs=bfd_sh_arch ;;
     55sparc*)          targ_archs=bfd_sparc_arch ;;
     56strongarm*)      targ_archs=bfd_arm_arch ;;
     57thumb*)          targ_archs=bfd_arm_arch ;;
     58v850*)           targ_archs=bfd_v850_arch ;;
     59x86_64)          targ_archs=bfd_i386_arch ;;
     60xscale*)         targ_archs=bfd_arm_arch ;;
     61xtensa*)         targ_archs=bfd_xtensa_arch ;;
     62z8k*)            targ_archs=bfd_z8k_arch ;;
     63*)               targ_archs=bfd_${targ_cpu}_arch ;;
    5464esac
    5565
     
    5969#  can get spurious matches.  Even for unambiguous cases, do this as a
    6070#  convention, else the table becomes a real mess to understand and maintain.
     71#
     72#  Keep obsolete entries above the START comment, to keep them out of
     73#  targmatch.h.
    6174
    6275case "${targ}" in
     76  mips*-dec-bsd*)
     77    echo "This target is obsolete and has been removed."
     78    exit 1
     79    ;;
     80
     81  mips*-*-pe*)
     82    echo "This target is obsolete and has been removed."
     83    exit 1
     84    ;;
     85
    6386# START OF targmatch.h
    6487#ifdef BFD64
    65   alpha*-*-netbsd* | alpha*-*-freebsd*)
     88  alpha*-*-freebsd*)
     89    targ_defvec=bfd_elf64_alpha_freebsd_vec
     90    targ_selvecs=ecoffalpha_little_vec
     91    # FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling.
     92    case "${targ}" in
     93      alpha*-*-freebsd3* | alpha*-*-freebsd4 | alpha*-*-freebsd4.0*)
     94        targ_cflags=-DOLD_FREEBSD_ABI_LABEL ;;
     95    esac
     96    ;;
     97  alpha*-*-netbsd* | alpha*-*-openbsd*)
    6698    targ_defvec=bfd_elf64_alpha_vec
    6799    targ_selvecs=ecoffalpha_little_vec
     
    85117    targ_defvec=ecoffalpha_little_vec
    86118    ;;
    87   ia64*-*-freebsd* | ia64*-*-linux-gnu* | ia64*-*-elf*)
     119  ia64*-*-aix*)
     120    targ_defvec=bfd_elf64_ia64_aix_little_vec
     121    targ_selvecs="bfd_elf64_ia64_aix_big_vec bfd_efi_app_ia64_vec"
     122    ;;
     123  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf*)
    88124    targ_defvec=bfd_elf64_ia64_little_vec
    89125    targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
    90126    ;;
    91127  ia64*-*-hpux*)
    92     targ_defvec=bfd_elf64_ia64_big_vec
    93     targ_selvecs="bfd_elf32_ia64_big_vec"
    94     ;;
    95   sparc64-*-freebsd* | sparc64-*-netbsd*)
     128    targ_defvec=bfd_elf32_ia64_hpux_big_vec
     129    targ_selvecs="bfd_elf64_ia64_hpux_big_vec"
     130    ;;
     131  sparc64-*-freebsd* | sparc64-*-netbsd* | sparc64-*-openbsd*)
    96132    targ_defvec=bfd_elf64_sparc_vec
    97133    targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
     
    104140    ;;
    105141
    106   arm-*-netbsd*)
     142  armeb-*-netbsdelf*)
     143    targ_defvec=bfd_elf32_bigarm_vec
     144    targ_selvecs="bfd_elf32_littlearm_vec armnetbsd_vec"
     145    ;;
     146  arm-*-netbsdelf*)
     147    targ_defvec=bfd_elf32_littlearm_vec
     148    targ_selvecs="bfd_elf32_bigarm_vec armnetbsd_vec"
     149    ;;
     150  arm-*-netbsd* | arm-*-openbsd*)
    107151    targ_defvec=armnetbsd_vec
    108     targ_underscore=yes
     152    targ_selvecs="bfd_elf32_littlearm_vec bfd_elf32_bigarm_vec"
     153    targ_underscore=yes
     154    ;;
     155  arm-*-nto* | nto*arm*)
     156    targ_defvec=bfd_elf32_littlearm_vec
     157    targ_selvecs=bfd_elf32_bigarm_vec
    109158    ;;
    110159  arm-*-riscix*)
     
    115164    targ_selvecs="arm_epoc_pe_little_vec arm_epoc_pe_big_vec arm_epoc_pei_little_vec arm_epoc_pei_big_vec"
    116165    targ_underscore=no
     166    targ_cflags=-DARM_COFF_BUGFIX
    117167    ;;
    118168  arm-wince-pe | arm-*-wince)
     
    135185    targ_selvecs=aout_arm_little_vec
    136186    ;;
     187  arm-*-vxworks*)
     188    targ_defvec=armcoff_little_vec
     189    targ_selvecs=armcoff_big_vec
     190    targ_underscore=yes
     191    targ_cflags=-DARM_COFF_BUGFIX
     192    ;;
    137193  arm-*-coff)
    138194    targ_defvec=armcoff_little_vec
     
    140196    targ_underscore=yes
    141197    ;;
    142   arm-*-vxworks*)
    143     targ_defvec=armcoff_little_vec
    144     targ_selvecs=armcoff_big_vec
    145     targ_underscore=yes
    146     targ_cflags=-DVXWORKS
    147     ;;
    148198  arm-*-rtems*)
    149199    targ_defvec=bfd_elf32_littlearm_vec
     
    154204    targ_selvecs=bfd_elf32_littlearm_vec
    155205    ;;
     206  arm-*-kaos* | strongarm-*-kaos*)
     207    targ_defvec=bfd_elf32_littlearm_vec
     208    targ_selvecs=bfd_elf32_bigarm_vec
     209    ;;
    156210  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux*)
     211    targ_defvec=bfd_elf32_littlearm_vec
     212    targ_selvecs=bfd_elf32_bigarm_vec
     213    ;;
     214  arm9e-*-elf)
    157215    targ_defvec=bfd_elf32_littlearm_vec
    158216    targ_selvecs=bfd_elf32_bigarm_vec
     
    227285    ;;
    228286
     287  c4x-*-*coff* | tic4x-*-*coff*)
     288    targ_defvec=tic4x_coff1_vec
     289    targ_selvecs="tic4x_coff1_beh_vec tic4x_coff2_vec tic4x_coff2_beh_vec tic4x_coff0_vec tic4x_coff0_beh_vec"
     290    targ_underscore=yes
     291    ;;
     292
    229293  c54x*-*-*coff* | tic54x-*-*coff*)
    230294    targ_defvec=tic54x_coff1_vec
     
    243307    ;;
    244308
     309  dlx-*-elf*)
     310    targ_defvec=bfd_elf32_dlx_big_vec
     311    targ_selvecs="bfd_elf32_dlx_big_vec"
     312    ;;
     313
    245314  d30v-*-*)
    246315    targ_defvec=bfd_elf32_d30v_vec
     
    251320    ;;
    252321
     322  frv-*-elf)
     323    targ_defvec=bfd_elf32_frv_vec
     324    ;;
     325
     326
     327  h8300*-*-elf)
     328    targ_defvec=bfd_elf32_h8300_vec
     329    targ_underscore=yes
     330    ;;
    253331
    254332  h8300*-*-*)
     
    278356    targ_selvecs=bfd_elf32_hppa_vec
    279357    ;;
    280   hppa*-*-*elf* | hppa*-*-lites* | hppa*-*-sysv4* | hppa*-*-rtems*)
     358  hppa*-*-*elf* | hppa*-*-lites* | hppa*-*-netbsd* | hppa*-*-sysv4* | hppa*-*-rtems* | hppa*-*-openbsd*)
    281359    targ_defvec=bfd_elf32_hppa_vec
    282360    targ_selvecs=bfd_elf32_hppa_linux_vec
     
    311389    targ_selvecs=i386coff_vec
    312390    ;;
    313   i[3456]86-*-rtemself*)
     391  i[3456]86-*-kaos*)
    314392    targ_defvec=bfd_elf32_i386_vec
    315     targ_selvecs="i386coff_vec i386aout_vec"
     393    targ_selvecs=bfd_elf32_i386_vec
     394    ;;
     395  i[3456]86-*-nto*)
     396    targ_defvec=bfd_elf32_i386_vec
     397    targ_selvecs=i386coff_vec
     398    ;;
     399  i[3456]86-*-aros*)
     400    targ_defvec=bfd_elf32_i386_vec
    316401    ;;
    317402  i[3456]86-*-chorus*)
    318403    targ_defvec=bfd_elf32_i386_vec
    319404    ;;
    320   i[3456]86-*-msdosdjgpp* | i[3456]*-*-go32* | i[3456]86-go32-rtems* )
     405  *-*-msdosdjgpp* | *-*-go32* | *-go32-rtems* )
    321406    targ_defvec=go32coff_vec
    322407    targ_selvecs="go32stubbedcoff_vec i386aout_vec"
     
    326411    targ_defvec=i386coff_vec
    327412    ;;
    328   i[3456]86*-*-rtems*)
     413  i[3456]86*-*-rtemscoff*)
    329414    targ_defvec=i386coff_vec
    330415    targ_selvecs="bfd_elf32_i386_vec i386aout_vec"
     416    ;;
     417  i[3456]86-*-rtemself* | i[3456]86-*-rtems*)
     418    targ_defvec=bfd_elf32_i386_vec
     419    targ_selvecs="i386coff_vec i386aout_vec"
     420    ;;
     421  i[3456]86-*-darwin* | i[3456]86-*-macos10* | i[3456]86-*-rhapsody*)
     422    targ_defvec=mach_o_le_vec
     423    targ_selvecs="mach_o_le_vec mach_o_be_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec"
     424    targ_archs="bfd_i386_arch bfd_powerpc_arch bfd_rs6000_arch"
    331425    ;;
    332426 i[3456]86-sequent-bsd*)
     
    345439    ;;
    346440  i[3456]86-*-freebsd*)
    347     targ_defvec=bfd_elf32_i386_vec
     441    targ_defvec=bfd_elf32_i386_freebsd_vec
    348442    targ_selvecs=i386coff_vec
     443    # FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling.
     444    case "${targ}" in
     445      i[3456]86-*-freebsd3* | i[3456]86-*-freebsd4 | i[3456]86-*-freebsd4.0*)
     446        targ_cflags=-DOLD_FREEBSD_ABI_LABEL ;;
     447    esac
    349448    ;;
    350449  i[3456]86-*-netbsdelf*)
     
    352451    targ_selvecs=i386netbsd_vec
    353452    ;;
     453  i[3456]86-*-netbsdpe*)
     454    targ_defvec=i386pe_vec
     455    targ_selvecs="i386pe_vec i386pei_vec bfd_elf32_i386_vec"
     456    ;;
    354457  i[3456]86-*-netbsdaout* | i[3456]86-*-netbsd* | i[3456]86-*-openbsd*)
    355458    targ_defvec=i386netbsd_vec
     
    369472    targ_defvec=bfd_elf32_i386_vec
    370473    targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
    371     ;;
    372 #ifdef BFD64   
     474    targ64_selvecs=bfd_elf64_x86_64_vec
     475    ;;
     476#ifdef BFD64
    373477  x86_64-*-freebsd*)
    374478    targ_defvec=bfd_elf64_x86_64_vec
    375479    targ_selvecs="bfd_elf32_i386_vec i386coff_vec bfd_efi_app_ia32_vec"
     480    ;;
     481  x86_64-*-netbsd*)
     482    targ_defvec=bfd_elf64_x86_64_vec
     483    targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
    376484    ;;
    377485  x86_64-*-linux-gnu*)
     
    465573    targ_defvec=bfd_elf32_i960_vec
    466574    targ_selvecs="icoff_little_vec icoff_big_vec"
     575    ;;
     576
     577  ip2k-*-elf)
     578    targ_defvec=bfd_elf32_ip2k_vec
     579    ;;
     580
     581  iq2000-*-elf)
     582    targ_defvec=bfd_elf32_iq2000_vec
    467583    ;;
    468584
     
    502618    targ_underscore=yes
    503619    ;;
     620  m68*-*-rtemscoff*)
     621    targ_defvec=m68kcoff_vec
     622    targ_selvecs="m68kcoff_vec versados_vec ieee_vec aout0_big_vec"
     623    ;;
    504624  m68*-*-elf* | m68*-*-sysv4*)
    505625    targ_defvec=bfd_elf32_m68k_vec
     
    507627    ;;
    508628  m68*-*-rtems*)
    509     targ_defvec=m68kcoff_vec
     629    targ_defvec=bfd_elf32_m68k_vec
    510630    targ_selvecs="m68kcoff_vec versados_vec ieee_vec aout0_big_vec"
    511631    ;;
     
    541661    targ_underscore=yes
    542662    ;;
    543   m68*-*-netbsd* | m68*-*-openbsd*)
     663  m68*-*-netbsdelf*)
     664    targ_defvec=bfd_elf32_m68k_vec
     665    targ_selvecs="m68knetbsd_vec m68k4knetbsd_vec hp300bsd_vec sunos_big_vec"
     666    ;;
     667  m68*-*-netbsdaout* | m68*-*-netbsd*)
     668    targ_defvec=m68knetbsd_vec
     669    targ_selvecs="m68k4knetbsd_vec bfd_elf32_m68k_vec hp300bsd_vec sunos_big_vec"
     670    targ_underscore=yes
     671    ;;
     672  m68*-*-openbsd*)
    544673    targ_defvec=m68knetbsd_vec
    545674    targ_selvecs="m68k4knetbsd_vec hp300bsd_vec sunos_big_vec"
     
    595724    targ_selvecs=ecoff_little_vec
    596725    ;;
    597   mips-dec-netbsd* | mips*el*-*-netbsd*)
     726  mips*el-*-netbsd*)
    598727    targ_defvec=bfd_elf32_littlemips_vec
    599     targ_selvecs="bfd_elf32_bigmips_vec ecoff_little_vec ecoff_big_vec"
    600     ;;
    601  mips*-*-netbsd*)
     728    targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_little_vec ecoff_big_vec"
     729    ;;
     730  mips*-*-netbsd*)
    602731    targ_defvec=bfd_elf32_bigmips_vec
    603     targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec"
    604     ;;
    605   mips*-dec-bsd*)
    606     targ_defvec=aout_mips_little_vec
    607     targ_underscore=yes
     732    targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec"
    608733    ;;
    609734  mips*-dec-mach3*)
     
    619744    targ_selvecs=ecoff_little_vec
    620745    ;;
     746#ifdef BFD64
    621747  mips*-*-irix6*)
    622     targ_defvec=bfd_elf32_bigmips_vec
    623     targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
    624     ;;
     748    targ_defvec=bfd_elf32_nbigmips_vec
     749    targ_selvecs="bfd_elf32_nlittlemips_vec bfd_elf32_bigmips_vec bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
     750    ;;
     751#endif
    625752  mips*-*-irix5*)
    626753    targ_defvec=bfd_elf32_bigmips_vec
     
    639766    targ_cflags=-DSTAT_FOR_EXEC
    640767    ;;
    641   mips*-*-pe*)
    642     targ_defvec=mipslpe_vec
    643     targ_selvecs="mipslpei_vec mipslpei_vec ecoff_little_vec ecoff_big_vec"
    644     targ_underscore=yes
    645     ;;
    646768  mips*-*-sysv4*)
    647769    targ_defvec=bfd_elf32_tradbigmips_vec
     
    664786    targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
    665787    ;;
    666   mips*el*-*-openbsd*)
     788  mips*el-*-openbsd*)
    667789    targ_defvec=bfd_elf32_littlemips_vec
    668790    targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_little_vec ecoff_big_vec"
    669     ;;
    670   mips*el*-*-linux-gnu*)
    671     targ_defvec=bfd_elf32_tradlittlemips_vec
    672     targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec ecoff_little_vec ecoff_big_vec"
    673791    ;;
    674792  mips*-*-openbsd*)
     
    676794    targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec"
    677795    ;;
    678   mips*-*-linux-gnu*)
     796#ifdef BFD64
     797  mips64*el-*-linux*)
     798    targ_defvec=bfd_elf32_ntradlittlemips_vec
     799    targ_selvecs="bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec"
     800    ;;
     801  mips64*-*-linux*)
     802    targ_defvec=bfd_elf32_ntradbigmips_vec
     803    targ_selvecs="bfd_elf32_ntradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec"
     804    ;;
     805#endif
     806  mips*el-*-linux*)
     807    targ_defvec=bfd_elf32_tradlittlemips_vec
     808    targ_selvecs="bfd_elf32_tradbigmips_vec ecoff_little_vec ecoff_big_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf64_tradbigmips_vec"
     809    want64=true
     810    ;;
     811  mips*-*-linux*)
    679812    targ_defvec=bfd_elf32_tradbigmips_vec
    680     targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec"
    681     ;;
    682 
     813    targ_selvecs="bfd_elf32_tradlittlemips_vec ecoff_big_vec ecoff_little_vec bfd_elf32_ntradbigmips_vec bfd_elf64_tradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradlittlemips_vec"
     814    want64=true
     815    ;;
     816#ifdef BFD64
     817  mmix-*-*)
     818    targ_defvec=bfd_elf64_mmix_vec
     819    targ_selvecs=bfd_mmo_vec
     820    ;;
     821#endif
    683822  mn10200-*-*)
    684823    targ_defvec=bfd_elf32_mn10200_vec
     
    689828    ;;
    690829
     830  msp430-*-*)
     831    targ_defvec=bfd_elf32_msp430_vec
     832    ;;
     833
    691834  ns32k-pc532-mach* | ns32k-pc532-ux*)
    692835    targ_defvec=pc532machaout_vec
     
    695838  ns32k-*-netbsd* | ns32k-*-lites* | ns32k-*-openbsd*)
    696839    targ_defvec=pc532netbsd_vec
     840    targ_underscore=yes
     841    ;;
     842
     843  openrisc-*-elf)
     844    targ_defvec=bfd_elf32_openrisc_vec
     845    ;;
     846
     847  or32-*-coff | or32-*-rtems*)
     848    targ_defvec=or32coff_big_vec
     849    targ_underscore=yes
     850    ;;
     851
     852  or32-*-elf)
     853    targ_defvec=bfd_elf32_or32_big_vec
     854    ;;
     855
     856  pdp11-*-*)
     857    targ_defvec=pdp11_aout_vec
    697858    targ_underscore=yes
    698859    ;;
     
    708869    ;;
    709870
    710   powerpc-*-aix* | powerpc-*-beos*)
     871  powerpc-*-aix5*)
    711872    targ_defvec=rs6000coff_vec
    712     targ_selvecs="rs6000coff64_vec"
    713     ;;
     873    targ_selvecs="aix5coff64_vec"
     874    want64=true
     875    ;;
     876#ifdef BFD64
     877  powerpc64-*-aix5*)
     878    targ_defvec=aix5coff64_vec
     879    targ_selvecs="rs6000coff_vec"
     880    want64=true
     881    ;;
     882#endif
     883
     884  powerpc-*-aix* | powerpc-*-beos* | rs6000-*-*)
     885    targ_defvec=rs6000coff_vec
     886    targ64_selvecs=rs6000coff64_vec
     887    case "${targ}" in
     888        *-*-aix4.[3456789]* | *-*-aix[56789]*)
     889        want64=true;;
     890       
     891        *)
     892        targ_cflags=-DSMALL_ARCHIVE;;
     893    esac
     894    ;;
     895#ifdef BFD64
     896  powerpc64-*-aix*)
     897    targ_defvec=rs6000coff64_vec
     898    targ_selvecs=rs6000coff_vec
     899    ;;
     900  powerpc64-*-elf* | powerpc-*-elf64* | powerpc64-*-linux* | \
     901  powerpc64-*-*bsd*)
     902    targ_defvec=bfd_elf64_powerpc_vec
     903    targ_selvecs="bfd_elf64_powerpcle_vec bfd_elf32_powerpc_vec bfd_elf32_powerpcle_vec rs6000coff_vec rs6000coff64_vec"
     904    ;;
     905  powerpc64le-*-elf* | powerpcle-*-elf64*)
     906    targ_defvec=bfd_elf64_powerpcle_vec
     907    targ_selvecs="bfd_elf64_powerpc_vec bfd_elf32_powerpcle_vec bfd_elf32_powerpc_vec rs6000coff_vec rs6000coff64_vec"
     908    ;;
     909#endif
    714910  powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
    715911  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
    716   powerpc-*-chorus* | powerpc-*-vxworks*)
     912  powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
    717913    targ_defvec=bfd_elf32_powerpc_vec
    718914    targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
     915    targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
     916    ;;
     917  powerpc-*-kaos*)
     918    targ_defvec=bfd_elf32_powerpc_vec
     919    targ_selvecs="bfd_elf32_powerpcle_vec ppcboot_vec"
     920    targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
     921    ;;
     922  powerpc-*-darwin* | powerpc-*-macos10* | powerpc-*-rhapsody*)
     923    targ_defvec=mach_o_be_vec
     924    targ_selvecs="mach_o_be_vec mach_o_le_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec"
     925    targ_archs="bfd_powerpc_arch bfd_rs6000_arch bfd_i386_arch"
    719926    ;;
    720927  powerpc-*-macos* | powerpc-*-mpw*)
     
    724931    targ_defvec=bfd_elf32_powerpc_vec
    725932    targ_selvecs="nlm32_powerpc_vec rs6000coff_vec"
     933    ;;
     934  powerpc-*-nto*)
     935    targ_defvec=bfd_elf32_powerpc_vec
     936    targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
     937    ;;
     938  powerpcle-*-nto*)
     939    targ_defvec=bfd_elf32_powerpcle_vec
     940    targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
    726941    ;;
    727942  powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
     
    730945    targ_defvec=bfd_elf32_powerpcle_vec
    731946    targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
     947    targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
    732948    ;;
    733949
     
    737953    ;;
    738954
    739   rs6000-*-*)
    740     targ_defvec=rs6000coff_vec
    741     ;;
     955  s390-*-linux*)
     956    targ_defvec=bfd_elf32_s390_vec
     957    targ64_selvecs=bfd_elf64_s390_vec
     958    ;;
     959#ifdef BFD64
     960  s390x-*-linux*)
     961    targ_defvec=bfd_elf64_s390_vec
     962    targ_selvecs=bfd_elf32_s390_vec
     963    ;;
     964#endif
     965
     966#ifdef BFD64
     967  sh64l*-*-elf*)
     968    targ_defvec=bfd_elf32_sh64l_vec
     969    targ_selvecs="bfd_elf32_sh64_vec bfd_elf64_sh64l_vec bfd_elf64_sh64_vec bfd_elf32_shl_vec bfd_elf32_sh_vec"
     970    targ_underscore=yes
     971    ;;
     972  sh64-*-elf*)
     973    targ_defvec=bfd_elf32_sh64_vec
     974    targ_selvecs="bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec bfd_elf32_sh_vec bfd_elf32_shl_vec"
     975    targ_underscore=yes
     976    ;;
     977  sh64eb-*-linux*)
     978    targ_defvec=bfd_elf32_sh64blin_vec
     979    targ_selvecs="bfd_elf32_sh64lin_vec bfd_elf64_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf32_shblin_vec bfd_elf32_shlin_vec"
     980    ;;
     981  sh64-*-linux*)
     982    targ_defvec=bfd_elf32_sh64lin_vec
     983    targ_selvecs="bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec bfd_elf32_shlin_vec bfd_elf32_shblin_vec"
     984    ;;
     985#endif /* BFD64 */
    742986
    743987  sh-*-linux*)
    744988    targ_defvec=bfd_elf32_shblin_vec
    745989    targ_selvecs=bfd_elf32_shlin_vec
    746     ;;
    747 
    748   sh-*-elf* | sh-*-rtemself*)
     990#ifdef BFD64
     991    targ_selvecs="${targ_selvecs} bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec"
     992#endif
     993    ;;
     994  sh*eb-*-linux*)
     995    targ_defvec=bfd_elf32_shblin_vec
     996    targ_selvecs=bfd_elf32_shlin_vec
     997    ;;
     998  sh*-*-linux*)
     999    targ_defvec=bfd_elf32_shlin_vec
     1000    targ_selvecs=bfd_elf32_shblin_vec
     1001    ;;
     1002
     1003#ifdef BFD64
     1004  sh5le-*-netbsd*)
     1005    targ_defvec=bfd_elf32_sh64lnbsd_vec
     1006    targ_selvecs="bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec"
     1007    ;;
     1008  sh5-*-netbsd*)
     1009    targ_defvec=bfd_elf32_sh64nbsd_vec
     1010    targ_selvecs="bfd_elf32_sh64lnbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec"
     1011    ;;
     1012
     1013  sh64le-*-netbsd*)
     1014    targ_defvec=bfd_elf64_sh64lnbsd_vec
     1015    targ_selvecs="bfd_elf64_sh64nbsd_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec"
     1016    ;;
     1017  sh64-*-netbsd*)
     1018    targ_defvec=bfd_elf64_sh64nbsd_vec
     1019    targ_selvecs="bfd_elf64_sh64lnbsd_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec"
     1020    ;;
     1021#endif
     1022
     1023  shle-*-netbsdelf*)
     1024    targ_defvec=bfd_elf32_shlnbsd_vec
     1025    targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec"
     1026#ifdef BFD64
     1027    targ_selvecs="${targ_selvecs} bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec"
     1028#endif
     1029    ;;
     1030  sh*le-*-netbsdelf*)
     1031    targ_defvec=bfd_elf32_shlnbsd_vec
     1032    targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec"
     1033    ;;
     1034  sh-*-netbsdelf*)
     1035    targ_defvec=bfd_elf32_shnbsd_vec
     1036    targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec"
     1037#ifdef BFD64
     1038    targ_selvecs="${targ_selvecs} bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec"
     1039#endif
     1040    ;;
     1041  sh*-*-netbsdelf*)
     1042    targ_defvec=bfd_elf32_shnbsd_vec
     1043    targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec"
     1044    ;;
     1045
     1046  shl*-*-elf* | sh[1234]l*-*-elf* | sh3el*-*-elf* | shl*-*-kaos*)
     1047    targ_defvec=bfd_elf32_shl_vec
     1048    targ_selvecs="bfd_elf32_sh_vec shlcoff_vec shcoff_vec shlcoff_small_vec shcoff_small_vec"
     1049#ifdef BFD64
     1050    targ_selvecs="${targ_selvecs} bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec"
     1051#endif
     1052    targ_underscore=yes
     1053    ;;
     1054  sh-*-elf* | sh[1234]*-elf* | sh-*-rtemself* | sh-*-kaos*)
     1055    targ_defvec=bfd_elf32_sh_vec
     1056    targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
     1057#ifdef BFD64
     1058    targ_selvecs="${targ_selvecs} bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec"
     1059#endif
     1060    targ_underscore=yes
     1061    ;;
     1062  sh-*-nto*)
    7491063    targ_defvec=bfd_elf32_sh_vec
    7501064    targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
     
    8731187    targ_defvec=bfd_elf32_v850_vec
    8741188    ;;
    875 #if HAVE_host_aout_vec
     1189
     1190  vax-*-netbsdelf*)
     1191    targ_defvec=bfd_elf32_vax_vec
     1192    targ_selvecs="vaxnetbsd_vec vax1knetbsd_vec"
     1193    ;;
     1194
     1195  vax-*-netbsdaout* | vax-*-netbsd*)
     1196    targ_defvec=vaxnetbsd_vec
     1197    targ_selvecs="bfd_elf32_vax_vec vax1knetbsd_vec"
     1198    targ_underscore=yes
     1199    ;;
     1200
    8761201  vax-*-bsd* | vax-*-ultrix*)
    877     targ_defvec=host_aout_vec
    878     targ_underscore=yes
    879     ;;
    880 #endif
     1202    targ_defvec=vaxbsd_vec
     1203    targ_underscore=yes
     1204    ;;
    8811205
    8821206  vax*-*-*vms*)
     
    8901214  w65-*-*)
    8911215    targ_defvec=w65_vec
     1216    ;;
     1217
     1218  xstormy16-*-elf)
     1219    targ_defvec=bfd_elf32_xstormy16_vec
     1220    ;;
     1221
     1222  xtensa-*-*)
     1223    targ_defvec=bfd_elf32_xtensa_le_vec
     1224    targ_selvecs=bfd_elf32_xtensa_be_vec
    8921225    ;;
    8931226
     
    9301263esac
    9311264
     1265case "${host64}${want64}" in
     1266  *true*)
     1267    targ_selvecs="${targ_selvecs} ${targ64_selvecs}"
     1268    ;;
     1269esac
     1270
    9321271# If we support any ELF target, then automatically add support for the
    9331272# generic ELF targets.  This permits an objdump with some ELF support
     
    9351274# relocation information.
    9361275case "${targ_defvec} ${targ_selvecs}" in
    937   *bfd_elf64*)
     1276  *bfd_elf64* | *bfd_elf32_n*mips*)
    9381277    targ_selvecs="${targ_selvecs} bfd_elf64_little_generic_vec bfd_elf64_big_generic_vec bfd_elf32_little_generic_vec bfd_elf32_big_generic_vec"
    9391278    ;;
  • trunk/src/binutils/bfd/configure.in

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r617 r618  
    88AC_ISC_POSIX
    99
    10 AM_INIT_AUTOMAKE(bfd, 2.11.2)
     10AM_INIT_AUTOMAKE(bfd, 2.14)
     11# Uncomment the next line to remove the date from the reported bfd version
     12#is_release=y
     13
     14changequote(,)dnl
     15bfd_version=`echo "${VERSION}" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$/\1\2\3\4\5/'`
     16changequote([,])dnl
     17
     18bfd_version_string="\"${VERSION}\""
     19if test x${is_release} = x; then
     20  bfd_version_date=`sed -n -e 's/.*DATE //p' < ${srcdir}/version.h`
     21  bfd_version_string="\"${VERSION} ${bfd_version_date}\""
     22fi
     23AC_SUBST(bfd_version)
     24AC_SUBST(bfd_version_string)
    1125
    1226dnl These must be called before AM_PROG_LIBTOOL, because it may want
     
    5165esac],[want_mmap=false])dnl
    5266
    53 build_warnings="-W -Wall"
     67build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
    5468AC_ARG_ENABLE(build-warnings,
    5569[  --enable-build-warnings Enable build-time compiler warnings if gcc is used],
     
    6781fi])dnl
    6882WARN_CFLAGS=""
    69 if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
     83if test "x${build_warnings}" != x && test "x$GCC" = xyes ; then
    7084    WARN_CFLAGS="${build_warnings}"
    7185fi
     
    7791    AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
    7892fi
    79 AC_ARG_PROGRAM
    8093
    8194AM_MAINTAINER_MODE
     95AM_INSTALL_LIBBFD
    8296AC_EXEEXT
    8397
    8498host64=false
    8599target64=false
     100bfd_default_target_size=32
    86101
    87102# host stuff:
     
    89104AC_PROG_CC
    90105
    91 ALL_LINGUAS=
     106ALL_LINGUAS="fr tr ja es sv da zh_CN"
    92107CY_GNU_GETTEXT
    93108
     
    143158        TRAD_HEADER='"hosts/alphalinux.h"'
    144159        ;;
    145   alpha*-*-netbsd*)     COREFILE=netbsd-core.lo ;;
     160  alpha*-*-netbsd* | alpha*-*-openbsd*)
     161        COREFILE=netbsd-core.lo
     162        ;;
    146163  alpha*-*-*)           COREFILE=osf-core.lo ;;
    147164  arm-*-freebsd*)       COREFILE='' ;;
     165  arm-*-netbsd*)        COREFILE=netbsd-core.lo ;;
    148166  arm-*-riscix)         COREFILE=trad-core.lo ;;
    149167  hppa*-*-hpux*)        COREFILE=hpux-core.lo ;;
     
    152170  hppa*-*-bsd*)         COREFILE="hpux-core.lo hppabsd-core.lo"
    153171                        COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
    154   i370-*-*)             
     172  i370-*-*)
    155173        COREFILE=trad-core.lo
    156174        TRAD_HEADER='"hosts/i370linux.h"'
     
    171189        ;;
    172190changequote(,)dnl
    173   i[3456]86-*-bsd* | i[34567]86-*-freebsd[1234] | i[34567]86-*-freebsd[1234]\.* | i[34567]86-*-freebsd*aout*)
     191  i[3456]86-*-bsdi)
     192changequote([,])dnl
     193        COREFILE=
     194        ;;
     195changequote(,)dnl
     196  i[3456]86-*-bsd* | i[34567]86-*-freebsd[123] | i[34567]86-*-freebsd[123]\.* | i[34567]86-*-freebsd4\.[01234]* | i[34567]86-*-freebsd*aout*)
    174197changequote([,])dnl
    175198        COREFILE=trad-core.lo
     
    287310        TRAD_HEADER='"hosts/m68kaux.h"'
    288311        ;;
    289   m88*-*-sysv4*)        ;;
    290   m88*-motorola-sysv*)  COREFILE=ptrace-core.lo ;;
     312  m88*-*-sysv4*)
     313        ;;
     314  m88*-motorola-sysv*)
     315        COREFILE=ptrace-core.lo
     316        ;;
    291317  m88*-*-mach3*)
    292318        COREFILE=trad-core.lo
     
    300326        COREFILE=netbsd-core.lo
    301327        ;;
    302   rs6000-*-lynx*)       COREFILE=lynx-core.lo ;;
     328  rs6000-*-lynx*)
     329        COREFILE=lynx-core.lo
     330        ;;
     331  rs6000-*-aix5.* | powerpc-*-aix5.*)
     332        COREFILE=rs6000-core.lo
     333        COREFLAG="$COREFLAG -DAIX_5_CORE -DAIX_CORE_DUMPX_CORE"
     334        ;;
    303335changequote(,)dnl
    304336  rs6000-*-aix4.[3-9]* | powerpc-*-aix4.[3-9]*)
     
    306338        COREFILE=rs6000-core.lo
    307339        COREFLAG="$COREFLAG -DAIX_CORE_DUMPX_CORE"
     340        # Not all versions of AIX with -DAIX_CORE_DUMPX_CORE
     341        # have c_impl as a member of struct core_dumpx
     342        AC_MSG_CHECKING([for c_impl in struct core_dumpx])
     343        AC_TRY_COMPILE([#include <core.h>],
     344          [struct core_dumpx c; c.c_impl = 0;],
     345          [AC_DEFINE(HAVE_ST_C_IMPL, 1,
     346            [Define if struct core_dumpx has member c_impl])
     347          AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
    308348        ;;
    309349  rs6000-*-aix4*)       COREFILE=rs6000-core.lo ;;
     
    315355  powerpc-*-netbsd*)    COREFILE=netbsd-core.lo ;;
    316356  powerpc-*-*bsd*)      COREFILE=netbsd-core.lo ;;
    317   sparc-*-netbsd* | sparc-*-openbsd*)
     357  s390*-*-*)            COREFILE=trad-core.lo ;;
     358  sh*-*-netbsd*)        COREFILE=netbsd-core.lo ;;
     359  sparc-*-netbsd* | sparc*-*-openbsd*)
    318360        COREFILE=netbsd-core.lo
    319361        ;;
     
    322364        TRAD_HEADER='"hosts/tahoe.h"'
    323365        ;;
     366  vax-*-netbsd*)        COREFILE=netbsd-core.lo ;;
    324367  vax-*-ultrix2*)
    325368        COREFILE=trad-core.lo
     
    334377        TRAD_HEADER='"hosts/vaxbsd.h"'
    335378        ;;
     379  x86_64-*-netbsd*)     COREFILE=netbsd-core.lo ;;
    336380  esac
    337381
     
    395439  fi
    396440  ;;
     441*-*-linux*)
     442  # We borrow WIN32LIBADD so that the shared libbfd won't depend on
     443  # libiberty.a.
     444  case "${host}" in
     445  mips*-*-linux*)
     446    # Linux/MIPS uses PIC by default.
     447    if test "$enable_shared" = "yes"; then
     448      WIN32LIBADD="-L../libiberty -liberty"
     449    fi
     450    ;;
     451  *)
     452changequote(,)dnl
     453    x=`sed -n -e 's/^[  ]*PICFLAG[      ]*=[    ]*//p' < ../libiberty/Makefile | sed -n '$p'`
     454changequote([,])dnl
     455    if test -n "$x"; then
     456      WIN32LIBADD="-L../libiberty/pic -liberty"
     457    fi
     458  ;;
     459  esac
     460  ;;
    397461esac
    398462AC_SUBST(WIN32LDFLAGS)
     
    418482defvec=
    419483selvecs=
     484assocvecs=
    420485selarchs=
    421486TDEFINES=
     
    424489    if test "x$targ" = "xall"; then
    425490        all_targets=true
     491        assocvecs="$assocvecs $targ_defvec $targ_selvecs"
    426492    else
    427493        . $srcdir/config.bfd
     
    454520
    455521
     522# uniq the associated vectors in all the configured targets.
     523f=""
     524for i in $assocvecs ; do
     525    case " $f " in
     526    *" $i "*) ;;
     527    *) f="$f $i" ;;
     528    esac
     529done
     530assocvecs="$f"
     531
     532
    456533# uniq the architectures in all the configured targets.
    457534f=""
     
    467544tb=
    468545
    469 elf="elf.lo elflink.lo dwarf1.lo"
     546elf="elf.lo elflink.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo"
    470547
    471548for vec in $selvecs
    472549do
     550    target_size=32
    473551    case "$vec" in
    474552    # This list is alphabetized to make it easy to compare
    475     # with the two vector lists in targets.c.
     553    # with the two vector lists in targets.c.  For the same reason,
     554    # use one entry per line, even though this leads to long lines.
    476555    a29kcoff_big_vec)           tb="$tb coff-a29k.lo cofflink.lo" ;;
    477556    a_out_adobe_vec)            tb="$tb aout-adobe.lo aout32.lo" ;;
    478     armcoff_little_vec)         tb="$tb coff-arm.lo cofflink.lo " ;;
    479     armcoff_big_vec)            tb="$tb coff-arm.lo cofflink.lo " ;;
    480     armnetbsd_vec)              tb="$tb armnetbsd.lo aout32.lo" ;;
    481     armpe_little_vec)           tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
    482     armpe_big_vec)              tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
    483     armpei_little_vec)          tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
    484     armpei_big_vec)             tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
    485     arm_epoc_pe_little_vec)     tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
    486     arm_epoc_pe_big_vec)        tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
    487     arm_epoc_pei_little_vec)    tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
    488     arm_epoc_pei_big_vec)       tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
     557    aix5coff64_vec)             tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;;
    489558    aout0_big_vec)              tb="$tb aout0.lo aout32.lo" ;;
    490559    aout_arm_big_vec)           tb="$tb aout-arm.lo aout32.lo" ;;
     
    493562    aout_mips_little_vec)       tb="$tb mipsbsd.lo aout32.lo" ;;
    494563    apollocoff_vec)             tb="$tb coff-apollo.lo" ;;
     564    arm_epoc_pe_big_vec)        tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
     565    arm_epoc_pe_little_vec)     tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
     566    arm_epoc_pei_big_vec)       tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
     567    arm_epoc_pei_little_vec)    tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
     568    armcoff_big_vec)            tb="$tb coff-arm.lo cofflink.lo " ;;
     569    armcoff_little_vec)         tb="$tb coff-arm.lo cofflink.lo " ;;
     570    armnetbsd_vec)              tb="$tb armnetbsd.lo aout32.lo" ;;
     571    armpe_big_vec)              tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
     572    armpe_little_vec)           tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
     573    armpei_big_vec)             tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
     574    armpei_little_vec)          tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
    495575    b_out_vec_big_host)         tb="$tb bout.lo aout32.lo" ;;
    496576    b_out_vec_little_host)      tb="$tb bout.lo aout32.lo" ;;
    497577    bfd_efi_app_ia32_vec)       tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;;
    498     bfd_efi_app_ia64_vec)       tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo"
    499                                 target64=true ;;
    500     bfd_elf64_alpha_vec)        tb="$tb elf64-alpha.lo elf64.lo $elf"
    501                                 target64=true ;;
    502     bfd_elf64_hppa_vec | bfd_elf64_hppa_linux_vec)
    503                                 tb="$tb elf64-hppa.lo elf64.lo $elf"
    504                                 target64=true ;;
    505     bfd_elf64_ia64_little_vec)  tb="$tb elf64-ia64.lo elf64.lo $elf"
    506                                 target64=true ;;
    507     bfd_elf64_ia64_big_vec)     tb="$tb elf64-ia64.lo elf64.lo $elf"
    508                                 target64=true ;;
    509     bfd_elf32_ia64_big_vec)     tb="$tb elf32-ia64.lo elf32.lo $elf" ;;
     578    bfd_efi_app_ia64_vec)       tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;;
    510579    bfd_elf32_avr_vec)          tb="$tb elf32-avr.lo elf32.lo $elf" ;;
    511     bfd_elf32_littlearc_vec)    tb="$tb elf32-arc.lo elf32.lo $elf" ;;
    512     bfd_elf32_littlearm_vec)    tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
    513     bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
     580    bfd_elf32_big_generic_vec)  tb="$tb elf32-gen.lo elf32.lo $elf" ;;
    514581    bfd_elf32_bigarc_vec)       tb="$tb elf32-arc.lo elf32.lo $elf" ;;
     582    bfd_elf32_bigarm_oabi_vec)  tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
    515583    bfd_elf32_bigarm_vec)       tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
    516     bfd_elf32_bigarm_oabi_vec)  tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
    517     bfd_elf32_big_generic_vec)  tb="$tb elf32-gen.lo elf32.lo $elf" ;;
    518     bfd_elf32_bigmips_vec)      tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
    519     bfd_elf64_bigmips_vec)      tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
    520                                 target64=true ;;
     584    bfd_elf32_bigmips_vec)      tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
    521585    bfd_elf32_cris_vec)         tb="$tb elf32-cris.lo elf32.lo $elf" ;;
    522     bfd_elf32_us_cris_vec)      tb="$tb elf32-cris.lo elf32.lo $elf" ;;
    523586    bfd_elf32_d10v_vec)         tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
    524587    bfd_elf32_d30v_vec)         tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
     588    bfd_elf32_dlx_big_vec)      tb="$tb elf32-dlx.lo elf32.lo $elf" ;;
    525589    bfd_elf32_fr30_vec)         tb="$tb elf32-fr30.lo elf32.lo $elf" ;;
    526     bfd_elf32_hppa_vec | bfd_elf32_hppa_linux_vec)
    527                                 tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
     590    bfd_elf32_frv_vec)          tb="$tb elf32-frv.lo elf32.lo $elf" ;;
     591    bfd_elf32_h8300_vec)        tb="$tb elf32-h8300.lo elf32.lo $elf" ;;
     592    bfd_elf32_hppa_linux_vec)   tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
     593    bfd_elf32_hppa_vec)         tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
    528594    bfd_elf32_i370_vec)         tb="$tb elf32-i370.lo elf32.lo $elf" ;;
     595    bfd_elf32_i386_freebsd_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;;
    529596    bfd_elf32_i386_vec)         tb="$tb elf32-i386.lo elf32.lo $elf" ;;
    530     bfd_elf64_x86_64_vec)       tb="$tb elf64-x86-64.lo elf64.lo $elf"
    531                                 target64=true ;;
     597    bfd_elf32_i860_little_vec)  tb="$tb elf32-i860.lo elf32.lo $elf" ;;
    532598    bfd_elf32_i860_vec)         tb="$tb elf32-i860.lo elf32.lo $elf" ;;
    533     bfd_elf32_i860_little_vec)  tb="$tb elf32-i860.lo elf32.lo $elf" ;;
    534599    bfd_elf32_i960_vec)         tb="$tb elf32-i960.lo elf32.lo $elf" ;;
     600    bfd_elf32_ia64_big_vec)     tb="$tb elf32-ia64.lo elf32.lo $elf" ;;
     601    bfd_elf32_ia64_hpux_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf";;
     602    bfd_elf32_ip2k_vec)         tb="$tb elf32-ip2k.lo elf32.lo $elf" ;;
     603    bfd_elf32_iq2000_vec)       tb="$tb elf32-iq2000.lo elf32.lo $elf" ;;
    535604    bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
    536     bfd_elf32_littlemips_vec)   tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
    537     bfd_elf64_littlemips_vec)   tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
    538                                 target64=true ;;
     605    bfd_elf32_littlearc_vec)    tb="$tb elf32-arc.lo elf32.lo $elf" ;;
     606    bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
     607    bfd_elf32_littlearm_vec)    tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
     608    bfd_elf32_littlemips_vec)   tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
    539609    bfd_elf32_m32r_vec)         tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
    540     bfd_elf32_m68hc11_vec)      tb="$tb elf32-m68hc11.lo elf32.lo $elf" ;;
    541     bfd_elf32_m68hc12_vec)      tb="$tb elf32-m68hc12.lo elf32.lo $elf" ;;
     610    bfd_elf32_m68hc11_vec)      tb="$tb elf32-m68hc11.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
     611    bfd_elf32_m68hc12_vec)      tb="$tb elf32-m68hc12.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
    542612    bfd_elf32_m68k_vec)         tb="$tb elf32-m68k.lo elf32.lo $elf" ;;
    543613    bfd_elf32_m88k_vec)         tb="$tb elf32-m88k.lo elf32.lo $elf" ;;
     
    546616    bfd_elf32_mn10200_vec)      tb="$tb elf-m10200.lo elf32.lo $elf" ;;
    547617    bfd_elf32_mn10300_vec)      tb="$tb elf-m10300.lo elf32.lo $elf" ;;
     618    bfd_elf32_msp430_vec)       tb="$tb elf32-msp430.lo elf32.lo $elf" ;;
     619    bfd_elf32_nbigmips_vec)     tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
     620    bfd_elf32_nlittlemips_vec)  tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
     621    bfd_elf32_ntradbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
     622    bfd_elf32_ntradlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
     623    bfd_elf32_openrisc_vec)     tb="$tb elf32-openrisc.lo elf32.lo $elf" ;;
     624    bfd_elf32_or32_big_vec)     tb="$tb elf32-or32.lo elf32.lo $elf" ;;
    548625    bfd_elf32_pj_vec)           tb="$tb elf32-pj.lo elf32.lo $elf";;
    549626    bfd_elf32_pjl_vec)          tb="$tb elf32-pj.lo elf32.lo $elf";;
    550627    bfd_elf32_powerpc_vec)      tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
    551628    bfd_elf32_powerpcle_vec)    tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
     629    bfd_elf32_s390_vec)         tb="$tb elf32-s390.lo elf32.lo $elf" ;;
     630    # FIXME: We include cofflink.lo not because it's needed for
     631    # bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec
     632    # which needs it but does not list it.  Should be fixed in right place.
     633    bfd_elf32_sh64_vec)         tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
     634    bfd_elf32_sh64l_vec)        tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
     635    bfd_elf32_sh64lin_vec)      tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
     636    bfd_elf32_sh64blin_vec)     tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
     637    bfd_elf32_sh64lnbsd_vec)    tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
     638    bfd_elf32_sh64nbsd_vec)     tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
    552639    bfd_elf32_sh_vec)           tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
     640    bfd_elf32_shblin_vec)       tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
    553641    bfd_elf32_shl_vec)          tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
    554     bfd_elf32_shlin_vec)        tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
    555     bfd_elf32_shblin_vec)       tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
     642    bfd_elf32_shlin_vec)        tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
     643    bfd_elf32_shlnbsd_vec)      tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
     644    bfd_elf32_shnbsd_vec)       tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
    556645    bfd_elf32_sparc_vec)        tb="$tb elf32-sparc.lo elf32.lo $elf" ;;
    557     bfd_elf32_tradbigmips_vec)  tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
    558     bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
     646    bfd_elf32_tradbigmips_vec)  tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
     647    bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
     648    bfd_elf32_us_cris_vec)      tb="$tb elf32-cris.lo elf32.lo $elf" ;;
    559649    bfd_elf32_v850_vec)         tb="$tb elf32-v850.lo elf32.lo $elf" ;;
    560     bfd_elf64_big_generic_vec)  tb="$tb elf64-gen.lo elf64.lo $elf"
    561                                 target64=true ;;
    562     bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"
    563                                 target64=true ;;
    564     bfd_elf64_sparc_vec)        tb="$tb elf64-sparc.lo elf64.lo $elf"
    565                                 target64=true ;;
    566     bfd_elf64_tradbigmips_vec)  tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo"
    567                                 target64=true ;;
    568     bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo"
    569                                 target64=true ;;
    570     cisco_core_big_vec)         tb="$tb cisco-core.lo" ;;
    571     cisco_core_little_vec)      tb="$tb cisco-core.lo" ;;
     650    bfd_elf32_vax_vec)          tb="$tb elf32-vax.lo elf32.lo $elf" ;;
     651    bfd_elf32_xstormy16_vec)    tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;;
     652    bfd_elf32_xtensa_le_vec)    tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;;
     653    bfd_elf32_xtensa_be_vec)    tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;;
     654    bfd_elf64_alpha_freebsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
     655    bfd_elf64_alpha_vec)        tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
     656    bfd_elf64_big_generic_vec)  tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
     657    bfd_elf64_bigmips_vec)      tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
     658    bfd_elf64_hppa_linux_vec)   tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
     659    bfd_elf64_hppa_vec)         tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
     660    bfd_elf64_ia64_aix_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
     661    bfd_elf64_ia64_aix_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
     662    bfd_elf64_ia64_big_vec)     tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
     663    bfd_elf64_ia64_hpux_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
     664    bfd_elf64_ia64_little_vec)  tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
     665    bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
     666    bfd_elf64_littlemips_vec)   tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
     667    bfd_elf64_mmix_vec)         tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;;
     668    bfd_elf64_powerpc_vec)      tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
     669    bfd_elf64_powerpcle_vec)    tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
     670    bfd_elf64_s390_vec)         tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;;
     671    bfd_elf64_sh64_vec)         tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
     672    bfd_elf64_sh64l_vec)        tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
     673    bfd_elf64_sh64lin_vec)      tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
     674    bfd_elf64_sh64blin_vec)     tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
     675    bfd_elf64_sh64lnbsd_vec)    tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
     676    bfd_elf64_sh64nbsd_vec)     tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
     677    bfd_elf64_sparc_vec)        tb="$tb elf64-sparc.lo elf64.lo $elf"; target_size=64 ;;
     678    bfd_elf64_tradbigmips_vec)  tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
     679    bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
     680    bfd_elf64_x86_64_vec)       tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;;
     681    bfd_mmo_vec)                tb="$tb mmo.lo" target_size=64 ;;
     682    bfd_powerpc_pe_vec)         tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
     683    bfd_powerpc_pei_vec)        tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
     684    bfd_powerpcle_pe_vec)       tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
     685    bfd_powerpcle_pei_vec)      tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
    572686    cris_aout_vec)              tb="$tb aout-cris.lo" ;;
    573     demo_64_vec)                tb="$tb demo64.lo aout64.lo"
    574                                 target64=true ;;
     687    demo_64_vec)                tb="$tb demo64.lo aout64.lo"; target_size=64 ;;
    575688    ecoff_big_vec)              tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
     689    ecoff_biglittle_vec)        tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
    576690    ecoff_little_vec)           tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
    577     ecoff_biglittle_vec)        tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
    578     ecoffalpha_little_vec)      tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo"
    579                                 target64=true ;;
     691    ecoffalpha_little_vec)      tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo"; target_size=64 ;;
    580692    go32coff_vec)               tb="$tb coff-go32.lo cofflink.lo" ;;
    581693    go32stubbedcoff_vec)        tb="$tb coff-stgo32.lo cofflink.lo" ;;
     
    590702    i386dynix_vec)              tb="$tb i386dynix.lo aout32.lo" ;;
    591703    i386freebsd_vec)            tb="$tb i386freebsd.lo aout32.lo" ;;
    592     i386msdos_vec)              tb="$tb i386msdos.lo" ;;
    593     i386pe_vec)                 tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;;
    594     i386pei_vec)                tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;;
    595704    i386linux_vec)              tb="$tb i386linux.lo aout32.lo" ;;
    596705    i386lynx_aout_vec)          tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;;
    597706    i386lynx_coff_vec)          tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;;
    598707    i386mach3_vec)              tb="$tb i386mach3.lo aout32.lo" ;;
     708    i386msdos_vec)              tb="$tb i386msdos.lo" ;;
    599709    i386netbsd_vec)             tb="$tb i386netbsd.lo aout32.lo" ;;
    600710    i386os9k_vec)               tb="$tb i386os9k.lo aout32.lo" ;;
    601     i386aout_emx_vec)           tb="$tb i386aoutemx.lo aout32.lo " ;;
     711    i386aout_emx_vec)   tb="$tb i386aoutemx.lo aout32.lo" ;;
     712    i386pe_vec)                 tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;;
     713    i386pei_vec)                tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;;
    602714    i860coff_vec)               tb="$tb coff-i860.lo cofflink.lo" ;;
    603715    icoff_big_vec)              tb="$tb coff-i960.lo cofflink.lo" ;;
    604716    icoff_little_vec)           tb="$tb coff-i960.lo cofflink.lo" ;;
    605717    ieee_vec)                   tb="$tb ieee.lo" ;;
     718    m68k4knetbsd_vec)           tb="$tb m68k4knetbsd.lo aout32.lo" ;;
     719    m68kaux_coff_vec)           tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;;
    606720    m68kcoff_vec)               tb="$tb coff-m68k.lo cofflink.lo" ;;
    607721    m68kcoffun_vec)             tb="$tb coff-u68k.lo coff-m68k.lo cofflink.lo" ;;
     
    610724    m68klynx_coff_vec)          tb="$tb cf-m68klynx.lo coff-m68k.lo cofflink.lo lynx-core.lo" ;;
    611725    m68knetbsd_vec)             tb="$tb m68knetbsd.lo aout32.lo" ;;
    612     m68k4knetbsd_vec)           tb="$tb m68k4knetbsd.lo aout32.lo" ;;
    613     m68kaux_coff_vec)           tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;;
    614726    m68ksysvcoff_vec)           tb="$tb coff-svm68k.lo cofflink.lo" ;;
    615727    m88kbcs_vec)                tb="$tb coff-m88k.lo" ;;
    616     mipslpe_vec)                tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;;
    617     mipslpei_vec)               tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;;
     728    m88kmach3_vec)              tb="$tb m88kmach3.lo aout32.lo" ;;
     729    mach_o_be_vec)              tb="$tb mach-o.lo" ;;
     730    mach_o_le_vec)              tb="$tb mach-o.lo" ;;
     731    mach_o_fat_vec)             tb="$tb mach-o.lo" ;;
    618732    mcore_pe_big_vec)           tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
    619733    mcore_pe_little_vec)        tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
    620734    mcore_pei_big_vec)          tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
    621735    mcore_pei_little_vec)       tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
     736    mipslpe_vec)                tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;;
     737    mipslpei_vec)               tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;;
    622738    newsos3_vec)                tb="$tb newsos3.lo aout32.lo" ;;
     739    nlm32_alpha_vec)            tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"; target_size=64 ;;
    623740    nlm32_i386_vec)             tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
    624     rs6000coff64_vec)           tb="$tb coff64-rs6000.lo xcofflink.lo"
    625                                 target64=true ;;
     741    nlm32_powerpc_vec)          tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;;
    626742    nlm32_sparc_vec)            tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
    627     nlm32_alpha_vec)            tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"
    628                                 target64=true ;;
     743    or32coff_big_vec)           tb="$tb coff-or32.lo cofflink.lo" ;;
     744    pc532machaout_vec)          tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
     745    pc532netbsd_vec)            tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;;
     746    pef_vec)                    tb="$tb pef.lo" ;;
     747    pef_xlib_vec)               tb="$tb pef.lo" ;;
     748    pdp11_aout_vec)             tb="$tb pdp11.lo" ;;
     749    pmac_xcoff_vec)             tb="$tb coff-rs6000.lo xcofflink.lo" ;;
     750    ppcboot_vec)                tb="$tb ppcboot.lo" ;;
    629751    riscix_vec)                 tb="$tb aout32.lo riscix.lo" ;;
    630     nlm32_powerpc_vec)          tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;;
    631     pc532netbsd_vec)            tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;;
    632     pc532machaout_vec)          tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
    633     pmac_xcoff_vec)             tb="$tb coff-pmac.lo xcofflink.lo" ;;
     752    rs6000coff64_vec)           tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;;
    634753    rs6000coff_vec)             tb="$tb coff-rs6000.lo xcofflink.lo" ;;
    635     bfd_powerpc_pe_vec)         tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
    636     bfd_powerpcle_pe_vec)       tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
    637     bfd_powerpc_pei_vec)        tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
    638     bfd_powerpcle_pei_vec)      tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
    639     ppcboot_vec)                tb="$tb ppcboot.lo" ;;
     754    shcoff_small_vec)           tb="$tb coff-sh.lo cofflink.lo" ;;
    640755    shcoff_vec)                 tb="$tb coff-sh.lo cofflink.lo" ;;
     756    shlcoff_small_vec)          tb="$tb coff-sh.lo cofflink.lo" ;;
    641757    shlcoff_vec)                tb="$tb coff-sh.lo cofflink.lo" ;;
    642     shcoff_small_vec)           tb="$tb coff-sh.lo cofflink.lo" ;;
    643     shlcoff_small_vec)          tb="$tb coff-sh.lo cofflink.lo" ;;
    644758    shlpe_vec)                  tb="$tb pe-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;;
    645759    shlpei_vec)                 tb="$tb pei-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;;
    646760    som_vec)                    tb="$tb som.lo" ;;
     761    sparccoff_vec)              tb="$tb coff-sparc.lo" ;;
    647762    sparcle_aout_vec)           tb="$tb aout-sparcle.lo aout32.lo" ;;
    648763    sparclinux_vec)             tb="$tb sparclinux.lo aout32.lo" ;;
     
    650765    sparclynx_coff_vec)         tb="$tb cf-sparclynx.lo lynx-core.lo" ;;
    651766    sparcnetbsd_vec)            tb="$tb sparcnetbsd.lo aout32.lo" ;;
    652     sparccoff_vec)              tb="$tb coff-sparc.lo" ;;
    653     srec_vec)                   tb="$tb srec.lo" ;;
    654767    sunos_big_vec)              tb="$tb sunos.lo aout32.lo" ;;
    655     symbolsrec_vec)             tb="$tb srec.lo" ;;
    656     tekhex_vec)                 tb="$tb tekhex.lo" ;;
     768    sym_vec)                    tb="$tb xsym.lo" ;;
    657769    tic30_aout_vec)             tb="$tb aout-tic30.lo" ;;
    658770    tic30_coff_vec)             tb="$tb coff-tic30.lo" ;;
     771    tic4x_coff0_vec)            tb="$tb coff-tic4x.lo" ;;
     772    tic4x_coff0_beh_vec)        tb="$tb coff-tic4x.lo" ;;
     773    tic4x_coff1_vec)            tb="$tb coff-tic4x.lo" ;;
     774    tic4x_coff1_beh_vec)        tb="$tb coff-tic4x.lo" ;;
     775    tic4x_coff2_vec)            tb="$tb coff-tic4x.lo" ;;
     776    tic4x_coff2_beh_vec)        tb="$tb coff-tic4x.lo" ;;
     777    tic54x_coff0_beh_vec)       tb="$tb coff-tic54x.lo" ;;
    659778    tic54x_coff0_vec)           tb="$tb coff-tic54x.lo" ;;
    660     tic54x_coff0_beh_vec)       tb="$tb coff-tic54x.lo" ;;
     779    tic54x_coff1_beh_vec)       tb="$tb coff-tic54x.lo" ;;
    661780    tic54x_coff1_vec)           tb="$tb coff-tic54x.lo" ;;
    662     tic54x_coff1_beh_vec)       tb="$tb coff-tic54x.lo" ;;
     781    tic54x_coff2_beh_vec)       tb="$tb coff-tic54x.lo" ;;
    663782    tic54x_coff2_vec)           tb="$tb coff-tic54x.lo" ;;
    664     tic54x_coff2_beh_vec)       tb="$tb coff-tic54x.lo" ;;
    665783    tic80coff_vec)              tb="$tb coff-tic80.lo cofflink.lo" ;;
     784    vaxnetbsd_vec)              tb="$tb vaxnetbsd.lo aout32.lo" ;;
     785    vax1knetbsd_vec)            tb="$tb vax1knetbsd.lo aout32.lo" ;;
     786    vaxbsd_vec)                 tb="$tb vaxbsd.lo aout32.lo" ;;
    666787    versados_vec)               tb="$tb versados.lo" ;;
    667     vms_alpha_vec)              tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo"
    668                                 target64=true ;;
     788    vms_alpha_vec)              tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo"; target_size=64 ;;
    669789    vms_vax_vec)                tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" ;;
    670790    w65_vec)                    tb="$tb coff-w65.lo reloc16.lo" ;;
     
    672792    z8kcoff_vec)                tb="$tb coff-z8k.lo reloc16.lo" ;;
    673793
     794    # These appear out of order in targets.c
     795    srec_vec)                   tb="$tb srec.lo" ;;
     796    symbolsrec_vec)             tb="$tb srec.lo" ;;
     797    tekhex_vec)                 tb="$tb tekhex.lo" ;;
     798    cisco_core_big_vec)         tb="$tb cisco-core.lo" ;;
     799    cisco_core_little_vec)      tb="$tb cisco-core.lo" ;;
     800
    674801    "")                 ;;
    675802    *) AC_MSG_ERROR(*** unknown target vector $vec) ;;
    676803    esac
     804
     805    if test ${target_size} = 64; then
     806        target64=true
     807    fi
     808    if test x"${vec}" = x"${defvec}"; then
     809        bfd_default_target_size=${target_size}
     810    fi
    677811done
    678812
     
    710844  havevecs=
    711845  selarchs=
     846  test -n "$assocvecs" &&
     847    assocvecs=`echo $assocvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
    712848else    # all_targets is true
    713849  # Only set these if they will be nonempty, for the clever echo.
    714850  havevecs=
     851  assocvecs=
    715852  test -n "$selvecs" &&
    716853    havevecs=`echo $selvecs | sed -e 's/^/-DHAVE_/' -e 's/ \(.\)/ -DHAVE_\1/g'`
     
    724861  *true*)
    725862    wordsize=64
     863    bfd_libs='$(BFD64_LIBS) $(BFD32_LIBS)'
    726864    all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
    727865    if test -z "$GCC" && test "$BFD_HOST_64BIT_LONG" = "0" && test "$BFD_HOST_64_BIT_DEFINED" = "0"; then
     
    729867      AC_MSG_WARN([your compiler may not have a 64 bit integral type])
    730868    fi
     869    if test -n "$GCC" ; then
     870       bad_64bit_gcc=no;
     871       AC_MSG_CHECKING([for gcc version with buggy 64-bit support])
     872       # Add more tests for gcc versions with non-working 64-bit support here.
     873       AC_EGREP_CPP([: 2 : 91 : 1 :],[:__GNUC__:__GNUC_MINOR__:__i386__:],
     874                    bad_64bit_gcc=yes;
     875                    AC_MSG_RESULT([yes: egcs-1.1.2 on ix86 spotted]),
     876                    AC_MSG_RESULT(no))
     877       if test $bad_64bit_gcc = yes ; then
     878         AC_ERROR([A newer version of gcc is needed for the requested 64-bit BFD configuration])
     879       fi
     880    fi
    731881    ;;
    732882  false-false-false)
    733883    wordsize=32
     884    bfd_libs='$(BFD32_LIBS)'
    734885    all_backends='$(BFD32_BACKENDS)'
    735886    ;;
     
    737888
    738889AC_SUBST(wordsize)
     890AC_SUBST(bfd_libs)
    739891AC_SUBST(all_backends)
    740892AC_SUBST(bfd_backends)
    741893AC_SUBST(bfd_machines)
     894AC_SUBST(bfd_default_target_size)
    742895
    743896tdefaults=""
    744897test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
    745898test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"
     899test -n "${assocvecs}" && tdefaults="${tdefaults} -DASSOCIATED_VECS='${assocvecs}'"
    746900test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'"
    747901test -n "${havevecs}" && tdefaults="${tdefaults} ${havevecs}"
     
    756910
    757911rm -f doc/config.status
    758 AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in,
     912AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h bfdver.h:version.h po/Makefile.in:po/Make-in,
    759913[sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' -e '/BLD-POTFILES =/r po/BLD-POTFILES' po/Makefile.in > po/Makefile])
    760914
  • trunk/src/binutils/bfd/host-aout.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r617 r618  
    11/* BFD backend for local host's a.out binaries
    2    Copyright 1990, 1991, 1992, 1994, 1995 Free Software Foundation, Inc.
     2   Copyright 1990, 1991, 1992, 1994, 1995, 2001
     3   Free Software Foundation, Inc.
    34   Written by Cygnus Support.  Probably John Gilmore's fault.
    45
     
    8182#endif /* HOST_MACHINE_ARCH */
    8283
    83 #define MY(OP) CAT(host_aout_,OP)
     84/* Do not "beautify" the CONCAT* macro args.  Traditional C will not
     85   remove whitespace added here, and thus will fail to concatenate
     86   the tokens.  */
     87#define MY(OP) CONCAT2 (host_aout_,OP)
    8488#define TARGETNAME "a.out"
    8589
  • trunk/src/binutils/bfd/libaout.h

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r617 r618  
    11/* BFD back-end data structures for a.out (and similar) files.
    22   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    3    2000, 2001
     3   2000, 2001, 2002
    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#ifndef LIBAOUT_H
     
    3030#include "bfdlink.h"
    3131
     32/* Macros for accessing components in an aout header.  Saves cluttering
     33   the source with (bfd_vma) and (bfd_byte *) casts.  */
     34
     35#define H_PUT_64(abfd, val, where) \
     36  bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
     37
     38#define H_PUT_32(abfd, val, where) \
     39  bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
     40
     41#define H_PUT_16(abfd, val, where) \
     42  bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
     43
     44#define H_PUT_8 bfd_h_put_8
     45
     46#define H_PUT_S64(abfd, val, where) \
     47  bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
     48
     49#define H_PUT_S32(abfd, val, where) \
     50  bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
     51
     52#define H_PUT_S16(abfd, val, where) \
     53  bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
     54
     55#define H_PUT_S8 bfd_h_put_signed_8
     56
     57#define H_GET_64(abfd, where) \
     58  bfd_h_get_64 ((abfd), (bfd_byte *) (where))
     59
     60#define H_GET_32(abfd, where) \
     61  bfd_h_get_32 ((abfd), (bfd_byte *) (where))
     62
     63#define H_GET_16(abfd, where) \
     64  bfd_h_get_16 ((abfd), (bfd_byte *) (where))
     65
     66#define H_GET_8 bfd_h_get_8
     67
     68#define H_GET_S64(abfd, where) \
     69  bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where))
     70
     71#define H_GET_S32(abfd, where) \
     72  bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where))
     73
     74#define H_GET_S16(abfd, where) \
     75  bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where))
     76
     77#define H_GET_S8 bfd_h_get_signed_8
     78
    3279/* Parameterize the a.out code based on whether it is being built
    3380   for a 32-bit architecture or a 64-bit architecture.  */
     81/* Do not "beautify" the CONCAT* macro args.  Traditional C will not
     82   remove whitespace added here, and thus will fail to concatenate
     83   the tokens.  */
    3484#if ARCH_SIZE==64
    35 #define GET_WORD bfd_h_get_64
    36 #define GET_SWORD bfd_h_get_signed_64
    37 #define PUT_WORD bfd_h_put_64
     85#define GET_WORD H_GET_64
     86#define GET_SWORD H_GET_S64
     87#define GET_MAGIC H_GET_32
     88#define PUT_WORD H_PUT_64
     89#define PUT_MAGIC H_PUT_32
    3890#ifndef NAME
    39 #define NAME(x,y) CAT3(x,_64_,y)
    40 #endif
    41 #define JNAME(x) CAT(x,_64)
     91#define NAME(x,y) CONCAT3 (x,_64_,y)
     92#endif
     93#define JNAME(x) CONCAT2 (x,_64)
    4294#define BYTES_IN_WORD 8
     95#else
     96#if ARCH_SIZE==16
     97#define GET_WORD H_GET_16
     98#define GET_SWORD H_GET_S16
     99#define GET_MAGIC H_GET_16
     100#define PUT_WORD H_PUT_16
     101#define PUT_MAGIC H_PUT_16
     102#ifndef NAME
     103#define NAME(x,y) CONCAT3 (x,_16_,y)
     104#endif
     105#define JNAME(x) CONCAT2 (x,_16)
     106#define BYTES_IN_WORD 2
    43107#else /* ARCH_SIZE == 32 */
    44 #define GET_WORD bfd_h_get_32
    45 #define GET_SWORD bfd_h_get_signed_32
    46 #define PUT_WORD bfd_h_put_32
     108#define GET_WORD H_GET_32
     109#define GET_SWORD H_GET_S32
     110#define GET_MAGIC H_GET_32
     111#define PUT_WORD H_PUT_32
     112#define PUT_MAGIC H_PUT_32
    47113#ifndef NAME
    48 #define NAME(x,y) CAT3(x,_32_,y)
    49 #endif
    50 #define JNAME(x) CAT(x,_32)
     114#define NAME(x,y) CONCAT3 (x,_32_,y)
     115#endif
     116#define JNAME(x) CONCAT2 (x,_32)
    51117#define BYTES_IN_WORD 4
    52118#endif /* ARCH_SIZE==32 */
     119#endif /* ARCH_SIZE==64 */
    53120
    54121/* Declare at file level, since used in parameter lists, which have
     
    66133  struct bfd_link_hash_entry root;
    67134  /* Whether this symbol has been written out.  */
    68   boolean written;
     135  bfd_boolean written;
    69136  /* Symbol index in output file.  */
    70137  int indx;
     
    89156  (bfd_link_hash_traverse                                               \
    90157   (&(table)->root,                                                     \
    91     (boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func),  \
     158    (bfd_boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func), \
    92159    (info)))
    93160
     
    129196  /* Callback for setting the page and segment sizes, if they can't be
    130197     trivially determined from the architecture.  */
    131   boolean (*set_sizes) PARAMS ((bfd *));
     198  bfd_boolean (*set_sizes)
     199    PARAMS ((bfd *));
    132200
    133201  /* zmagic files only. For go32, the length of the exec header contributes
     
    138206  /* Callback from the add symbols phase of the linker code to handle
    139207     a dynamic object.  */
    140   boolean (*add_dynamic_symbols) PARAMS ((bfd *, struct bfd_link_info *,
    141                                           struct external_nlist **,
    142                                           bfd_size_type *, char **));
     208  bfd_boolean (*add_dynamic_symbols)
     209    PARAMS ((bfd *, struct bfd_link_info *, struct external_nlist **,
     210             bfd_size_type *, char **));
    143211
    144212  /* Callback from the add symbols phase of the linker code to handle
    145213     adding a single symbol to the global linker hash table.  */
    146   boolean (*add_one_symbol) PARAMS ((struct bfd_link_info *, bfd *,
    147                                      const char *, flagword, asection *,
    148                                      bfd_vma, const char *, boolean,
    149                                      boolean,
    150                                      struct bfd_link_hash_entry **));
     214  bfd_boolean (*add_one_symbol)
     215    PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword,
     216             asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean,
     217             struct bfd_link_hash_entry **));
    151218
    152219  /* Called to handle linking a dynamic object.  */
    153   boolean (*link_dynamic_object) PARAMS ((struct bfd_link_info *, bfd *));
     220  bfd_boolean (*link_dynamic_object)
     221    PARAMS ((struct bfd_link_info *, bfd *));
    154222
    155223  /* Called for each global symbol being written out by the linker.
    156224     This should write out the dynamic symbol information.  */
    157   boolean (*write_dynamic_symbol) PARAMS ((bfd *, struct bfd_link_info *,
    158                                           struct aout_link_hash_entry *));
     225  bfd_boolean (*write_dynamic_symbol)
     226    PARAMS ((bfd *, struct bfd_link_info *, struct aout_link_hash_entry *));
    159227
    160228  /* If this callback is not NULL, the linker calls it for each reloc.
    161229     RELOC is a pointer to the unswapped reloc.  If *SKIP is set to
    162      true, the reloc will be skipped.  *RELOCATION may be changed to
     230     TRUE, the reloc will be skipped.  *RELOCATION may be changed to
    163231     change the effects of the relocation.  */
    164   boolean (*check_dynamic_reloc) PARAMS ((struct bfd_link_info *info,
    165                                           bfd *input_bfd,
    166                                           asection *input_section,
    167                                           struct aout_link_hash_entry *h,
    168                                           PTR reloc, bfd_byte *contents,
    169                                           boolean *skip,
    170                                           bfd_vma *relocation));
     232  bfd_boolean (*check_dynamic_reloc)
     233    PARAMS ((struct bfd_link_info *info, bfd *input_bfd,
     234             asection *input_section, struct aout_link_hash_entry *h,
     235             PTR reloc, bfd_byte *contents, bfd_boolean *skip,
     236             bfd_vma *relocation));
    171237
    172238  /* Called at the end of a link to finish up any dynamic linking
    173239     information.  */
    174   boolean (*finish_dynamic_link) PARAMS ((bfd *, struct bfd_link_info *));
     240  bfd_boolean (*finish_dynamic_link)
     241    PARAMS ((bfd *, struct bfd_link_info *));
    175242};
    176243#define aout_backend_info(abfd) \
    177         ((CONST struct aout_backend_data *)((abfd)->xvec->backend_data))
     244        ((const struct aout_backend_data *)((abfd)->xvec->backend_data))
    178245
    179246/* This is the layout in memory of a "struct exec" while we process it.
     
    205272};
    206273
    207 /* Magic number is written 
     274/* Magic number is written
    208275< MSB          >
    2092763130292827262524232221201918171615141312111009080706050403020100
     
    221288  M_68020 = 2,
    222289  M_SPARC = 3,
    223   /* skip a bunch so we don't run into any of suns numbers */
    224   /* make these up for the ns32k*/
    225   M_NS32032 = (64),             /* ns32032 running ? */
    226   M_NS32532 = (64 + 5),         /* ns32532 running mach */
     290  /* Skip a bunch so we don't run into any of SUN's numbers. */
     291  /* Make these up for the ns32k.  */
     292  M_NS32032 = (64),     /* ns32032 running ? */
     293  M_NS32532 = (64 + 5), /* ns32532 running mach */
    227294
    228295  M_386 = 100,
     
    241308  M_ARM6_NETBSD = 143,  /* NetBSD/arm32 binary */
    242309  M_SPARCLET_1 = 147,   /* 0x93, reserved */
     310  M_VAX4K_NETBSD = 150, /* NetBSD/vax 4K pages binary */
    243311  M_MIPS1 = 151,        /* MIPS R2000/R3000 binary */
    244312  M_MIPS2 = 152,        /* MIPS R4000/R6000 binary */
     
    279347#ifndef N_SET_DYNAMIC
    280348# define N_SET_DYNAMIC(exec, dynamic) \
    281 ((exec).a_info = (dynamic) ? ((exec).a_info | 0x80000000) : \
     349((exec).a_info = (dynamic) ? (long) ((exec).a_info | 0x80000000) : \
    282350((exec).a_info & 0x7fffffff))
    283351#endif
     
    314382  struct internal_exec *hdr;            /* exec file header */
    315383  aout_symbol_type *symbols;            /* symtab for input bfd */
    316  
    317   /* For ease, we do this */
     384
     385  /* For ease, we do this. */
    318386  asection *textsec;
    319387  asection *datasec;
     
    325393  file_ptr str_filepos;
    326394
    327   /* Size of a relocation entry in external form */
     395  /* Size of a relocation entry in external form. */
    328396  unsigned reloc_entry_size;
    329397
    330   /* Size of a symbol table entry in external form */
     398  /* Size of a symbol table entry in external form. */
    331399  unsigned symbol_entry_size;
    332400
    333   /* Page size - needed for alignment of demand paged files. */
     401  /* Page size - needed for alignment of demand paged files.  */
    334402  unsigned long page_size;
    335403
    336   /* Segment size - needed for alignment of demand paged files. */
     404  /* Segment size - needed for alignment of demand paged files.  */
    337405  unsigned long segment_size;
    338406
     
    344412  unsigned vma_adjusted : 1;
    345413
    346   /* used when a bfd supports several highly similar formats */
     414  /* Used when a bfd supports several highly similar formats. */
    347415  enum
    348416    {
     
    409477
    410478/* We take the address of the first element of an asymbol to ensure that the
    411    macro is only ever applied to an asymbol */
     479   macro is only ever applied to an asymbol. */
    412480#define aout_symbol(asymbol) ((aout_symbol_type *)(&(asymbol)->the_bfd))
    413481
     
    427495  ((s)->used_by_bfd = (PTR)&(v)->relocs)
    428496
    429 /* Prototype declarations for functions defined in aoutx.h  */
    430 
    431 boolean
    432 NAME(aout,squirt_out_relocs) PARAMS ((bfd *abfd, asection *section));
    433 
    434 boolean
    435 NAME(aout,make_sections) PARAMS ((bfd *));
    436 
    437 const bfd_target *
    438 NAME(aout,some_aout_object_p) PARAMS ((bfd *abfd,
    439                                        struct internal_exec *execp,
    440                                        const bfd_target *(*callback)(bfd *)));
    441 
    442 boolean
    443 NAME(aout,mkobject) PARAMS ((bfd *abfd));
    444 
    445 enum machine_type
    446 NAME(aout,machine_type) PARAMS ((enum bfd_architecture arch,
    447                                  unsigned long machine,
    448                                  boolean *unknown));
    449 
    450 boolean
    451 NAME(aout,set_arch_mach) PARAMS ((bfd *abfd, enum bfd_architecture arch,
    452                                   unsigned long machine));
    453 
    454 boolean
    455 NAME(aout,new_section_hook) PARAMS ((bfd *abfd, asection *newsect));
    456 
    457 boolean
    458 NAME(aout,set_section_contents) PARAMS ((bfd *abfd, sec_ptr section,
    459                          PTR location, file_ptr offset, bfd_size_type count));
    460 
    461 asymbol *
    462 NAME(aout,make_empty_symbol) PARAMS ((bfd *abfd));
    463 
    464 boolean
    465 NAME(aout,translate_symbol_table) PARAMS ((bfd *, aout_symbol_type *,
    466                                            struct external_nlist *,
    467                                            bfd_size_type, char *,
    468                                            bfd_size_type,
    469                                            boolean dynamic));
    470 
    471 boolean
    472 NAME(aout,slurp_symbol_table) PARAMS ((bfd *abfd));
    473 
    474 boolean
    475 NAME(aout,write_syms) PARAMS ((bfd *abfd));
    476 
    477 void
    478 NAME(aout,reclaim_symbol_table) PARAMS ((bfd *abfd));
    479 
    480 long
    481 NAME(aout,get_symtab_upper_bound) PARAMS ((bfd *abfd));
    482 
    483 long
    484 NAME(aout,get_symtab) PARAMS ((bfd *abfd, asymbol **location));
    485 
    486 void
    487 NAME(aout,swap_ext_reloc_in) PARAMS ((bfd *, struct reloc_ext_external *,
    488                                       arelent *, asymbol **, bfd_size_type));
    489 void
    490 NAME(aout,swap_std_reloc_in) PARAMS ((bfd *, struct reloc_std_external *,
    491                                       arelent *, asymbol **, bfd_size_type));
    492 
    493 reloc_howto_type *
    494 NAME(aout,reloc_type_lookup) PARAMS ((bfd *abfd,
    495                                       bfd_reloc_code_real_type code));
    496 
    497 boolean
    498 NAME(aout,slurp_reloc_table) PARAMS ((bfd *abfd, sec_ptr asect,
    499                                       asymbol **symbols));
    500 
    501 long
    502 NAME(aout,canonicalize_reloc) PARAMS ((bfd *abfd, sec_ptr section,
    503                                        arelent **relptr, asymbol **symbols));
    504 
    505 long
    506 NAME(aout,get_reloc_upper_bound) PARAMS ((bfd *abfd, sec_ptr asect));
    507 
    508 void
    509 NAME(aout,reclaim_reloc) PARAMS ((bfd *ignore_abfd, sec_ptr ignore));
    510 
    511 alent *
    512 NAME(aout,get_lineno) PARAMS ((bfd *ignore_abfd, asymbol *ignore_symbol));
    513 
    514 void
    515 NAME(aout,print_symbol) PARAMS ((bfd *ignore_abfd, PTR file,
    516                             asymbol *symbol, bfd_print_symbol_type how));
    517 
    518 void
    519 NAME(aout,get_symbol_info) PARAMS ((bfd *ignore_abfd,
    520                            asymbol *symbol, symbol_info *ret));
    521 
    522 boolean
    523 NAME(aout,find_nearest_line) PARAMS ((bfd *abfd, asection *section,
    524       asymbol **symbols, bfd_vma offset, CONST char **filename_ptr,
    525       CONST char **functionname_ptr, unsigned int *line_ptr));
    526 
    527 long
    528 NAME(aout,read_minisymbols) PARAMS ((bfd *, boolean, PTR *, unsigned int *));
    529 
    530 asymbol *
    531 NAME(aout,minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR,
    532                                          asymbol *));
    533 
    534 int
    535 NAME(aout,sizeof_headers) PARAMS ((bfd *abfd, boolean exec));
    536 
    537 boolean
    538 NAME(aout,adjust_sizes_and_vmas) PARAMS ((bfd *abfd,
    539        bfd_size_type *text_size, file_ptr *text_end));
    540 
    541 void
    542 NAME(aout,swap_exec_header_in) PARAMS ((bfd *abfd,
    543        struct external_exec *raw_bytes, struct internal_exec *execp));
    544 
    545 void
    546 NAME(aout,swap_exec_header_out) PARAMS ((bfd *abfd,
    547        struct internal_exec *execp, struct external_exec *raw_bytes));
    548 
    549 struct bfd_hash_entry *
    550 NAME(aout,link_hash_newfunc)
     497/* Prototype declarations for functions defined in aoutx.h.  */
     498
     499extern bfd_boolean NAME(aout,squirt_out_relocs)
     500  PARAMS ((bfd *, asection *));
     501
     502extern bfd_boolean NAME(aout,make_sections)
     503  PARAMS ((bfd *));
     504
     505extern const bfd_target * NAME(aout,some_aout_object_p)
     506  PARAMS ((bfd *, struct internal_exec *, const bfd_target *(*) (bfd *)));
     507
     508extern bfd_boolean NAME(aout,mkobject)
     509  PARAMS ((bfd *));
     510
     511extern enum machine_type NAME(aout,machine_type)
     512  PARAMS ((enum bfd_architecture, unsigned long, bfd_boolean *));
     513
     514extern bfd_boolean NAME(aout,set_arch_mach)
     515  PARAMS ((bfd *, enum bfd_architecture, unsigned long));
     516
     517extern bfd_boolean NAME(aout,new_section_hook)
     518  PARAMS ((bfd *, asection *));
     519
     520extern bfd_boolean NAME(aout,set_section_contents)
     521  PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type));
     522
     523extern asymbol * NAME(aout,make_empty_symbol)
     524  PARAMS ((bfd *));
     525
     526extern bfd_boolean NAME(aout,translate_symbol_table)
     527  PARAMS ((bfd *, aout_symbol_type *, struct external_nlist *, bfd_size_type,
     528           char *, bfd_size_type, bfd_boolean));
     529
     530extern bfd_boolean NAME(aout,slurp_symbol_table)
     531  PARAMS ((bfd *));
     532
     533extern bfd_boolean NAME(aout,write_syms)
     534  PARAMS ((bfd *));
     535
     536extern void NAME(aout,reclaim_symbol_table)
     537  PARAMS ((bfd *));
     538
     539extern long NAME(aout,get_symtab_upper_bound)
     540  PARAMS ((bfd *));
     541
     542extern long NAME(aout,get_symtab)
     543  PARAMS ((bfd *, asymbol **));
     544
     545extern void NAME(aout,swap_ext_reloc_in)
     546  PARAMS ((bfd *, struct reloc_ext_external *, arelent *, asymbol **,
     547           bfd_size_type));
     548extern void NAME(aout,swap_std_reloc_in)
     549  PARAMS ((bfd *, struct reloc_std_external *, arelent *, asymbol **,
     550           bfd_size_type));
     551
     552extern reloc_howto_type * NAME(aout,reloc_type_lookup)
     553  PARAMS ((bfd *, bfd_reloc_code_real_type));
     554
     555extern bfd_boolean NAME(aout,slurp_reloc_table)
     556  PARAMS ((bfd *, sec_ptr, asymbol **));
     557
     558extern long NAME(aout,canonicalize_reloc)
     559  PARAMS ((bfd *, sec_ptr, arelent **, asymbol **));
     560
     561extern long NAME(aout,get_reloc_upper_bound)
     562  PARAMS ((bfd *, sec_ptr));
     563
     564extern void NAME(aout,reclaim_reloc)
     565  PARAMS ((bfd *, sec_ptr));
     566
     567extern alent * NAME(aout,get_lineno)
     568  PARAMS ((bfd *, asymbol *));
     569
     570extern void NAME(aout,print_symbol)
     571  PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type));
     572
     573extern void NAME(aout,get_symbol_info)
     574  PARAMS ((bfd *, asymbol *, symbol_info *));
     575
     576extern bfd_boolean NAME(aout,find_nearest_line)
     577  PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
     578           const char **, unsigned int *));
     579
     580extern long NAME(aout,read_minisymbols)
     581  PARAMS ((bfd *, bfd_boolean, PTR *, unsigned int *));
     582
     583extern asymbol * NAME(aout,minisymbol_to_symbol)
     584  PARAMS ((bfd *, bfd_boolean, const PTR, asymbol *));
     585
     586extern int NAME(aout,sizeof_headers)
     587  PARAMS ((bfd *, bfd_boolean));
     588
     589extern bfd_boolean NAME(aout,adjust_sizes_and_vmas)
     590  PARAMS ((bfd *, bfd_size_type *, file_ptr *));
     591
     592extern void NAME(aout,swap_exec_header_in)
     593  PARAMS ((bfd *, struct external_exec *, struct internal_exec *));
     594
     595extern void NAME(aout,swap_exec_header_out)
     596  PARAMS ((bfd *, struct internal_exec *, struct external_exec *));
     597
     598extern struct bfd_hash_entry * NAME(aout,link_hash_newfunc)
    551599  PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
    552600
    553 boolean
    554 NAME(aout,link_hash_table_init)
    555      PARAMS ((struct aout_link_hash_table *, bfd *,
    556               struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
    557                                           struct bfd_hash_table *,
    558                                           const char *)));
    559 
    560 struct bfd_link_hash_table *
    561 NAME(aout,link_hash_table_create) PARAMS ((bfd *));
    562 
    563 boolean
    564 NAME(aout,link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *));
    565 
    566 boolean
    567 NAME(aout,final_link) PARAMS ((bfd *, struct bfd_link_info *,
    568                                void (*) (bfd *, file_ptr *, file_ptr *,
    569                                          file_ptr *)));
    570 
    571 boolean
    572 NAME(aout,bfd_free_cached_info) PARAMS ((bfd *));
    573 
    574 /* A.out uses the generic versions of these routines... */
     601extern bfd_boolean NAME(aout,link_hash_table_init)
     602  PARAMS ((struct aout_link_hash_table *, bfd *,
     603           struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
     604                                       struct bfd_hash_table *,
     605                                       const char *)));
     606
     607extern struct bfd_link_hash_table * NAME(aout,link_hash_table_create)
     608  PARAMS ((bfd *));
     609
     610extern bfd_boolean NAME(aout,link_add_symbols)
     611  PARAMS ((bfd *, struct bfd_link_info *));
     612
     613extern bfd_boolean NAME(aout,final_link)
     614  PARAMS ((bfd *, struct bfd_link_info *,
     615           void (*) (bfd *, file_ptr *, file_ptr *, file_ptr *)));
     616
     617extern bfd_boolean NAME(aout,bfd_free_cached_info)
     618  PARAMS ((bfd *));
     619
     620/* A.out uses the generic versions of these routines...  */
     621
     622#define aout_16_get_section_contents    _bfd_generic_get_section_contents
    575623
    576624#define aout_32_get_section_contents    _bfd_generic_get_section_contents
     
    602650        NAME(aout,swap_exec_header_out) (abfd, execp, &exec_bytes);           \
    603651                                                                              \
    604         if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) return false;       \
    605         if (bfd_write ((PTR) &exec_bytes, 1, EXEC_BYTES_SIZE, abfd)          \
    606             != EXEC_BYTES_SIZE)                                               \
    607           return false;                                                       \
    608         /* Now write out reloc info, followed by syms and strings */          \
     652        if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0                      \
     653            || bfd_bwrite ((PTR) &exec_bytes, (bfd_size_type) EXEC_BYTES_SIZE, \
     654                          abfd) != EXEC_BYTES_SIZE)                           \
     655          return FALSE;                                                       \
     656        /* Now write out reloc info, followed by syms and strings. */        \
    609657                                                                              \
    610658        if (bfd_get_outsymbols (abfd) != (asymbol **) NULL                    \
    611659            && bfd_get_symcount (abfd) != 0)                                  \
    612660          {                                                                   \
    613             if (bfd_seek (abfd, (file_ptr)(N_SYMOFF(*execp)), SEEK_SET) != 0) \
    614               return false;                                                   \
     661            if (bfd_seek (abfd, (file_ptr) (N_SYMOFF(*execp)), SEEK_SET) != 0)\
     662              return FALSE;                                                   \
    615663                                                                              \
    616             if (! NAME(aout,write_syms)(abfd)) return false;                  \
     664            if (! NAME(aout,write_syms) (abfd))                               \
     665              return FALSE;                                                   \
    617666          }                                                                   \
    618667                                                                              \
    619         if (bfd_seek (abfd, (file_ptr)(N_TRELOFF(*execp)), SEEK_SET) != 0)    \
    620           return false;                                                       \
     668        if (bfd_seek (abfd, (file_ptr) (N_TRELOFF(*execp)), SEEK_SET) != 0)   \
     669          return FALSE;                                                       \
    621670        if (!NAME(aout,squirt_out_relocs) (abfd, obj_textsec (abfd)))         \
    622           return false;                                                       \
     671          return FALSE;                                                       \
    623672                                                                              \
    624         if (bfd_seek (abfd, (file_ptr)(N_DRELOFF(*execp)), SEEK_SET) != 0)    \
    625           return false;                                                       \
    626         if (!NAME(aout,squirt_out_relocs)(abfd, obj_datasec (abfd)))          \
    627           return false;                                                       \
    628       }                                                                       
    629 #endif
     673        if (bfd_seek (abfd, (file_ptr) (N_DRELOFF(*execp)), SEEK_SET) != 0)   \
     674          return FALSE;                                                       \
     675        if (!NAME(aout,squirt_out_relocs) (abfd, obj_datasec (abfd)))         \
     676          return FALSE;                                                       \
     677      }
     678#endif
     679
     680/* Test if a read-only section can be merged with .text.  This is
     681   possible if:
     682
     683   1. Section has file contents and is read-only.
     684   2. The VMA of the section is after the end of .text and before
     685      the start of .data.
     686   3. The image is demand-pageable (otherwise, a_text in the header
     687      will not reflect the gap between .text and .data).  */
     688
     689#define aout_section_merge_with_text_p(abfd, sec)                       \
     690  (((sec)->flags & (SEC_HAS_CONTENTS | SEC_READONLY)) ==                \
     691      (SEC_HAS_CONTENTS | SEC_READONLY)                                 \
     692   && obj_textsec (abfd) != NULL                                        \
     693   && obj_datasec (abfd) != NULL                                        \
     694   && (sec)->vma >= (obj_textsec (abfd)->vma +                          \
     695                     obj_textsec (abfd)->_cooked_size)                  \
     696   && ((sec)->vma + (sec)->_cooked_size) <= obj_datasec (abfd)->vma     \
     697   && ((abfd)->flags & D_PAGED) != 0)
    630698
    631699#endif /* ! defined (LIBAOUT_H) */
  • trunk/src/binutils/bfd/syms.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r617 r618  
    11/* Generic symbol-table support for the BFD library.
    22   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    3    2000
     3   2000, 2001, 2002, 2003
    44   Free Software Foundation, Inc.
    55   Written by Cygnus Support.
    66
    7 This file is part of BFD, the Binary File Descriptor library.
    8 
    9 This program is free software; you can redistribute it and/or modify
    10 it under the terms of the GNU General Public License as published by
    11 the Free Software Foundation; either version 2 of the License, or
    12 (at your option) any later version.
    13 
    14 This program is distributed in the hope that it will be useful,
    15 but WITHOUT ANY WARRANTY; without even the implied warranty of
    16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    17 GNU General Public License for more details.
    18 
    19 You should have received a copy of the GNU General Public License
    20 along with this program; if not, write to the Free Software
    21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
     7   This file is part of BFD, the Binary File Descriptor library.
     8
     9   This program is free software; you can redistribute it and/or modify
     10   it under the terms of the GNU General Public License as published by
     11   the Free Software Foundation; either version 2 of the License, or
     12   (at your option) any later version.
     13
     14   This program is distributed in the hope that it will be useful,
     15   but WITHOUT ANY WARRANTY; without even the implied warranty of
     16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     17   GNU General Public License for more details.
     18
     19   You should have received a copy of the GNU General Public License
     20   along with this program; if not, write to the Free Software
     21   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    2222
    2323/*
     
    7575|           FAIL
    7676|
    77 |         if (storage_needed == 0) {
    78 |            return ;
    79 |         }
     77|         if (storage_needed == 0)
     78|           return;
     79|       
    8080|         symbol_table = (asymbol **) xmalloc (storage_needed);
    8181|           ...
     
    8686|           FAIL
    8787|
    88 |         for (i = 0; i < number_of_symbols; i++) {
    89 |            process_symbol (symbol_table[i]);
    90 |         }
     88|         for (i = 0; i < number_of_symbols; i++)
     89|           process_symbol (symbol_table[i]);
    9190
    9291        All storage for the symbols themselves is in an objalloc
     
    109108
    110109|       #include "bfd.h"
    111 |       main()
     110|       int main (void)
    112111|       {
    113112|         bfd *abfd;
     
    115114|         asymbol *new;
    116115|
    117 |         abfd = bfd_openw("foo","a.out-sunos-big");
    118 |         bfd_set_format(abfd, bfd_object);
    119 |         new = bfd_make_empty_symbol(abfd);
     116|         abfd = bfd_openw ("foo","a.out-sunos-big");
     117|         bfd_set_format (abfd, bfd_object);
     118|         new = bfd_make_empty_symbol (abfd);
    120119|         new->name = "dummy_symbol";
    121 |         new->section = bfd_make_section_old_way(abfd, ".text");
     120|         new->section = bfd_make_section_old_way (abfd, ".text");
    122121|         new->flags = BSF_GLOBAL;
    123122|         new->value = 0x12345;
     
    126125|         ptrs[1] = (asymbol *)0;
    127126|
    128 |         bfd_set_symtab(abfd, ptrs, 1);
    129 |         bfd_close(abfd);
     127|         bfd_set_symtab (abfd, ptrs, 1);
     128|         bfd_close (abfd);
     129|         return 0;
    130130|       }
    131131|
     
    184184.typedef struct symbol_cache_entry
    185185.{
    186 .       {* A pointer to the BFD which owns the symbol. This information
    187 .          is necessary so that a back end can work out what additional
    188 .          information (invisible to the application writer) is carried
    189 .          with the symbol.
    190 .
    191 .          This field is *almost* redundant, since you can use section->owner
    192 .          instead, except that some symbols point to the global sections
    193 .          bfd_{abs,com,und}_section.  This could be fixed by making
    194 .          these globals be per-bfd (or per-target-flavor).  FIXME. *}
    195 .
    196 .  struct _bfd *the_bfd; {* Use bfd_asymbol_bfd(sym) to access this field. *}
    197 .
    198 .       {* The text of the symbol. The name is left alone, and not copied; the
    199 .          application may not alter it. *}
    200 .  CONST char *name;
    201 .
    202 .       {* The value of the symbol.  This really should be a union of a
    203 .          numeric value with a pointer, since some flags indicate that
    204 .          a pointer to another symbol is stored here.  *}
     186.  {* A pointer to the BFD which owns the symbol. This information
     187.     is necessary so that a back end can work out what additional
     188.     information (invisible to the application writer) is carried
     189.     with the symbol.
     190.
     191.     This field is *almost* redundant, since you can use section->owner
     192.     instead, except that some symbols point to the global sections
     193.     bfd_{abs,com,und}_section.  This could be fixed by making
     194.     these globals be per-bfd (or per-target-flavor).  FIXME.  *}
     195.  struct bfd *the_bfd; {* Use bfd_asymbol_bfd(sym) to access this field.  *}
     196.
     197.  {* The text of the symbol. The name is left alone, and not copied; the
     198.     application may not alter it.  *}
     199.  const char *name;
     200.
     201.  {* The value of the symbol.  This really should be a union of a
     202.     numeric value with a pointer, since some flags indicate that
     203.     a pointer to another symbol is stored here.  *}
    205204.  symvalue value;
    206205.
    207 .       {* Attributes of a symbol: *}
    208 .
     206.  {* Attributes of a symbol.  *}
    209207.#define BSF_NO_FLAGS    0x00
    210208.
    211 .       {* The symbol has local scope; <<static>> in <<C>>. The value
    212 .          is the offset into the section of the data. *}
     209.  {* The symbol has local scope; <<static>> in <<C>>. The value
     210.     is the offset into the section of the data. *}
    213211.#define BSF_LOCAL      0x01
    214212.
    215 .       {* The symbol has global scope; initialized data in <<C>>. The
    216 .          value is the offset into the section of the data. *}
     213.  {* The symbol has global scope; initialized data in <<C>>. The
     214.     value is the offset into the section of the data. *}
    217215.#define BSF_GLOBAL     0x02
    218216.
    219 .       {* The symbol has global scope and is exported. The value is
    220 .          the offset into the section of the data. *}
    221 .#define BSF_EXPORT     BSF_GLOBAL {* no real difference *}
    222 .
    223 .       {* A normal C symbol would be one of:
    224 .          <<BSF_LOCAL>>, <<BSF_FORT_COMM>>,  <<BSF_UNDEFINED>> or
    225 .          <<BSF_GLOBAL>> *}
    226 .
    227 .       {* The symbol is a debugging record. The value has an arbitary
    228 .          meaning, unless BSF_DEBUGGING_RELOC is also set.  *}
     217.  {* The symbol has global scope and is exported. The value is
     218.     the offset into the section of the data. *}
     219.#define BSF_EXPORT     BSF_GLOBAL {* No real difference. *}
     220.
     221.  {* A normal C symbol would be one of:
     222.     <<BSF_LOCAL>>, <<BSF_FORT_COMM>>,  <<BSF_UNDEFINED>> or
     223.     <<BSF_GLOBAL>>. *}
     224.
     225.  {* The symbol is a debugging record. The value has an arbitary
     226.     meaning, unless BSF_DEBUGGING_RELOC is also set.  *}
    229227.#define BSF_DEBUGGING  0x08
    230228.
    231 .       {* The symbol denotes a function entry point.  Used in ELF,
    232 .          perhaps others someday.  *}
     229.  {* The symbol denotes a function entry point.  Used in ELF,
     230.     perhaps others someday.  *}
    233231.#define BSF_FUNCTION    0x10
    234232.
    235 .       {* Used by the linker. *}
     233.  {* Used by the linker. *}
    236234.#define BSF_KEEP        0x20
    237235.#define BSF_KEEP_G      0x40
    238236.
    239 .       {* A weak global symbol, overridable without warnings by
    240 .          a regular global symbol of the same name.  *}
     237.  {* A weak global symbol, overridable without warnings by
     238.     a regular global symbol of the same name.  *}
    241239.#define BSF_WEAK        0x80
    242240.
    243      {* This symbol was created to point to a section, e.g. ELF's
    244 .          STT_SECTION symbols.  *}
     241{* This symbol was created to point to a section, e.g. ELF's
     242.     STT_SECTION symbols.  *}
    245243.#define BSF_SECTION_SYM 0x100
    246244.
    247 .       {* The symbol used to be a common symbol, but now it is
    248 .          allocated. *}
     245.  {* The symbol used to be a common symbol, but now it is
     246.     allocated. *}
    249247.#define BSF_OLD_COMMON  0x200
    250248.
    251 .       {* The default value for common data. *}
     249.  {* The default value for common data. *}
    252250.#define BFD_FORT_COMM_DEFAULT_VALUE 0
    253251.
    254 .       {* In some files the type of a symbol sometimes alters its
    255 .          location in an output file - ie in coff a <<ISFCN>> symbol
    256 .          which is also <<C_EXT>> symbol appears where it was
    257 .          declared and not at the end of a section.  This bit is set
    258 .          by the target BFD part to convey this information. *}
    259 .
     252.  {* In some files the type of a symbol sometimes alters its
     253.     location in an output file - ie in coff a <<ISFCN>> symbol
     254.     which is also <<C_EXT>> symbol appears where it was
     255.     declared and not at the end of a section.  This bit is set
     256.     by the target BFD part to convey this information.  *}
    260257.#define BSF_NOT_AT_END    0x400
    261258.
    262 .       {* Signal that the symbol is the label of constructor section. *}
     259.  {* Signal that the symbol is the label of constructor section. *}
    263260.#define BSF_CONSTRUCTOR   0x800
    264261.
    265 .       {* Signal that the symbol is a warning symbol.  The name is a
    266 .          warning.  The name of the next symbol is the one to warn about;
    267 .          if a reference is made to a symbol with the same name as the next
    268 .          symbol, a warning is issued by the linker. *}
     262.  {* Signal that the symbol is a warning symbol.  The name is a
     263.     warning.  The name of the next symbol is the one to warn about;
     264.     if a reference is made to a symbol with the same name as the next
     265.     symbol, a warning is issued by the linker. *}
    269266.#define BSF_WARNING       0x1000
    270267.
    271 .       {* Signal that the symbol is indirect.  This symbol is an indirect
    272 .          pointer to the symbol with the same name as the next symbol. *}
     268.  {* Signal that the symbol is indirect.  This symbol is an indirect
     269.     pointer to the symbol with the same name as the next symbol. *}
    273270.#define BSF_INDIRECT      0x2000
    274271.
    275 .       {* BSF_FILE marks symbols that contain a file name.  This is used
    276 .          for ELF STT_FILE symbols.  *}
     272.  {* BSF_FILE marks symbols that contain a file name.  This is used
     273.     for ELF STT_FILE symbols.  *}
    277274.#define BSF_FILE          0x4000
    278275.
    279 .       {* Symbol is from dynamic linking information.  *}
     276.  {* Symbol is from dynamic linking information.  *}
    280277.#define BSF_DYNAMIC       0x8000
    281278.
    282      {* The symbol denotes a data object.  Used in ELF, and perhaps
    283 .          others someday.  *}
     279{* The symbol denotes a data object.  Used in ELF, and perhaps
     280.     others someday.  *}
    284281.#define BSF_OBJECT        0x10000
    285282.
    286      {* This symbol is a debugging symbol.  The value is the offset
    287 .          into the section of the data.  BSF_DEBUGGING should be set
    288 .          as well.  *}
     283{* This symbol is a debugging symbol.  The value is the offset
     284.     into the section of the data.  BSF_DEBUGGING should be set
     285.     as well.  *}
    289286.#define BSF_DEBUGGING_RELOC 0x20000
    290287.
    291 .       {* Symbol is an emx import reference.  *}
     288.  {* This symbol is thread local.  Used in ELF.  *}
     289.#define BSF_THREAD_LOCAL  0x40000
     290.
     291.  {* Symbol is an emx import reference.  *}
    292292.#define BSF_EMX_IMPORT1   0x20000000
    293293.
    294 .       {* Symbol is an emx import definition.  *}
     294.  {* Symbol is an emx import definition.  *}
    295295.#define BSF_EMX_IMPORT2   0x40000000
    296296.
    297297.  flagword flags;
    298298.
    299 .       {* A pointer to the section to which this symbol is
    300 .          relative.  This will always be non NULL, there are special
    301 .          sections for undefined and absolute symbols.  *}
     299.  {* A pointer to the section to which this symbol is
     300.     relative.  This will always be non NULL, there are special
     301.     sections for undefined and absolute symbols.  *}
    302302.  struct sec *section;
    303303.
    304 .       {* Back end special data.  *}
     304.  {* Back end special data.  *}
    305305.  union
    306306.    {
    307307.      PTR p;
    308308.      bfd_vma i;
    309 .    } udata;
    310 .
    311 .} asymbol;
     309.    }
     310.  udata;
     311.}
     312.asymbol;
     313.
    312314*/
    313315
     
    315317#include "sysdep.h"
    316318#include "libbfd.h"
     319#include "safe-ctype.h"
    317320#include "bfdlink.h"
    318321#include "aout/stab_gnu.h"
    319322
    320323static char coff_section_type PARAMS ((const char *));
     324static char decode_section_type PARAMS ((const struct sec *));
     325static int cmpindexentry PARAMS ((const PTR, const PTR));
    321326
    322327/*
     
    340345.#define bfd_get_symtab_upper_bound(abfd) \
    341346.     BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
    342 
     347.
    343348*/
    344349
     
    348353
    349354SYNOPSIS
    350         boolean bfd_is_local_label(bfd *abfd, asymbol *sym);
     355        bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
    351356
    352357DESCRIPTION
    353         Return true if the given symbol @var{sym} in the BFD @var{abfd} is
    354         a compiler generated local label, else return false.
    355 */
    356 
    357 boolean
     358        Return TRUE if the given symbol @var{sym} in the BFD @var{abfd} is
     359        a compiler generated local label, else return FALSE.
     360*/
     361
     362bfd_boolean
    358363bfd_is_local_label (abfd, sym)
    359364     bfd *abfd;
    360365     asymbol *sym;
    361366{
    362   if ((sym->flags & (BSF_GLOBAL | BSF_WEAK)) != 0)
    363     return false;
     367  /* The BSF_SECTION_SYM check is needed for IA-64, where every label that
     368     starts with '.' is local.  This would accidentally catch section names
     369     if we didn't reject them here.  */
     370  if ((sym->flags & (BSF_GLOBAL | BSF_WEAK | BSF_SECTION_SYM)) != 0)
     371    return FALSE;
    364372  if (sym->name == NULL)
    365     return false;
     373    return FALSE;
    366374  return bfd_is_local_label_name (abfd, sym->name);
    367375}
     
    372380
    373381SYNOPSIS
    374         boolean bfd_is_local_label_name(bfd *abfd, const char *name);
     382        bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
    375383
    376384DESCRIPTION
    377         Return true if a symbol with the name @var{name} in the BFD
     385        Return TRUE if a symbol with the name @var{name} in the BFD
    378386        @var{abfd} is a compiler generated local label, else return
    379         false.  This just checks whether the name has the form of a
     387        FALSE.  This just checks whether the name has the form of a
    380388        local label.
    381389
    382390.#define bfd_is_local_label_name(abfd, name) \
    383391.     BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
     392.
    384393*/
    385394
     
    398407.     BFD_SEND (abfd, _bfd_canonicalize_symtab,\
    399408.                  (abfd, location))
    400 
     409.
    401410*/
    402411
     
    406415
    407416SYNOPSIS
    408         boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count);
     417        bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count);
    409418
    410419DESCRIPTION
     
    414423*/
    415424
    416 boolean
     425bfd_boolean
    417426bfd_set_symtab (abfd, location, symcount)
    418427     bfd *abfd;
     
    423432    {
    424433      bfd_set_error (bfd_error_invalid_operation);
    425       return false;
     434      return FALSE;
    426435    }
    427436
    428437  bfd_get_outsymbols (abfd) = location;
    429438  bfd_get_symcount (abfd) = symcount;
    430   return true;
     439  return TRUE;
    431440}
    432441
     
    436445
    437446SYNOPSIS
    438         void bfd_print_symbol_vandf(PTR file, asymbol *symbol);
     447        void bfd_print_symbol_vandf (bfd *abfd, PTR file, asymbol *symbol);
    439448
    440449DESCRIPTION
     
    443452*/
    444453void
    445 bfd_print_symbol_vandf (arg, symbol)
     454bfd_print_symbol_vandf (abfd, arg, symbol)
     455     bfd *abfd;
    446456     PTR arg;
    447457     asymbol *symbol;
    448458{
    449459  FILE *file = (FILE *) arg;
     460
    450461  flagword type = symbol->flags;
     462
    451463  if (symbol->section != (asection *) NULL)
    452     {
    453       fprintf_vma (file, symbol->value + symbol->section->vma);
    454     }
     464    bfd_fprintf_vma (abfd, file,
     465                     symbol->value + symbol->section->vma);
    455466  else
    456     {
    457       fprintf_vma (file, symbol->value);
    458     }
     467    bfd_fprintf_vma (abfd, file, symbol->value);
    459468
    460469  /* This presumes that a symbol can not be both BSF_DEBUGGING and
     
    496505.#define bfd_make_empty_symbol(abfd) \
    497506.     BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
    498 */
     507.
     508*/
     509
     510/*
     511FUNCTION
     512        _bfd_generic_make_empty_symbol
     513
     514SYNOPSIS
     515        asymbol * _bfd_generic_make_empty_symbol (bfd *);
     516
     517DESCRIPTION
     518        Create a new <<asymbol>> structure for the BFD @var{abfd}
     519        and return a pointer to it.  Used by core file routines,
     520        binary back-end and anywhere else where no private info
     521        is needed.
     522*/
     523
     524asymbol *
     525_bfd_generic_make_empty_symbol (abfd)
     526     bfd *abfd;
     527{
     528  bfd_size_type amt = sizeof (asymbol);
     529  asymbol *new = (asymbol *) bfd_zalloc (abfd, amt);
     530  if (new)
     531    new->the_bfd = abfd;
     532  return new;
     533}
    499534
    500535/*
     
    509544.#define bfd_make_debug_symbol(abfd,ptr,size) \
    510545.        BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
     546.
    511547*/
    512548
    513549struct section_to_type
    514550{
    515   CONST char *section;
     551  const char *section;
    516552  char type;
    517553};
     
    520556   This table is probably incomplete.  It is sorted for convenience of
    521557   adding entries.  Since it is so short, a linear search is used.  */
    522 static CONST struct section_to_type stt[] =
    523 {
     558static const struct section_to_type stt[] =
     559{
     560  {".bss", 'b'},
     561  {"code", 't'},                /* MRI .text */
     562  {".data", 'd'},
    524563  {"*DEBUG*", 'N'},
    525   {".bss", 'b'},
    526   {"zerovars", 'b'},            /* MRI .bss */
    527   {".data", 'd'},
    528   {"vars", 'd'},                /* MRI .data */
     564  {".debug", 'N'},              /* MSVC's .debug (non-standard debug syms) */
     565  {".drectve", 'i'},            /* MSVC's .drective section */
     566  {".edata", 'e'},              /* MSVC's .edata (export) section */
     567  {".fini", 't'},               /* ELF fini section */
     568  {".idata", 'i'},              /* MSVC's .idata (import) section */
     569  {".init", 't'},               /* ELF init section */
     570  {".pdata", 'p'},              /* MSVC's .pdata (stack unwind) section */
    529571  {".rdata", 'r'},              /* Read only data.  */
    530572  {".rodata", 'r'},             /* Read only data.  */
     
    533575  {".sdata", 'g'},              /* Small initialized data.  */
    534576  {".text", 't'},
    535   {"code", 't'},                /* MRI .text */
    536   {".drectve", 'i'},            /* MSVC's .drective section */
    537   {".idata", 'i'},              /* MSVC's .idata (import) section */
    538   {".edata", 'e'},              /* MSVC's .edata (export) section */
    539   {".pdata", 'p'},              /* MSVC's .pdata (stack unwind) section */
    540   {".debug", 'N'},              /* MSVC's .debug (non-standard debug syms) */
     577  {"vars", 'd'},                /* MRI .data */
     578  {"zerovars", 'b'},            /* MRI .bss */
    541579  {0, 0}
    542580};
     
    552590     const char *s;
    553591{
    554   CONST struct section_to_type *t;
     592  const struct section_to_type *t;
    555593
    556594  for (t = &stt[0]; t->section; t++)
     
    561599}
    562600
    563 #ifndef islower
    564 #define islower(c) ((c) >= 'a' && (c) <= 'z')
    565 #endif
    566 #ifndef toupper
    567 #define toupper(c) (islower(c) ? ((c) & ~0x20) : (c))
    568 #endif
     601/* Return the single-character symbol type corresponding to section
     602   SECTION, or '?' for an unknown section.  This uses section flags to
     603   identify sections.
     604
     605   FIXME These types are unhandled: c, i, e, p.  If we handled these also,
     606   we could perhaps obsolete coff_section_type.  */
     607
     608static char
     609decode_section_type (section)
     610     const struct sec *section;
     611{
     612  if (section->flags & SEC_CODE)
     613    return 't';
     614  if (section->flags & SEC_DATA)
     615    {
     616      if (section->flags & SEC_READONLY)
     617        return 'r';
     618      else if (section->flags & SEC_SMALL_DATA)
     619        return 'g';
     620      else
     621        return 'd';
     622    }
     623  if ((section->flags & SEC_HAS_CONTENTS) == 0)
     624    {
     625      if (section->flags & SEC_SMALL_DATA)
     626        return 's';
     627      else
     628        return 'b';
     629    }
     630  if (section->flags & SEC_DEBUGGING)
     631    return 'N';
     632
     633  return '?';
     634}
    569635
    570636/*
     
    577643
    578644SYNOPSIS
    579         int bfd_decode_symclass(asymbol *symbol);
     645        int bfd_decode_symclass (asymbol *symbol);
    580646*/
    581647int
     
    624690    c = 'a';
    625691  else if (symbol->section)
    626     c = coff_section_type (symbol->section->name);
     692    {
     693      c = coff_section_type (symbol->section->name);
     694      if (c == '?')
     695        c = decode_section_type (symbol->section);
     696    }
    627697  else
    628698    return '?';
    629699  if (symbol->flags & BSF_GLOBAL)
    630     c = toupper (c);
     700    c = TOUPPER (c);
    631701  return c;
    632702
     
    651721
    652722SYNOPSIS
    653         boolean bfd_is_undefined_symclass (int symclass);
    654 */
    655 
    656 boolean
     723        bfd_boolean bfd_is_undefined_symclass (int symclass);
     724*/
     725
     726bfd_boolean
    657727bfd_is_undefined_symclass (symclass)
    658728     int symclass;
     
    671741
    672742SYNOPSIS
    673         void bfd_symbol_info(asymbol *symbol, symbol_info *ret);
     743        void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
    674744*/
    675745
     
    694764
    695765SYNOPSIS
    696         boolean bfd_copy_private_symbol_data(bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
     766        bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
    697767
    698768DESCRIPTION
    699769        Copy private symbol information from @var{isym} in the BFD
    700770        @var{ibfd} to the symbol @var{osym} in the BFD @var{obfd}.
    701         Return <<true>> on success, <<false>> on error.  Possible error
     771        Return <<TRUE>> on success, <<FALSE>> on error.  Possible error
    702772        returns are:
    703773
     
    708778.     BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
    709779.               (ibfd, isymbol, obfd, osymbol))
    710 
     780.
    711781*/
    712782
     
    718788_bfd_generic_read_minisymbols (abfd, dynamic, minisymsp, sizep)
    719789     bfd *abfd;
    720      boolean dynamic;
     790     bfd_boolean dynamic;
    721791     PTR *minisymsp;
    722792     unsigned int *sizep;
     
    732802  if (storage < 0)
    733803    goto error_return;
    734 
    735   syms = (asymbol **) bfd_malloc ((size_t) storage);
     804  if (storage == 0)
     805    return 0;
     806
     807  syms = (asymbol **) bfd_malloc ((bfd_size_type) storage);
    736808  if (syms == NULL)
    737809    goto error_return;
     
    749821
    750822 error_return:
     823  bfd_set_error (bfd_error_no_symbols);
    751824  if (syms != NULL)
    752825    free (syms);
     
    758831   we just return the asymbol the minisymbol points to.  */
    759832
    760 /*ARGSUSED*/
    761833asymbol *
    762834_bfd_generic_minisymbol_to_symbol (abfd, dynamic, minisym, sym)
    763835     bfd *abfd ATTRIBUTE_UNUSED;
    764      boolean dynamic ATTRIBUTE_UNUSED;
     836     bfd_boolean dynamic ATTRIBUTE_UNUSED;
    765837     const PTR minisym;
    766838     asymbol *sym ATTRIBUTE_UNUSED;
     
    772844   sections to find the source file and line closest to a desired
    773845   location.  This is used by COFF and ELF targets.  It sets *pfound
    774    to true if it finds some information.  The *pinfo field is used to
     846   to TRUE if it finds some information.  The *pinfo field is used to
    775847   pass cached information in and out of this routine; this first time
    776848   the routine is called for a BFD, *pinfo should be NULL.  The value
     
    844916};
    845917
    846 boolean
     918bfd_boolean
    847919_bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
    848920                                     pfilename, pfnname, pline, pinfo)
     
    851923     asection *section;
    852924     bfd_vma offset;
    853      boolean *pfound;
     925     bfd_boolean *pfound;
    854926     const char **pfilename;
    855927     const char **pfnname;
     
    863935  bfd_size_type stroff;
    864936  struct indexentry *indexentry;
    865   char *directory_name, *file_name;
     937  char *file_name;
     938  char *directory_name;
    866939  int saw_fun;
    867 
    868   *pfound = false;
     940  bfd_boolean saw_line, saw_func;
     941
     942  *pfound = FALSE;
    869943  *pfilename = bfd_get_filename (abfd);
    870944  *pfnname = NULL;
     
    897971        {
    898972          /* No stabs debugging information.  */
    899           return true;
     973          return TRUE;
    900974        }
    901975
     
    909983      int i;
    910984      char *name;
    911       char *file_name;
    912       char *directory_name;
    913985      char *function_name;
    914 
    915       info = (struct stab_find_info *) bfd_zalloc (abfd, sizeof *info);
     986      bfd_size_type amt = sizeof *info;
     987
     988      info = (struct stab_find_info *) bfd_zalloc (abfd, amt);
    916989      if (info == NULL)
    917         return false;
     990        return FALSE;
    918991
    919992      /* FIXME: When using the linker --split-by-file or
     
    9291002             can return quickly in the info != NULL case above.  */
    9301003          *pinfo = (PTR) info;
    931           return true;
     1004          return TRUE;
    9321005        }
    9331006
     
    9381011      info->strs = (bfd_byte *) bfd_alloc (abfd, strsize);
    9391012      if (info->stabs == NULL || info->strs == NULL)
    940         return false;
    941 
    942       if (! bfd_get_section_contents (abfd, info->stabsec, info->stabs, 0,
    943                                       stabsize)
    944           || ! bfd_get_section_contents (abfd, info->strsec, info->strs, 0,
    945                                          strsize))
    946         return false;
     1013        return FALSE;
     1014
     1015      if (! bfd_get_section_contents (abfd, info->stabsec, info->stabs,
     1016                                      (bfd_vma) 0, stabsize)
     1017          || ! bfd_get_section_contents (abfd, info->strsec, info->strs,
     1018                                         (bfd_vma) 0, strsize))
     1019        return FALSE;
    9471020
    9481021      /* If this is a relocateable object file, we have to relocate
     
    9521025      reloc_size = bfd_get_reloc_upper_bound (abfd, info->stabsec);
    9531026      if (reloc_size < 0)
    954         return false;
    955       reloc_vector = (arelent **) bfd_malloc (reloc_size);
     1027        return FALSE;
     1028      reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size);
    9561029      if (reloc_vector == NULL && reloc_size != 0)
    957         return false;
     1030        return FALSE;
    9581031      reloc_count = bfd_canonicalize_reloc (abfd, info->stabsec, reloc_vector,
    9591032                                            symbols);
     
    9621035          if (reloc_vector != NULL)
    9631036            free (reloc_vector);
    964           return false;
     1037          return FALSE;
    9651038        }
    9661039      if (reloc_count > 0)
     
    9871060                  if (reloc_vector != NULL)
    9881061                    free (reloc_vector);
    989                   return false;
     1062                  return FALSE;
    9901063                }
    9911064
     
    9941067              sym = *r->sym_ptr_ptr;
    9951068              val += sym->value + sym->section->vma + r->addend;
    996               bfd_put_32 (abfd, val, info->stabs + r->address);
     1069              bfd_put_32 (abfd, (bfd_vma) val, info->stabs + r->address);
    9971070            }
    9981071        }
     
    10111084      for (stab = info->stabs; stab < info->stabs + stabsize; stab += STABSIZE)
    10121085        {
    1013           if (stab[TYPEOFF] == N_SO)
     1086          if (stab[TYPEOFF] == (bfd_byte) N_SO)
    10141087            {
    10151088              /* N_SO with null name indicates EOF */
     
    10251098              /* two N_SO's in a row is a filename and directory. Skip */
    10261099              if (stab + STABSIZE < info->stabs + stabsize
    1027                   && *(stab + STABSIZE + TYPEOFF) == N_SO)
     1100                  && *(stab + STABSIZE + TYPEOFF) == (bfd_byte) N_SO)
    10281101                {
    10291102                  stab += STABSIZE;
    10301103                }
    10311104            }
    1032           else if (stab[TYPEOFF] == N_FUN)
     1105          else if (stab[TYPEOFF] == (bfd_byte) N_FUN)
    10331106            {
    10341107              saw_fun = 1;
     
    10411114
    10421115      if (info->indextablesize == 0)
    1043         return true;
     1116        return TRUE;
    10441117      ++info->indextablesize;
    10451118
    1046       info->indextable = ((struct indexentry *)
    1047                           bfd_alloc (abfd,
    1048                                      (sizeof (struct indexentry)
    1049                                       * info->indextablesize)));
     1119      amt = info->indextablesize;
     1120      amt *= sizeof (struct indexentry);
     1121      info->indextable = (struct indexentry *) bfd_alloc (abfd, amt);
    10501122      if (info->indextable == NULL)
    1051         return false;
     1123        return FALSE;
    10521124
    10531125      file_name = NULL;
     
    11001172                  last_stab = stab;
    11011173                  if (stab + STABSIZE >= info->stabs + stabsize
    1102                       || *(stab + STABSIZE + TYPEOFF) != N_SO)
     1174                      || *(stab + STABSIZE + TYPEOFF) != (bfd_byte) N_SO)
    11031175                    {
    11041176                      directory_name = NULL;
     
    11651237
    11661238      info->indextablesize = i;
    1167       qsort (info->indextable, i, sizeof (struct indexentry), cmpindexentry);
     1239      qsort (info->indextable, (size_t) i, sizeof (struct indexentry),
     1240             cmpindexentry);
    11681241
    11691242      *pinfo = (PTR) info;
     
    11861259#endif
    11871260    {
     1261      long low, high;
     1262      long mid = -1;
     1263
    11881264      /* Cache non-existant or invalid.  Do binary search on
    11891265         indextable.  */
    1190 
    1191       long low, high;
    1192       long mid = -1;
    1193 
    11941266      indexentry = NULL;
    11951267
     
    12131285
    12141286      if (indexentry == NULL)
    1215         return true;
     1287        return TRUE;
    12161288
    12171289      stab = indexentry->stab + STABSIZE;
     
    12221294  str = indexentry->str;
    12231295
     1296  saw_line = FALSE;
     1297  saw_func = FALSE;
    12241298  for (; stab < (indexentry+1)->stab; stab += STABSIZE)
    12251299    {
    1226       boolean done;
     1300      bfd_boolean done;
    12271301      bfd_vma val;
    12281302
    1229       done = false;
     1303      done = FALSE;
    12301304
    12311305      switch (stab[TYPEOFF])
     
    12441318        case N_DSLINE:
    12451319        case N_BSLINE:
    1246           /* A line number.  The value is relative to the start of the
    1247              current function.  */
    1248           val = indexentry->val + bfd_get_32 (abfd, stab + VALOFF);
    1249           if (val <= offset)
     1320          /* A line number.  If the function was specified, then the value
     1321             is relative to the start of the function.  Otherwise, the
     1322             value is an absolute address.  */
     1323          val = ((indexentry->function_name ? indexentry->val : 0)
     1324                 + bfd_get_32 (abfd, stab + VALOFF));
     1325          /* If this line starts before our desired offset, or if it's
     1326             the first line we've been able to find, use it.  The
     1327             !saw_line check works around a bug in GCC 2.95.3, which emits
     1328             the first N_SLINE late.  */
     1329          if (!saw_line || val <= offset)
    12501330            {
    12511331              *pline = bfd_get_16 (abfd, stab + DESCOFF);
     
    12591339            }
    12601340          if (val > offset)
    1261             done = true;
     1341            done = TRUE;
     1342          saw_line = TRUE;
    12621343          break;
    12631344
    12641345        case N_FUN:
    12651346        case N_SO:
    1266           done = true;
     1347          if (saw_func || saw_line)
     1348            done = TRUE;
     1349          saw_func = TRUE;
    12671350          break;
    12681351        }
     
    12721355    }
    12731356
    1274   *pfound = true;
    1275 
    1276   if (IS_ABSOLUTE_PATH(file_name) || directory_name == NULL)
     1357  *pfound = TRUE;
     1358
     1359  if (file_name == NULL || IS_ABSOLUTE_PATH (file_name)
     1360      || directory_name == NULL)
    12771361    *pfilename = file_name;
    12781362  else
     
    12851369          || strcmp (info->filename + dirlen, file_name) != 0)
    12861370        {
     1371          size_t len;
     1372
    12871373          if (info->filename != NULL)
    12881374            free (info->filename);
    1289           info->filename = (char *) bfd_malloc (dirlen +
    1290                                                 strlen (file_name)
    1291                                                 + 1);
     1375          len = strlen (file_name) + 1;
     1376          info->filename = (char *) bfd_malloc ((bfd_size_type) dirlen + len);
    12921377          if (info->filename == NULL)
    1293             return false;
    1294           strcpy (info->filename, directory_name);
    1295           strcpy (info->filename + dirlen, file_name);
     1378            return FALSE;
     1379          memcpy (info->filename, directory_name, dirlen);
     1380          memcpy (info->filename + dirlen, file_name, len);
    12961381        }
    12971382
     
    13061391         to clobber the colon.  It's OK to change the name, since the
    13071392         string is in our own local storage anyhow.  */
    1308 
    13091393      s = strchr (indexentry->function_name, ':');
    13101394      if (s != NULL)
     
    13141398    }
    13151399
    1316   return true;
     1400  return TRUE;
    13171401}
  • trunk/src/binutils/bfd/sysdep.h

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r617 r618  
    132132#endif
    133133
     134/* Define offsetof for those systems which lack it */
     135
     136#ifndef offsetof
     137#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
     138#endif
     139
    134140#ifdef ENABLE_NLS
    135141#include <libintl.h>
  • trunk/src/binutils/bfd/targets.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r617 r618  
    11/* Generic target-file-type support for the BFD library.
    22   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    3    2000, 2001
     3   2000, 2001, 2002, 2003
    44   Free Software Foundation, Inc.
    55   Written by Cygnus Support.
    66
    7 This file is part of BFD, the Binary File Descriptor library.
    8 
    9 This program is free software; you can redistribute it and/or modify
    10 it under the terms of the GNU General Public License as published by
    11 the Free Software Foundation; either version 2 of the License, or
    12 (at your option) any later version.
    13 
    14 This program is distributed in the hope that it will be useful,
    15 but WITHOUT ANY WARRANTY; without even the implied warranty of
    16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    17 GNU General Public License for more details.
    18 
    19 You should have received a copy of the GNU General Public License
    20 along with this program; if not, write to the Free Software
    21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
     7   This file is part of BFD, the Binary File Descriptor library.
     8
     9   This program is free software; you can redistribute it and/or modify
     10   it under the terms of the GNU General Public License as published by
     11   the Free Software Foundation; either version 2 of the License, or
     12   (at your option) any later version.
     13
     14   This program is distributed in the hope that it will be useful,
     15   but WITHOUT ANY WARRANTY; without even the implied warranty of
     16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     17   GNU General Public License for more details.
     18
     19   You should have received a copy of the GNU General Public License
     20   along with this program; if not, write to the Free Software
     21   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    2222
    2323#include "bfd.h"
     
    7171        If <<target_defaulted>> has been set, each possible target
    7272        type is tried to see if it recognizes the specified format.
    73         <<bfd_check_format>> returns <<true>> when the caller guesses right.
     73        <<bfd_check_format>> returns <<TRUE>> when the caller guesses right.
    7474@menu
    7575@* bfd_target::
     
    126126.   (bfd_assert (__FILE__,__LINE__), NULL))
    127127.#endif
    128 
     128.
    129129        This is the structure which defines the type of BFD this is.  The
    130130        <<xvec>> member of the struct <<bfd>> itself points here.  Each
     
    136136        macro to define them both!
    137137
    138 .enum bfd_flavour {
     138.enum bfd_flavour
     139.{
    139140.  bfd_target_unknown_flavour,
    140141.  bfd_target_aout_flavour,
     
    154155.  bfd_target_msdos_flavour,
    155156.  bfd_target_ovax_flavour,
    156 .  bfd_target_evax_flavour
     157.  bfd_target_evax_flavour,
     158.  bfd_target_mmo_flavour,
     159.  bfd_target_mach_o_flavour,
     160.  bfd_target_pef_flavour,
     161.  bfd_target_pef_xlib_flavour,
     162.  bfd_target_sym_flavour
    157163.};
    158164.
     
    164170.typedef struct bfd_target
    165171.{
    166 
    167 Identifies the kind of target, e.g., SunOS4, Ultrix, etc.
    168 
     172.  {* Identifies the kind of target, e.g., SunOS4, Ultrix, etc.  *}
    169173.  char *name;
    170 
    171 The "flavour" of a back end is a general indication about the contents
    172 of a file.
    173 
     174.
     175. {* The "flavour" of a back end is a general indication about
     176.    the contents of a file.  *}
    174177.  enum bfd_flavour flavour;
    175 
    176 The order of bytes within the data area of a file.
    177 
     178.
     179.  {* The order of bytes within the data area of a file.  *}
    178180.  enum bfd_endian byteorder;
    179 
    180 The order of bytes within the header parts of a file.
    181 
     181.
     182. {* The order of bytes within the header parts of a file.  *}
    182183.  enum bfd_endian header_byteorder;
    183 
    184 A mask of all the flags which an executable may have set -
    185 from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>.
    186 
     184.
     185.  {* A mask of all the flags which an executable may have set -
     186.     from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>.  *}
    187187.  flagword object_flags;
    188 
    189 A mask of all the flags which a section may have set - from
    190 the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>.
    191 
     188.
     189. {* A mask of all the flags which a section may have set - from
     190.    the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>.  *}
    192191.  flagword section_flags;
    193 
    194 The character normally found at the front of a symbol
    195 (if any), perhaps `_'.
    196 
     192.
     193. {* The character normally found at the front of a symbol.
     194.    (if any), perhaps `_'.  *}
    197195.  char symbol_leading_char;
    198 
    199 The pad character for file names within an archive header.
    200 
     196.
     197. {* The pad character for file names within an archive header.  *}
    201198.  char ar_pad_char;
    202 
    203 The maximum number of characters in an archive header.
    204 
     199.
     200.  {* The maximum number of characters in an archive header.  *}
    205201.  unsigned short ar_max_namelen;
    206 
    207 Entries for byte swapping for data. These are different from the other
    208 entry points, since they don't take a BFD asthe first argument.
    209 Certain other handlers could do the same.
    210 
    211 .  bfd_vma      (*bfd_getx64) PARAMS ((const bfd_byte *));
     202.
     203.  {* Entries for byte swapping for data. These are different from the
     204.     other entry points, since they don't take a BFD asthe first argument.
     205.     Certain other handlers could do the same.  *}
     206.  bfd_vma        (*bfd_getx64) PARAMS ((const bfd_byte *));
    212207.  bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *));
    213 .  void         (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));
    214 .  bfd_vma      (*bfd_getx32) PARAMS ((const bfd_byte *));
     208.  void           (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));
     209.  bfd_vma        (*bfd_getx32) PARAMS ((const bfd_byte *));
    215210.  bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((const bfd_byte *));
    216 .  void         (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *));
    217 .  bfd_vma      (*bfd_getx16) PARAMS ((const bfd_byte *));
     211.  void           (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *));
     212.  bfd_vma        (*bfd_getx16) PARAMS ((const bfd_byte *));
    218213.  bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *));
    219 .  void         (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *));
    220 
    221 Byte swapping for the headers
    222 
    223 .  bfd_vma      (*bfd_h_getx64) PARAMS ((const bfd_byte *));
     214.  void           (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *));
     215.
     216.  {* Byte swapping for the headers.  *}
     217.  bfd_vma        (*bfd_h_getx64) PARAMS ((const bfd_byte *));
    224218.  bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *));
    225 .  void         (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));
    226 .  bfd_vma      (*bfd_h_getx32) PARAMS ((const bfd_byte *));
     219.  void           (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));
     220.  bfd_vma        (*bfd_h_getx32) PARAMS ((const bfd_byte *));
    227221.  bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((const bfd_byte *));
    228 .  void         (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *));
    229 .  bfd_vma      (*bfd_h_getx16) PARAMS ((const bfd_byte *));
     222.  void           (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *));
     223.  bfd_vma        (*bfd_h_getx16) PARAMS ((const bfd_byte *));
    230224.  bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *));
    231 .  void         (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *));
    232 
    233 Format dependent routines: these are vectors of entry points
    234 within the target vector structure, one for each format to check.
    235 
    236 Check the format of a file being read.  Return a <<bfd_target *>> or zero.
    237 
     225.  void           (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *));
     226.
     227.  {* Format dependent routines: these are vectors of entry points
     228.     within the target vector structure, one for each format to check.  *}
     229.
     230.  {* Check the format of a file being read.  Return a <<bfd_target *>> or zero.  *}
    238231.  const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *));
    239 
    240 Set the format of a file being written.
    241 
    242 .  boolean             (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *));
    243 
    244 Write cached information into a file being written, at <<bfd_close>>.
    245 
    246 .  boolean             (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *));
    247 
     232.
     233.  {* Set the format of a file being written.  *}
     234.  bfd_boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *));
     235.
     236.  {* Write cached information into a file being written, at <<bfd_close>>.  *}
     237.  bfd_boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *));
     238.
    248239The general target vector.  These vectors are initialized using the
    249240BFD_JUMP_TABLE macros.
    250 
    251241.
    252242.  {* Generic entry points.  *}
    253 .#define BFD_JUMP_TABLE_GENERIC(NAME)\
    254 .CAT(NAME,_close_and_cleanup),\
    255 .CAT(NAME,_bfd_free_cached_info),\
    256 .CAT(NAME,_new_section_hook),\
    257 .CAT(NAME,_get_section_contents),\
    258 .CAT(NAME,_get_section_contents_in_window)
     243Do not "beautify" the CONCAT* macro args.  Traditional C will not
     244remove whitespace added here, and thus will fail to concatenate
     245the tokens.
     246.#define BFD_JUMP_TABLE_GENERIC(NAME) \
     247.CONCAT2 (NAME,_close_and_cleanup), \
     248.CONCAT2 (NAME,_bfd_free_cached_info), \
     249.CONCAT2 (NAME,_new_section_hook), \
     250.CONCAT2 (NAME,_get_section_contents), \
     251.CONCAT2 (NAME,_get_section_contents_in_window)
    259252.
    260253.  {* Called when the BFD is being closed to do any necessary cleanup.  *}
    261 .  boolean      (*_close_and_cleanup) PARAMS ((bfd *));
     254.  bfd_boolean (*_close_and_cleanup) PARAMS ((bfd *));
    262255.  {* Ask the BFD to free all cached information.  *}
    263 .  boolean (*_bfd_free_cached_info) PARAMS ((bfd *));
     256.  bfd_boolean (*_bfd_free_cached_info) PARAMS ((bfd *));
    264257.  {* Called when a new section is created.  *}
    265 .  boolean      (*_new_section_hook) PARAMS ((bfd *, sec_ptr));
     258.  bfd_boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr));
    266259.  {* Read the contents of a section.  *}
    267 .  boolean       (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
    268 .                                            file_ptr, bfd_size_type));
    269 .  boolean       (*_bfd_get_section_contents_in_window)
    270 .                          PARAMS ((bfd *, sec_ptr, bfd_window *,
    271 .                                   file_ptr, bfd_size_type));
     260.  bfd_boolean (*_bfd_get_section_contents)
     261.    PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type));
     262.  bfd_boolean (*_bfd_get_section_contents_in_window)
     263.    PARAMS ((bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type));
    272264.
    273265.  {* Entry points to copy private data.  *}
    274 .#define BFD_JUMP_TABLE_COPY(NAME)\
    275 .CAT(NAME,_bfd_copy_private_bfd_data),\
    276 .CAT(NAME,_bfd_merge_private_bfd_data),\
    277 .CAT(NAME,_bfd_copy_private_section_data),\
    278 .CAT(NAME,_bfd_copy_private_symbol_data),\
    279 .CAT(NAME,_bfd_set_private_flags),\
    280 .CAT(NAME,_bfd_print_private_bfd_data)\
     266.#define BFD_JUMP_TABLE_COPY(NAME) \
     267.CONCAT2 (NAME,_bfd_copy_private_bfd_data), \
     268.CONCAT2 (NAME,_bfd_merge_private_bfd_data), \
     269.CONCAT2 (NAME,_bfd_copy_private_section_data), \
     270.CONCAT2 (NAME,_bfd_copy_private_symbol_data), \
     271.CONCAT2 (NAME,_bfd_set_private_flags), \
     272.CONCAT2 (NAME,_bfd_print_private_bfd_data) \
    281273.  {* Called to copy BFD general private data from one object file
    282274.     to another.  *}
    283 .  boolean      (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));
     275.  bfd_boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));
    284276.  {* Called to merge BFD general private data from one object file
    285277.     to a common output file when linking.  *}
    286 .  boolean      (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *));
     278.  bfd_boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *));
    287279.  {* Called to copy BFD private section data from one object file
    288280.     to another.  *}
    289 .  boolean       (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr,
    290 .                                                      bfd *, sec_ptr));
     281.  bfd_boolean (*_bfd_copy_private_section_data)
     282.    PARAMS ((bfd *, sec_ptr, bfd *, sec_ptr));
    291283.  {* Called to copy BFD private symbol data from one symbol
    292284.     to another.  *}
    293 .  boolean       (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *,
    294 .                                                          bfd *, asymbol *));
    295 .  {* Called to set private backend flags *}
    296 .  boolean      (*_bfd_set_private_flags) PARAMS ((bfd *, flagword));
    297 .
    298 .  {* Called to print private BFD data *}
    299 .  boolean      (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR));
     285.  bfd_boolean (*_bfd_copy_private_symbol_data)
     286.    PARAMS ((bfd *, asymbol *, bfd *, asymbol *));
     287.  {* Called to set private backend flags. *}
     288.  bfd_boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword));
     289.
     290.  {* Called to print private BFD data. *}
     291.  bfd_boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR));
    300292.
    301293.  {* Core file entry points.  *}
    302 .#define BFD_JUMP_TABLE_CORE(NAME)\
    303 .CAT(NAME,_core_file_failing_command),\
    304 .CAT(NAME,_core_file_failing_signal),\
    305 .CAT(NAME,_core_file_matches_executable_p)
    306 .  char *   (*_core_file_failing_command) PARAMS ((bfd *));
    307 .  int      (*_core_file_failing_signal) PARAMS ((bfd *));
    308 .  boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *));
     294.#define BFD_JUMP_TABLE_CORE(NAME) \
     295.CONCAT2 (NAME,_core_file_failing_command), \
     296.CONCAT2 (NAME,_core_file_failing_signal), \
     297.CONCAT2 (NAME,_core_file_matches_executable_p)
     298.  char *      (*_core_file_failing_command) PARAMS ((bfd *));
     299.  int         (*_core_file_failing_signal) PARAMS ((bfd *));
     300.  bfd_boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *));
    309301.
    310302.  {* Archive entry points.  *}
    311 .#define BFD_JUMP_TABLE_ARCHIVE(NAME)\
    312 .CAT(NAME,_slurp_armap),\
    313 .CAT(NAME,_slurp_extended_name_table),\
    314 .CAT(NAME,_construct_extended_name_table),\
    315 .CAT(NAME,_truncate_arname),\
    316 .CAT(NAME,_write_armap),\
    317 .CAT(NAME,_read_ar_hdr),\
    318 .CAT(NAME,_openr_next_archived_file),\
    319 .CAT(NAME,_get_elt_at_index),\
    320 .CAT(NAME,_generic_stat_arch_elt),\
    321 .CAT(NAME,_update_armap_timestamp)
    322 .  boolean  (*_bfd_slurp_armap) PARAMS ((bfd *));
    323 .  boolean  (*_bfd_slurp_extended_name_table) PARAMS ((bfd *));
    324 .  boolean  (*_bfd_construct_extended_name_table)
    325 .             PARAMS ((bfd *, char **, bfd_size_type *, const char **));
    326 .  void     (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *));
    327 .  boolean  (*write_armap) PARAMS ((bfd *arch,
    328 .                              unsigned int elength,
    329 .                              struct orl *map,
    330 .                              unsigned int orl_count,
    331 .                              int stridx));
    332 .  PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *));
    333 .  bfd *    (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev));
     303.#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
     304.CONCAT2 (NAME,_slurp_armap), \
     305.CONCAT2 (NAME,_slurp_extended_name_table), \
     306.CONCAT2 (NAME,_construct_extended_name_table), \
     307.CONCAT2 (NAME,_truncate_arname), \
     308.CONCAT2 (NAME,_write_armap), \
     309.CONCAT2 (NAME,_read_ar_hdr), \
     310.CONCAT2 (NAME,_openr_next_archived_file), \
     311.CONCAT2 (NAME,_get_elt_at_index), \
     312.CONCAT2 (NAME,_generic_stat_arch_elt), \
     313.CONCAT2 (NAME,_update_armap_timestamp)
     314.  bfd_boolean (*_bfd_slurp_armap) PARAMS ((bfd *));
     315.  bfd_boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *));
     316.  bfd_boolean (*_bfd_construct_extended_name_table)
     317.    PARAMS ((bfd *, char **, bfd_size_type *, const char **));
     318.  void        (*_bfd_truncate_arname) PARAMS ((bfd *, const char *, char *));
     319.  bfd_boolean (*write_armap)
     320.    PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int));
     321.  PTR         (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *));
     322.  bfd *       (*openr_next_archived_file) PARAMS ((bfd *, bfd *));
    334323.#define bfd_get_elt_at_index(b,i) BFD_SEND(b, _bfd_get_elt_at_index, (b,i))
    335 .  bfd *    (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex));
    336 .  int      (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));
    337 .  boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *));
     324.  bfd *       (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex));
     325.  int         (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));
     326.  bfd_boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *));
    338327.
    339328.  {* Entry points used for symbols.  *}
    340 .#define BFD_JUMP_TABLE_SYMBOLS(NAME)\
    341 .CAT(NAME,_get_symtab_upper_bound),\
    342 .CAT(NAME,_get_symtab),\
    343 .CAT(NAME,_make_empty_symbol),\
    344 .CAT(NAME,_print_symbol),\
    345 .CAT(NAME,_get_symbol_info),\
    346 .CAT(NAME,_bfd_is_local_label_name),\
    347 .CAT(NAME,_get_lineno),\
    348 .CAT(NAME,_find_nearest_line),\
    349 .CAT(NAME,_bfd_make_debug_symbol),\
    350 .CAT(NAME,_read_minisymbols),\
    351 .CAT(NAME,_minisymbol_to_symbol)
    352 .  long  (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *));
    353 .  long  (*_bfd_canonicalize_symtab) PARAMS ((bfd *,
    354 .                                             struct symbol_cache_entry **));
    355 .  struct symbol_cache_entry  *
    356 .                (*_bfd_make_empty_symbol) PARAMS ((bfd *));
    357 .  void          (*_bfd_print_symbol) PARAMS ((bfd *, PTR,
    358 .                                      struct symbol_cache_entry *,
    359 .                                      bfd_print_symbol_type));
     329.#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
     330.CONCAT2 (NAME,_get_symtab_upper_bound), \
     331.CONCAT2 (NAME,_get_symtab), \
     332.CONCAT2 (NAME,_make_empty_symbol), \
     333.CONCAT2 (NAME,_print_symbol), \
     334.CONCAT2 (NAME,_get_symbol_info), \
     335.CONCAT2 (NAME,_bfd_is_local_label_name), \
     336.CONCAT2 (NAME,_get_lineno), \
     337.CONCAT2 (NAME,_find_nearest_line), \
     338.CONCAT2 (NAME,_bfd_make_debug_symbol), \
     339.CONCAT2 (NAME,_read_minisymbols), \
     340.CONCAT2 (NAME,_minisymbol_to_symbol)
     341.  long        (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *));
     342.  long        (*_bfd_canonicalize_symtab) PARAMS ((bfd *,
     343.                                                struct symbol_cache_entry **));
     344.  struct symbol_cache_entry *
     345.              (*_bfd_make_empty_symbol) PARAMS ((bfd *));
     346.  void        (*_bfd_print_symbol)
     347.    PARAMS ((bfd *, PTR, struct symbol_cache_entry *, bfd_print_symbol_type));
    360348.#define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e))
    361 .  void          (*_bfd_get_symbol_info) PARAMS ((bfd *,
    362 .                                      struct symbol_cache_entry *,
    363 .                                      symbol_info *));
     349.  void        (*_bfd_get_symbol_info)
     350.    PARAMS ((bfd *, struct symbol_cache_entry *, symbol_info *));
    364351.#define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e))
    365 .  boolean       (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *));
    366 .
    367 .  alent *    (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *));
    368 .  boolean    (*_bfd_find_nearest_line) PARAMS ((bfd *abfd,
    369 .                    struct sec *section, struct symbol_cache_entry **symbols,
    370 .                    bfd_vma offset, CONST char **file, CONST char **func,
    371 .                    unsigned int *line));
     352.  bfd_boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *));
     353.
     354.  alent *     (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *));
     355.  bfd_boolean (*_bfd_find_nearest_line)
     356.    PARAMS ((bfd *, struct sec *, struct symbol_cache_entry **, bfd_vma,
     357.             const char **, const char **, unsigned int *));
    372358. {* Back-door to allow format-aware applications to create debug symbols
    373359.    while using BFD for everything else.  Currently used by the assembler
    374360.    when creating COFF files.  *}
    375 .  asymbol *  (*_bfd_make_debug_symbol) PARAMS ((
    376 .       bfd *abfd,
    377 .       void *ptr,
    378 .       unsigned long size));
     361.  asymbol *   (*_bfd_make_debug_symbol)
     362.    PARAMS ((bfd *, void *, unsigned long size));
    379363.#define bfd_read_minisymbols(b, d, m, s) \
    380364.  BFD_SEND (b, _read_minisymbols, (b, d, m, s))
    381 .  long  (*_read_minisymbols) PARAMS ((bfd *, boolean, PTR *,
    382 .                                      unsigned int *));
     365.  long        (*_read_minisymbols)
     366.    PARAMS ((bfd *, bfd_boolean, PTR *, unsigned int *));
    383367.#define bfd_minisymbol_to_symbol(b, d, m, f) \
    384368.  BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
    385 .  asymbol *(*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR,
    386 .                                            asymbol *));
     369.  asymbol *   (*_minisymbol_to_symbol)
     370.    PARAMS ((bfd *, bfd_boolean, const PTR, asymbol *));
    387371.
    388372.  {* Routines for relocs.  *}
    389 .#define BFD_JUMP_TABLE_RELOCS(NAME)\
    390 .CAT(NAME,_get_reloc_upper_bound),\
    391 .CAT(NAME,_canonicalize_reloc),\
    392 .CAT(NAME,_bfd_reloc_type_lookup)
    393 .  long  (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));
    394 .  long  (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **,
    395 .                                            struct symbol_cache_entry **));
     373.#define BFD_JUMP_TABLE_RELOCS(NAME) \
     374.CONCAT2 (NAME,_get_reloc_upper_bound), \
     375.CONCAT2 (NAME,_canonicalize_reloc), \
     376.CONCAT2 (NAME,_bfd_reloc_type_lookup)
     377.  long        (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));
     378.  long        (*_bfd_canonicalize_reloc)
     379.    PARAMS ((bfd *, sec_ptr, arelent **, struct symbol_cache_entry **));
    396380.  {* See documentation on reloc types.  *}
    397381.  reloc_howto_type *
    398 .       (*reloc_type_lookup) PARAMS ((bfd *abfd,
    399 .                                     bfd_reloc_code_real_type code));
     382.              (*reloc_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type));
    400383.
    401384.  {* Routines used when writing an object file.  *}
    402 .#define BFD_JUMP_TABLE_WRITE(NAME)\
    403 .CAT(NAME,_set_arch_mach),\
    404 .CAT(NAME,_set_section_contents)
    405 .  boolean    (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture,
    406 .                    unsigned long));
    407 .  boolean       (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
    408 .                                            file_ptr, bfd_size_type));
     385.#define BFD_JUMP_TABLE_WRITE(NAME) \
     386.CONCAT2 (NAME,_set_arch_mach), \
     387.CONCAT2 (NAME,_set_section_contents)
     388.  bfd_boolean (*_bfd_set_arch_mach)
     389.    PARAMS ((bfd *, enum bfd_architecture, unsigned long));
     390.  bfd_boolean (*_bfd_set_section_contents)
     391.    PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type));
    409392.
    410393.  {* Routines used by the linker.  *}
    411 .#define BFD_JUMP_TABLE_LINK(NAME)\
    412 .CAT(NAME,_sizeof_headers),\
    413 .CAT(NAME,_bfd_get_relocated_section_contents),\
    414 .CAT(NAME,_bfd_relax_section),\
    415 .CAT(NAME,_bfd_link_hash_table_create),\
    416 .CAT(NAME,_bfd_link_add_symbols),\
    417 .CAT(NAME,_bfd_final_link),\
    418 .CAT(NAME,_bfd_link_split_section),\
    419 .CAT(NAME,_bfd_gc_sections)
    420 .  int        (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean));
    421 .  bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *,
    422 .                    struct bfd_link_info *, struct bfd_link_order *,
    423 .                    bfd_byte *data, boolean relocateable,
    424 .                    struct symbol_cache_entry **));
    425 .
    426 .  boolean    (*_bfd_relax_section) PARAMS ((bfd *, struct sec *,
    427 .                    struct bfd_link_info *, boolean *again));
     394.#define BFD_JUMP_TABLE_LINK(NAME) \
     395.CONCAT2 (NAME,_sizeof_headers), \
     396.CONCAT2 (NAME,_bfd_get_relocated_section_contents), \
     397.CONCAT2 (NAME,_bfd_relax_section), \
     398.CONCAT2 (NAME,_bfd_link_hash_table_create), \
     399.CONCAT2 (NAME,_bfd_link_hash_table_free), \
     400.CONCAT2 (NAME,_bfd_link_add_symbols), \
     401.CONCAT2 (NAME,_bfd_link_just_syms), \
     402.CONCAT2 (NAME,_bfd_final_link), \
     403.CONCAT2 (NAME,_bfd_link_split_section), \
     404.CONCAT2 (NAME,_bfd_gc_sections), \
     405.CONCAT2 (NAME,_bfd_merge_sections), \
     406.CONCAT2 (NAME,_bfd_discard_group)
     407.  int         (*_bfd_sizeof_headers) PARAMS ((bfd *, bfd_boolean));
     408.  bfd_byte *  (*_bfd_get_relocated_section_contents)
     409.    PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *,
     410.             bfd_byte *, bfd_boolean, struct symbol_cache_entry **));
     411.
     412.  bfd_boolean (*_bfd_relax_section)
     413.    PARAMS ((bfd *, struct sec *, struct bfd_link_info *, bfd_boolean *));
    428414.
    429415.  {* Create a hash table for the linker.  Different backends store
    430416.     different information in this table.  *}
    431 .  struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *));
     417.  struct bfd_link_hash_table *
     418.              (*_bfd_link_hash_table_create) PARAMS ((bfd *));
     419.
     420.  {* Release the memory associated with the linker hash table.  *}
     421.  void        (*_bfd_link_hash_table_free)
     422.    PARAMS ((struct bfd_link_hash_table *));
    432423.
    433424.  {* Add symbols from this object file into the hash table.  *}
    434 .  boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *));
     425.  bfd_boolean (*_bfd_link_add_symbols)
     426.    PARAMS ((bfd *, struct bfd_link_info *));
     427.
     428.  {* Indicate that we are only retrieving symbol values from this section.  *}
     429.  void        (*_bfd_link_just_syms)
     430.    PARAMS ((asection *, struct bfd_link_info *));
    435431.
    436432.  {* Do a link based on the link_order structures attached to each
    437433.     section of the BFD.  *}
    438 .  boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));
     434.  bfd_boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));
    439435.
    440436.  {* Should this section be split up into smaller pieces during linking.  *}
    441 .  boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *));
     437.  bfd_boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *));
    442438.
    443439.  {* Remove sections that are not referenced from the output.  *}
    444 .  boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *));
     440.  bfd_boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *));
     441.
     442.  {* Attempt to merge SEC_MERGE sections.  *}
     443.  bfd_boolean (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *));
     444.
     445.  {* Discard members of a group.  *}
     446.  bfd_boolean (*_bfd_discard_group) PARAMS ((bfd *, struct sec *));
    445447.
    446448.  {* Routines to handle dynamic symbols and relocs.  *}
    447 .#define BFD_JUMP_TABLE_DYNAMIC(NAME)\
    448 .CAT(NAME,_get_dynamic_symtab_upper_bound),\
    449 .CAT(NAME,_canonicalize_dynamic_symtab),\
    450 .CAT(NAME,_get_dynamic_reloc_upper_bound),\
    451 .CAT(NAME,_canonicalize_dynamic_reloc)
    452 .  {* Get the amount of memory required to hold the dynamic symbols. *}
    453 .  long  (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *));
     449.#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
     450.CONCAT2 (NAME,_get_dynamic_symtab_upper_bound), \
     451.CONCAT2 (NAME,_canonicalize_dynamic_symtab), \
     452.CONCAT2 (NAME,_get_dynamic_reloc_upper_bound), \
     453.CONCAT2 (NAME,_canonicalize_dynamic_reloc)
     454.  {* Get the amount of memory required to hold the dynamic symbols.  *}
     455.  long        (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *));
    454456.  {* Read in the dynamic symbols.  *}
    455 .  long  (*_bfd_canonicalize_dynamic_symtab)
     457.  long        (*_bfd_canonicalize_dynamic_symtab)
    456458.    PARAMS ((bfd *, struct symbol_cache_entry **));
    457459.  {* Get the amount of memory required to hold the dynamic relocs.  *}
    458 .  long  (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *));
     460.  long        (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *));
    459461.  {* Read in the dynamic relocs.  *}
    460 .  long  (*_bfd_canonicalize_dynamic_reloc)
     462.  long        (*_bfd_canonicalize_dynamic_reloc)
    461463.    PARAMS ((bfd *, arelent **, struct symbol_cache_entry **));
    462464.
     
    468470to find an alternative output format that is suitable.
    469471
    470 . {* Opposite endian version of this target.  *}
    471 . const struct bfd_target * alternative_target;
    472 .
    473 
    474 Data for use by back-end routines, which isn't generic enough to belong
    475 in this structure.
    476 
    477 . PTR backend_data;
     472.  {* Opposite endian version of this target.  *}
     473.  const struct bfd_target * alternative_target;
     474.
     475
     476.  {* Data for use by back-end routines, which isn't
     477.     generic enough to belong in this structure.  *}
     478.  PTR backend_data;
    478479.
    479480.} bfd_target;
    480 
     481.
    481482*/
    482483
     
    487488extern const bfd_target a29kcoff_big_vec;
    488489extern const bfd_target a_out_adobe_vec;
     490extern const bfd_target aix5coff64_vec;
    489491extern const bfd_target aout0_big_vec;
    490492extern const bfd_target aout_arm_big_vec;
     
    517519extern const bfd_target bfd_elf32_d10v_vec;
    518520extern const bfd_target bfd_elf32_d30v_vec;
     521extern const bfd_target bfd_elf32_dlx_big_vec;
    519522extern const bfd_target bfd_elf32_fr30_vec;
     523extern const bfd_target bfd_elf32_frv_vec;
     524extern const bfd_target bfd_elf32_h8300_vec;
    520525extern const bfd_target bfd_elf32_hppa_linux_vec;
    521526extern const bfd_target bfd_elf32_hppa_vec;
    522527extern const bfd_target bfd_elf32_i370_vec;
     528extern const bfd_target bfd_elf32_i386_freebsd_vec;
    523529extern const bfd_target bfd_elf32_i386_vec;
    524530extern const bfd_target bfd_elf32_i860_little_vec;
     
    526532extern const bfd_target bfd_elf32_i960_vec;
    527533extern const bfd_target bfd_elf32_ia64_big_vec;
     534extern const bfd_target bfd_elf32_ia64_hpux_big_vec;
     535extern const bfd_target bfd_elf32_ip2k_vec;
     536extern const bfd_target bfd_elf32_iq2000_vec;
    528537extern const bfd_target bfd_elf32_little_generic_vec;
    529538extern const bfd_target bfd_elf32_littlearc_vec;
     
    540549extern const bfd_target bfd_elf32_mn10200_vec;
    541550extern const bfd_target bfd_elf32_mn10300_vec;
     551extern const bfd_target bfd_elf32_msp430_vec;
     552extern const bfd_target bfd_elf32_nbigmips_vec;
     553extern const bfd_target bfd_elf32_nlittlemips_vec;
     554extern const bfd_target bfd_elf32_ntradbigmips_vec;
     555extern const bfd_target bfd_elf32_ntradlittlemips_vec;
     556extern const bfd_target bfd_elf32_openrisc_vec;
     557extern const bfd_target bfd_elf32_or32_big_vec;
    542558extern const bfd_target bfd_elf32_pj_vec;
    543559extern const bfd_target bfd_elf32_pjl_vec;
    544560extern const bfd_target bfd_elf32_powerpc_vec;
    545561extern const bfd_target bfd_elf32_powerpcle_vec;
     562extern const bfd_target bfd_elf32_s390_vec;
     563extern const bfd_target bfd_elf32_sh64_vec;
     564extern const bfd_target bfd_elf32_sh64l_vec;
     565extern const bfd_target bfd_elf32_sh64lin_vec;
     566extern const bfd_target bfd_elf32_sh64blin_vec;
     567extern const bfd_target bfd_elf32_sh64lnbsd_vec;
     568extern const bfd_target bfd_elf32_sh64nbsd_vec;
    546569extern const bfd_target bfd_elf32_sh_vec;
    547570extern const bfd_target bfd_elf32_shblin_vec;
    548571extern const bfd_target bfd_elf32_shl_vec;
    549572extern const bfd_target bfd_elf32_shlin_vec;
     573extern const bfd_target bfd_elf32_shlnbsd_vec;
     574extern const bfd_target bfd_elf32_shnbsd_vec;
    550575extern const bfd_target bfd_elf32_sparc_vec;
    551576extern const bfd_target bfd_elf32_tradbigmips_vec;
     
    553578extern const bfd_target bfd_elf32_us_cris_vec;
    554579extern const bfd_target bfd_elf32_v850_vec;
     580extern const bfd_target bfd_elf32_vax_vec;
     581extern const bfd_target bfd_elf32_xstormy16_vec;
     582extern const bfd_target bfd_elf32_xtensa_be_vec;
     583extern const bfd_target bfd_elf32_xtensa_le_vec;
     584extern const bfd_target bfd_elf64_alpha_freebsd_vec;
    555585extern const bfd_target bfd_elf64_alpha_vec;
    556586extern const bfd_target bfd_elf64_big_generic_vec;
     
    558588extern const bfd_target bfd_elf64_hppa_linux_vec;
    559589extern const bfd_target bfd_elf64_hppa_vec;
     590extern const bfd_target bfd_elf64_ia64_aix_big_vec;
     591extern const bfd_target bfd_elf64_ia64_aix_little_vec;
    560592extern const bfd_target bfd_elf64_ia64_big_vec;
     593extern const bfd_target bfd_elf64_ia64_hpux_big_vec;
    561594extern const bfd_target bfd_elf64_ia64_little_vec;
    562595extern const bfd_target bfd_elf64_little_generic_vec;
    563596extern const bfd_target bfd_elf64_littlemips_vec;
     597extern const bfd_target bfd_elf64_mmix_vec;
     598extern const bfd_target bfd_elf64_powerpc_vec;
     599extern const bfd_target bfd_elf64_powerpcle_vec;
     600extern const bfd_target bfd_elf64_s390_vec;
     601extern const bfd_target bfd_elf64_sh64_vec;
     602extern const bfd_target bfd_elf64_sh64l_vec;
     603extern const bfd_target bfd_elf64_sh64lin_vec;
     604extern const bfd_target bfd_elf64_sh64blin_vec;
     605extern const bfd_target bfd_elf64_sh64lnbsd_vec;
     606extern const bfd_target bfd_elf64_sh64nbsd_vec;
     607extern const bfd_target bfd_elf64_sparc_vec;
    564608extern const bfd_target bfd_elf64_tradbigmips_vec;
    565609extern const bfd_target bfd_elf64_tradlittlemips_vec;
    566 extern const bfd_target bfd_elf64_sparc_vec;
    567610extern const bfd_target bfd_elf64_x86_64_vec;
     611extern const bfd_target bfd_mmo_vec;
    568612extern const bfd_target bfd_powerpc_pe_vec;
    569613extern const bfd_target bfd_powerpc_pei_vec;
     
    613657extern const bfd_target m88kbcs_vec;
    614658extern const bfd_target m88kmach3_vec;
     659extern const bfd_target mach_o_be_vec;
     660extern const bfd_target mach_o_le_vec;
     661extern const bfd_target mach_o_fat_vec;
    615662extern const bfd_target mcore_pe_big_vec;
    616663extern const bfd_target mcore_pe_little_vec;
     
    625672extern const bfd_target nlm32_sparc_vec;
    626673extern const bfd_target oasys_vec;
     674extern const bfd_target or32coff_big_vec;
    627675extern const bfd_target pc532machaout_vec;
    628676extern const bfd_target pc532netbsd_vec;
     677extern const bfd_target pdp11_aout_vec;
     678extern const bfd_target pef_vec;
     679extern const bfd_target pef_xlib_vec;
    629680extern const bfd_target pmac_xcoff_vec;
    630681extern const bfd_target ppcboot_vec;
     
    646697extern const bfd_target sparcnetbsd_vec;
    647698extern const bfd_target sunos_big_vec;
    648 extern const bfd_target tekhex_vec;
     699extern const bfd_target sym_vec;
    649700extern const bfd_target tic30_aout_vec;
    650701extern const bfd_target tic30_coff_vec;
     702extern const bfd_target tic4x_coff0_beh_vec;
     703extern const bfd_target tic4x_coff0_vec;
     704extern const bfd_target tic4x_coff1_beh_vec;
     705extern const bfd_target tic4x_coff1_vec;
     706extern const bfd_target tic4x_coff2_beh_vec;
     707extern const bfd_target tic4x_coff2_vec;
    651708extern const bfd_target tic54x_coff0_beh_vec;
    652709extern const bfd_target tic54x_coff0_vec;
     
    656713extern const bfd_target tic54x_coff2_vec;
    657714extern const bfd_target tic80coff_vec;
     715extern const bfd_target vaxbsd_vec;
    658716extern const bfd_target vaxnetbsd_vec;
     717extern const bfd_target vax1knetbsd_vec;
    659718extern const bfd_target versados_vec;
    660719extern const bfd_target vms_alpha_vec;
     
    664723extern const bfd_target z8kcoff_vec;
    665724
    666 /* srec is always included.  */
     725/* These are always included.  */
    667726extern const bfd_target srec_vec;
    668727extern const bfd_target symbolsrec_vec;
    669 
    670 /* binary is always included.  */
     728extern const bfd_target tekhex_vec;
    671729extern const bfd_target binary_vec;
    672 
    673 /* ihex is always included.  */
    674730extern const bfd_target ihex_vec;
    675731
     
    678734extern const bfd_target cisco_core_big_vec;
    679735extern const bfd_target cisco_core_little_vec;
     736extern const bfd_target hppabsd_core_vec;
    680737extern const bfd_target hpux_core_vec;
    681 extern const bfd_target hppabsd_core_vec;
    682738extern const bfd_target irix_core_vec;
    683739extern const bfd_target netbsd_core_vec;
    684740extern const bfd_target osf_core_vec;
     741extern const bfd_target ptrace_core_vec;
    685742extern const bfd_target sco5_core_vec;
    686743extern const bfd_target trad_core_vec;
    687 extern const bfd_target ptrace_core_vec;
    688744
    689745static const bfd_target * const _bfd_target_vector[] = {
     
    706762        &a29kcoff_big_vec,
    707763        &a_out_adobe_vec,
    708 #if 0                           /* No one seems to use this.  */
     764#ifdef BFD64
     765        &aix5coff64_vec,
     766#endif
     767        &aout0_big_vec,
     768#if 0
     769        /* We have no way of distinguishing these from other a.out variants.  */
     770        &aout_arm_big_vec,
     771        &aout_arm_little_vec,
     772        /* No one seems to use this.  */
    709773        &aout_mips_big_vec,
    710774#endif
    711775        &aout_mips_little_vec,
     776#if 0
     777        &apollocoff_vec,
     778#endif
     779        &arm_epoc_pe_big_vec,
     780        &arm_epoc_pe_little_vec,
     781        &arm_epoc_pei_big_vec,
     782        &arm_epoc_pei_little_vec,
     783        &armcoff_big_vec,
     784        &armcoff_little_vec,
     785        &armnetbsd_vec,
     786        &armpe_big_vec,
     787        &armpe_little_vec,
     788        &armpei_big_vec,
     789        &armpei_little_vec,
    712790        &b_out_vec_big_host,
    713791        &b_out_vec_little_host,
    714 
    715792        &bfd_efi_app_ia32_vec,
    716793#ifdef BFD64
    717794        &bfd_efi_app_ia64_vec,
    718795#endif
     796        &bfd_elf32_avr_vec,
    719797
    720798        /* This, and other vectors, may not be used in any *.mt configuration.
     
    723801           the file even if we don't recognize the machine type.  */
    724802        &bfd_elf32_big_generic_vec,
    725 #ifdef BFD64
    726         &bfd_elf64_alpha_vec,
    727         &bfd_elf64_hppa_vec,
    728         &bfd_elf64_hppa_linux_vec,
    729         &bfd_elf64_ia64_little_vec,
    730         &bfd_elf64_ia64_big_vec,
    731 #endif
    732         &bfd_elf32_avr_vec,
    733803        &bfd_elf32_bigarc_vec,
    734         &bfd_elf32_bigarm_vec,
    735         &bfd_elf32_bigarm_oabi_vec,
     804        &bfd_elf32_bigarm_oabi_vec,
     805        &bfd_elf32_bigarm_vec,
    736806        &bfd_elf32_bigmips_vec,
    737 #ifdef BFD64
    738         &bfd_elf64_bigmips_vec,
    739 #endif
    740807        &bfd_elf32_cris_vec,
    741         &bfd_elf32_us_cris_vec,
    742808        &bfd_elf32_d10v_vec,
    743809        &bfd_elf32_d30v_vec,
     810        &bfd_elf32_dlx_big_vec,
     811        &bfd_elf32_fr30_vec,
     812        &bfd_elf32_frv_vec,
     813        &bfd_elf32_h8300_vec,
     814        &bfd_elf32_hppa_linux_vec,
    744815        &bfd_elf32_hppa_vec,
    745         &bfd_elf32_hppa_linux_vec,
    746816        &bfd_elf32_i370_vec,
     817        &bfd_elf32_i386_freebsd_vec,
    747818        &bfd_elf32_i386_vec,
    748 #ifdef BFD64
    749         &bfd_elf64_x86_64_vec,
    750 #endif
     819        &bfd_elf32_i860_little_vec,
    751820        &bfd_elf32_i860_vec,
    752         &bfd_elf32_i860_little_vec,
    753821        &bfd_elf32_i960_vec,
     822#if 0
     823        &bfd_elf32_ia64_big_vec,
     824#endif
     825        &bfd_elf32_ia64_hpux_big_vec,
     826        &bfd_elf32_ip2k_vec,
     827        &bfd_elf32_iq2000_vec,
    754828        &bfd_elf32_little_generic_vec,
    755829        &bfd_elf32_littlearc_vec,
    756         &bfd_elf32_littlearm_vec,
    757         &bfd_elf32_littlearm_oabi_vec,
     830        &bfd_elf32_littlearm_oabi_vec,
     831        &bfd_elf32_littlearm_vec,
    758832        &bfd_elf32_littlemips_vec,
    759 #ifdef BFD64
    760         &bfd_elf64_littlemips_vec,
    761 #endif
    762833        &bfd_elf32_m32r_vec,
    763         &bfd_elf32_mn10200_vec,
    764         &bfd_elf32_mn10300_vec,
    765834        &bfd_elf32_m68hc11_vec,
    766835        &bfd_elf32_m68hc12_vec,
    767836        &bfd_elf32_m68k_vec,
    768837        &bfd_elf32_m88k_vec,
     838        &bfd_elf32_mcore_big_vec,
     839        &bfd_elf32_mcore_little_vec,
     840        &bfd_elf32_mn10200_vec,
     841        &bfd_elf32_mn10300_vec,
     842        &bfd_elf32_msp430_vec,
     843#ifdef BFD64
     844        &bfd_elf32_nbigmips_vec,
     845        &bfd_elf32_nlittlemips_vec,
     846        &bfd_elf32_ntradbigmips_vec,
     847        &bfd_elf32_ntradlittlemips_vec,
     848#endif
     849        &bfd_elf32_openrisc_vec,
     850        &bfd_elf32_or32_big_vec,
    769851        &bfd_elf32_pj_vec,
    770852        &bfd_elf32_pjl_vec,
    771853        &bfd_elf32_powerpc_vec,
    772854        &bfd_elf32_powerpcle_vec,
     855        &bfd_elf32_s390_vec,
     856        &bfd_elf32_sh_vec,
     857        &bfd_elf32_shblin_vec,
     858        &bfd_elf32_shl_vec,
     859        &bfd_elf32_shlin_vec,
     860        &bfd_elf32_shlnbsd_vec,
     861        &bfd_elf32_shnbsd_vec,
     862#ifdef BFD64
     863        &bfd_elf32_sh64_vec,
     864        &bfd_elf32_sh64l_vec,
     865        &bfd_elf32_sh64lnbsd_vec,
     866        &bfd_elf32_sh64nbsd_vec,
     867        &bfd_elf32_sh64lin_vec,
     868        &bfd_elf32_sh64blin_vec,
     869#endif
    773870        &bfd_elf32_sparc_vec,
    774         &bfd_elf32_v850_vec,
    775         &bfd_elf32_fr30_vec,
    776         &bfd_elf32_mcore_big_vec,
    777         &bfd_elf32_mcore_little_vec,
    778871        &bfd_elf32_tradbigmips_vec,
    779872        &bfd_elf32_tradlittlemips_vec,
     873        &bfd_elf32_us_cris_vec,
     874        &bfd_elf32_v850_vec,
     875        &bfd_elf32_vax_vec,
     876        &bfd_elf32_xstormy16_vec,
     877        &bfd_elf32_xtensa_be_vec,
     878        &bfd_elf32_xtensa_le_vec,
    780879#ifdef BFD64
     880        &bfd_elf64_alpha_freebsd_vec,
     881        &bfd_elf64_alpha_vec,
     882        &bfd_elf64_big_generic_vec,
     883        &bfd_elf64_bigmips_vec,
     884        &bfd_elf64_hppa_linux_vec,
     885        &bfd_elf64_hppa_vec,
     886        &bfd_elf64_ia64_aix_big_vec,
     887        &bfd_elf64_ia64_aix_little_vec,
     888        &bfd_elf64_ia64_big_vec,
     889        &bfd_elf64_ia64_hpux_big_vec,
     890        &bfd_elf64_ia64_little_vec,
     891        &bfd_elf64_little_generic_vec,
     892        &bfd_elf64_littlemips_vec,
     893        &bfd_elf64_mmix_vec,
     894        &bfd_elf64_powerpc_vec,
     895        &bfd_elf64_powerpcle_vec,
     896        &bfd_elf64_s390_vec,
     897        &bfd_elf64_sh64_vec,
     898        &bfd_elf64_sh64l_vec,
     899        &bfd_elf64_sh64lnbsd_vec,
     900        &bfd_elf64_sh64nbsd_vec,
     901        &bfd_elf64_sh64lin_vec,
     902        &bfd_elf64_sh64blin_vec,
     903#if 0
     904        &bfd_elf64_sparc_vec,
     905#endif
    781906        &bfd_elf64_tradbigmips_vec,
    782907        &bfd_elf64_tradlittlemips_vec,
    783         /* No one seems to use this.  */
    784         &bfd_elf64_big_generic_vec,
    785         &bfd_elf64_little_generic_vec,
    786 #endif
    787 #if 0
    788         &bfd_elf64_sparc_vec,
    789 #endif
    790         /* We don't include cisco_core_*_vec.  Although it has a magic number,
    791            the magic number isn't at the beginning of the file, and thus
    792            might spuriously match other kinds of files.  */
    793 
    794         &cris_aout_vec,
     908        &bfd_elf64_x86_64_vec,
     909        &bfd_mmo_vec,
     910#endif
     911        &bfd_powerpc_pe_vec,
     912        &bfd_powerpc_pei_vec,
     913        &bfd_powerpcle_pe_vec,
     914        &bfd_powerpcle_pei_vec,
     915        &cris_aout_vec,
    795916#ifdef BFD64
    796         &demo_64_vec,   /* Only compiled if host has long-long support */
     917        &demo_64_vec,   /* Only compiled if host has long-long support. */
    797918#endif
    798919        &ecoff_big_vec,
     920        &ecoff_biglittle_vec,
    799921        &ecoff_little_vec,
    800         &ecoff_biglittle_vec,
    801922#ifdef BFD64
    802923        &ecoffalpha_little_vec,
    803924#endif
     925        &go32coff_vec,
     926        &go32stubbedcoff_vec,
    804927        &h8300coff_vec,
    805928        &h8500coff_vec,
     
    808931           which kind of a.out file it is.  */
    809932        &host_aout_vec,
    810 #endif
    811 #if 0                           /* Clashes with sunos_big_vec magic no.  */
     933        /* Clashes with sunos_big_vec magic no.  */
    812934        &hp300bsd_vec,
    813935#endif
    814936        &hp300hpux_vec,
    815 #if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF)
    816         &som_vec,
    817 #endif
    818937        &i386aout_vec,
    819938        &i386bsd_vec,
    820939        &i386coff_vec,
     940#if 0
     941        &i386dynix_vec,
     942#endif
    821943        &i386freebsd_vec,
    822         &i860coff_vec,
    823         &bfd_powerpc_pe_vec,
    824         &bfd_powerpcle_pe_vec,
    825         &bfd_powerpc_pei_vec,
    826         &bfd_powerpcle_pei_vec,
    827         &go32coff_vec,
    828         &go32stubbedcoff_vec,
    829944#if 0
    830945        /* Since a.out files lack decent magic numbers, no way to recognize
     
    843958        &i386pe_vec,
    844959        &i386pei_vec,
    845         &armcoff_little_vec,
    846         &armcoff_big_vec,
    847         &armnetbsd_vec,
    848         &armpe_little_vec,
    849         &armpe_big_vec,
    850         &armpei_little_vec,
    851         &armpei_big_vec,
    852         &arm_epoc_pe_little_vec,
    853         &arm_epoc_pe_big_vec,
    854         &arm_epoc_pei_little_vec,
    855         &arm_epoc_pei_big_vec,
     960        &i860coff_vec,
    856961        &icoff_big_vec,
    857962        &icoff_little_vec,
    858963        &ieee_vec,
     964#if 0
     965        &m68k4knetbsd_vec,
     966        &m68kaux_coff_vec,
     967#endif
    859968        &m68kcoff_vec,
    860969        &m68kcoffun_vec,
     
    870979        &m88kbcs_vec,
    871980        &m88kmach3_vec,
     981        &mach_o_be_vec,
     982        &mach_o_le_vec,
     983        &mach_o_fat_vec,
    872984        &mcore_pe_big_vec,
    873985        &mcore_pe_little_vec,
    874986        &mcore_pei_big_vec,
    875987        &mcore_pei_little_vec,
     988        &mipslpe_vec,
     989        &mipslpei_vec,
    876990        &newsos3_vec,
    877         &nlm32_i386_vec,
    878         &nlm32_sparc_vec,
    879991#ifdef BFD64
    880992        &nlm32_alpha_vec,
    881993#endif
    882         &pc532netbsd_vec,
     994        &nlm32_i386_vec,
     995        &nlm32_powerpc_vec,
     996        &nlm32_sparc_vec,
    883997#if 0
    884998        /* We have no oasys tools anymore, so we can't test any of this
     
    8891003        &oasys_vec,
    8901004#endif
     1005        /* Entry for the OpenRISC family.  */
     1006        &or32coff_big_vec,
     1007
    8911008        &pc532machaout_vec,
    892 #if 0
    893         /* We have no way of distinguishing these from other a.out variants */
    894         &aout_arm_big_vec,
    895         &aout_arm_little_vec,
    896         &riscix_vec,
    897 #endif
     1009        &pc532netbsd_vec,
     1010        &pdp11_aout_vec,
     1011        &pef_vec,
     1012        &pef_xlib_vec,
    8981013#if 0
    8991014        /* This has the same magic number as RS/6000.  */
    9001015        &pmac_xcoff_vec,
    9011016#endif
    902         &rs6000coff_vec,
     1017        &ppcboot_vec,
     1018#if 0
     1019        /* We have no way of distinguishing these from other a.out variants.  */
     1020        &riscix_vec,
     1021#endif
    9031022#ifdef BFD64
    9041023        &rs6000coff64_vec,
    9051024#endif
    906         &ppcboot_vec,
     1025        &rs6000coff_vec,
     1026        &shcoff_small_vec,
    9071027        &shcoff_vec,
     1028        &shlcoff_small_vec,
    9081029        &shlcoff_vec,
    909         &shcoff_small_vec,
    910         &shlcoff_small_vec,
     1030        &shlpe_vec,
     1031        &shlpei_vec,
     1032#if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF)
     1033        &som_vec,
     1034#endif
     1035        &sparccoff_vec,
    9111036        &sparcle_aout_vec,
    9121037        &sparclinux_vec,
     
    9151040        &sparcnetbsd_vec,
    9161041        &sunos_big_vec,
    917         &aout0_big_vec,
     1042        &sym_vec,
    9181043        &tic30_aout_vec,
    9191044        &tic30_coff_vec,
     1045        &tic54x_coff0_beh_vec,
    9201046        &tic54x_coff0_vec,
    921         &tic54x_coff0_beh_vec,
     1047        &tic54x_coff1_beh_vec,
    9221048        &tic54x_coff1_vec,
    923         &tic54x_coff1_beh_vec,
     1049        &tic54x_coff2_beh_vec,
    9241050        &tic54x_coff2_vec,
    925         &tic54x_coff2_beh_vec,
    9261051        &tic80coff_vec,
     1052        &vaxbsd_vec,
    9271053        &vaxnetbsd_vec,
     1054        &vax1knetbsd_vec,
    9281055        &versados_vec,
    9291056#ifdef BFD64
     
    9311058#endif
    9321059        &vms_vax_vec,
     1060        &w65_vec,
    9331061        &we32kcoff_vec,
    9341062        &z8kcoff_vec,
    935 
    9361063#endif /* not SELECT_VECS */
    9371064
     
    9511078        &aix386_core_vec,
    9521079#endif
     1080#if 0
     1081        /* We don't include cisco_core_*_vec.  Although it has a magic number,
     1082           the magic number isn't at the beginning of the file, and thus
     1083           might spuriously match other kinds of files.  */
     1084        &cisco_core_big_vec,
     1085        &cisco_core_little_vec,
     1086#endif
     1087#ifdef HPPABSD_CORE
     1088        &hppabsd_core_vec,
     1089#endif
    9531090#ifdef HPUX_CORE
    9541091        &hpux_core_vec,
    9551092#endif
    956 #ifdef HPPABSD_CORE
    957         &hppabsd_core_vec,
    958 #endif
    9591093#ifdef IRIX_CORE
    9601094        &irix_core_vec,
     
    9661100        &osf_core_vec,
    9671101#endif
     1102#ifdef PTRACE_CORE
     1103        &ptrace_core_vec,
     1104#endif
    9681105#ifdef SCO5_CORE
    9691106        &sco5_core_vec,
    9701107#endif
    971 #ifdef  TRAD_CORE
     1108#ifdef TRAD_CORE
    9721109        &trad_core_vec,
    973 #endif
    974 
    975 #ifdef  PTRACE_CORE
    976         &ptrace_core_vec,
    9771110#endif
    9781111
     
    9901123        NULL
    9911124};
     1125
     1126/* bfd_associated_vector[] contains the associated target vectors used
     1127   to reduce the ambiguity in bfd_check_format_matches.  */
     1128
     1129static const bfd_target *_bfd_associated_vector[] = {
     1130#ifdef ASSOCIATED_VECS
     1131        ASSOCIATED_VECS,
     1132#endif
     1133        NULL
     1134};
     1135const bfd_target * const *bfd_associated_vector = _bfd_associated_vector;
    9921136
    9931137/* When there is an ambiguous match, bfd_check_format_matches puts the
     
    10531197
    10541198SYNOPSIS
    1055         boolean bfd_set_default_target (const char *name);
     1199        bfd_boolean bfd_set_default_target (const char *name);
    10561200
    10571201DESCRIPTION
     
    10611205*/
    10621206
    1063 boolean
     1207bfd_boolean
    10641208bfd_set_default_target (name)
    10651209     const char *name;
     
    10691213  if (bfd_default_vector[0] != NULL
    10701214      && strcmp (name, bfd_default_vector[0]->name) == 0)
    1071     return true;
     1215    return TRUE;
    10721216
    10731217  target = find_target (name);
    10741218  if (target == NULL)
    1075     return false;
     1219    return FALSE;
    10761220
    10771221  bfd_default_vector[0] = target;
    1078   return true;
     1222  return TRUE;
    10791223}
    10801224
     
    10841228
    10851229SYNOPSIS
    1086         const bfd_target *bfd_find_target(CONST char *target_name, bfd *abfd);
     1230        const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
    10871231
    10881232DESCRIPTION
     
    11111255    targname = getenv ("GNUTARGET");
    11121256
    1113   /* This is safe; the vector cannot be null */
     1257  /* This is safe; the vector cannot be null. */
    11141258  if (targname == NULL || strcmp (targname, "default") == 0)
    11151259    {
    1116       abfd->target_defaulted = true;
     1260      abfd->target_defaulted = TRUE;
    11171261      if (bfd_default_vector[0] != NULL)
    11181262        abfd->xvec = bfd_default_vector[0];
     
    11221266    }
    11231267
    1124   abfd->target_defaulted = false;
     1268  abfd->target_defaulted = FALSE;
    11251269
    11261270  target = find_target (targname);
     
    11371281
    11381282SYNOPSIS
    1139         const char **bfd_target_list(void);
     1283        const char ** bfd_target_list (void);
    11401284
    11411285DESCRIPTION
     
    11501294{
    11511295  int vec_length= 0;
     1296  bfd_size_type amt;
    11521297#if defined (HOST_HPPAHPUX) && ! defined (__STDC__)
    11531298  /* The native compiler on the HP9000/700 has a bug which causes it
     
    11551300  volatile
    11561301#endif
    1157     const bfd_target * const *target;
    1158   CONST  char **name_list, **name_ptr;
     1302  const bfd_target * const *target;
     1303  const  char **name_list, **name_ptr;
    11591304
    11601305  for (target = &bfd_target_vector[0]; *target != NULL; target++)
    11611306    vec_length++;
    11621307
    1163   name_ptr = name_list = (CONST char **)
    1164     bfd_zmalloc ((vec_length + 1) * sizeof (char **));
     1308  amt = (vec_length + 1) * sizeof (char **);
     1309  name_ptr = name_list = (const char **) bfd_malloc (amt);
    11651310
    11661311  if (name_list == NULL)
     
    11681313
    11691314  for (target = &bfd_target_vector[0]; *target != NULL; target++)
    1170     *(name_ptr++) = (*target)->name;
    1171 
     1315    if (target == &bfd_target_vector[0]
     1316        || *target != bfd_target_vector[0])
     1317      *name_ptr++ = (*target)->name;
     1318
     1319  *name_ptr = NULL;
    11721320  return name_list;
    11731321}
     
    11781326
    11791327SYNOPSIS
    1180         const bfd_target * bfd_search_for_target (int (* search_func) (const bfd_target *, void *), void *);
     1328        const bfd_target * bfd_search_for_target (int (* search_func)
     1329                                                  (const bfd_target *, void *),
     1330                                                  void *);
    11811331
    11821332DESCRIPTION
  • trunk/src/binutils/bfd/trad-core.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r617 r618  
    11/* BFD back end for traditional Unix core files (U-area and raw sections)
    22   Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
    3    2000
     3   2000, 2001, 2002
    44   Free Software Foundation, Inc.
    55   Written by John Gilmore of Cygnus Support.
     
    4444#include <sys/user.h>           /* After a.out.h  */
    4545
    46 #ifndef __EMX__ /* r=bird: Code was initially removed. Is this __EMX__ or EMX
    47                  * and why don't we include it? anything to do with sysdep.h? */
     46#ifndef __EMX__ /* r=bird: Code was initially removed. Why don't we include it? anything to do with sysdep.h? */
    4847#ifdef TRAD_HEADER
    4948#include TRAD_HEADER
     
    5150#endif /* !__EMX__ */
    5251
    53   struct trad_core_struct
    54     {
    55       asection *data_section;
    56 #ifdef __EMX__ /* r=bird: Isn't this a EMX (target) thing?  */
    57       asection *heap_section;
    58 #endif /* __EMX__ */
    59       asection *stack_section;
    60       asection *reg_section;
    61       struct user u;
    62     };
     52struct trad_core_struct
     53{
     54  asection *data_section;
     55#ifdef EMX
     56  asection *heap_section;
     57#endif /* EMX */
     58  asection *stack_section;
     59  asection *reg_section;
     60  struct user u;
     61};
    6362
    6463#define core_upage(bfd) (&((bfd)->tdata.trad_core_data->u))
    6564#define core_datasec(bfd) ((bfd)->tdata.trad_core_data->data_section)
    66 #ifdef __EMX__ /* r=bird: Isn't this a EMX (target) thing?  */
     65#ifdef EMX
    6766#define core_heapsec(bfd) ((bfd)->tdata.trad_core_data->heap_section)
    68 #endif /* __EMX__ */
     67#endif /* EMX */
    6968#define core_stacksec(bfd) ((bfd)->tdata.trad_core_data->stack_section)
    7069#define core_regsec(bfd) ((bfd)->tdata.trad_core_data->reg_section)
     
    7372
    7473const bfd_target *trad_unix_core_file_p PARAMS ((bfd *abfd));
    75 char *          trad_unix_core_file_failing_command PARAMS ((bfd *abfd));
    76 int             trad_unix_core_file_failing_signal PARAMS ((bfd *abfd));
    77 boolean         trad_unix_core_file_matches_executable_p
    78                         PARAMS ((bfd *core_bfd, bfd *exec_bfd));
    79 static void     swap_abort PARAMS ((void));
     74char * trad_unix_core_file_failing_command PARAMS ((bfd *abfd));
     75int trad_unix_core_file_failing_signal PARAMS ((bfd *abfd));
     76bfd_boolean trad_unix_core_file_matches_executable_p
     77  PARAMS ((bfd *core_bfd, bfd *exec_bfd));
     78static void swap_abort PARAMS ((void));
    8079
    8180/* Handle 4.2-style (and perhaps also sysV-style) core dump file.  */
     
    9089  struct user u;
    9190  struct trad_core_struct *rawptr;
     91  bfd_size_type amt;
    9292
    9393#ifdef TRAD_CORE_USER_OFFSET
    9494  /* If defined, this macro is the file position of the user struct.  */
    95   if (bfd_seek (abfd, TRAD_CORE_USER_OFFSET, SEEK_SET) != 0)
     95  if (bfd_seek (abfd, (file_ptr) TRAD_CORE_USER_OFFSET, SEEK_SET) != 0)
    9696    return 0;
    9797#endif
    9898
    99   val = bfd_read ((void *)&u, 1, sizeof u, abfd);
     99  val = bfd_bread ((void *) &u, (bfd_size_type) sizeof u, abfd);
    100100  if (val != sizeof u)
    101101    {
     
    106106
    107107  /* Sanity check perhaps??? */
    108 #ifdef __EMX__                          /* r=bird: Target (EMX) as well? */
     108#ifdef __EMX__                          /* r=bird: EMX not __EMX__ thing?? */
    109109  if (u.u_magic != UMAGIC)
    110110    return 0;
     
    164164  /* Allocate both the upage and the struct core_data at once, so
    165165     a single free() will free them both.  */
    166   rawptr = (struct trad_core_struct *)
    167                 bfd_zmalloc (sizeof (struct trad_core_struct));
     166  amt = sizeof (struct trad_core_struct);
     167  rawptr = (struct trad_core_struct *) bfd_zmalloc (amt);
    168168  if (rawptr == NULL)
    169169    return 0;
     
    173173  rawptr->u = u; /*Copy the uarea into the tdata part of the bfd */
    174174
    175   /* Create the sections.  This is raunchy, but bfd_close wants to free
    176      them separately.  */
    177 
    178   core_stacksec(abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection));
     175  /* Create the sections.  */
     176
     177  core_stacksec(abfd) = bfd_make_section_anyway (abfd, ".stack");
    179178  if (core_stacksec (abfd) == NULL)
    180     return NULL;
    181   core_datasec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection));
     179    goto fail;
     180  core_datasec (abfd) = bfd_make_section_anyway (abfd, ".data");
    182181  if (core_datasec (abfd) == NULL)
    183     return NULL;
    184   core_regsec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection));
     182    goto fail;
     183  core_regsec (abfd) = bfd_make_section_anyway (abfd, ".reg");
    185184  if (core_regsec (abfd) == NULL)
    186     return NULL;
    187 #ifdef EMX
    188   core_heapsec (abfd) = (asection *) bfd_zmalloc (sizeof (asection));
     185    goto fail;
     186#ifdef EMX
     187  core_heapsec (abfd) = bfd_make_section_anyway (abfd, ".heap");
    189188  if (core_heapsec (abfd) == NULL)
    190     return NULL;
     189    goto fail;
    191190#endif /* EMX */
    192191
     
    254253     of the section to -u_ar0).  GDB uses this info to locate the regs,
    255254     using minor trickery to get around the offset-or-absolute-addr problem.  */
    256   core_regsec (abfd)->vma = - (bfd_vma) u.u_ar0;
     255  core_regsec (abfd)->vma = - (bfd_vma) (unsigned long) u.u_ar0;
    257256
    258257#ifdef EMX
     
    279278  core_regsec (abfd)->alignment_power = 2;
    280279
    281   abfd->sections = core_stacksec (abfd);
    282   core_stacksec (abfd)->next = core_datasec (abfd);
    283 #ifdef EMX
    284   core_datasec (abfd)->next = core_heapsec (abfd);
    285   core_heapsec (abfd)->next = core_regsec (abfd);
    286   abfd->section_count = 4;
    287 #else /* not EMX */
    288   core_datasec (abfd)->next = core_regsec (abfd);
    289   abfd->section_count = 3;
    290 #endif /* not EMX */
    291 
    292280  return abfd->xvec;
     281
     282 fail:
     283  bfd_release (abfd, abfd->tdata.any);
     284  abfd->tdata.any = NULL;
     285  bfd_section_list_clear (abfd);
     286  return NULL;
    293287}
    294288
     
    319313
    320314/* ARGSUSED */
    321 boolean
     315bfd_boolean
    322316trad_unix_core_file_matches_executable_p  (core_bfd, exec_bfd)
    323317     bfd *core_bfd ATTRIBUTE_UNUSED;
    324318     bfd *exec_bfd ATTRIBUTE_UNUSED;
    325319{
    326   return true;          /* FIXME, We have no way of telling at this point */
     320  return TRUE;          /* FIXME, We have no way of telling at this point */
    327321}
    328322
Note: See TracChangeset for help on using the changeset viewer.