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

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/bfd/targets.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    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;
     
    612656extern const bfd_target m88kbcs_vec;
    613657extern const bfd_target m88kmach3_vec;
     658extern const bfd_target mach_o_be_vec;
     659extern const bfd_target mach_o_le_vec;
     660extern const bfd_target mach_o_fat_vec;
    614661extern const bfd_target mcore_pe_big_vec;
    615662extern const bfd_target mcore_pe_little_vec;
     
    624671extern const bfd_target nlm32_sparc_vec;
    625672extern const bfd_target oasys_vec;
     673extern const bfd_target or32coff_big_vec;
    626674extern const bfd_target pc532machaout_vec;
    627675extern const bfd_target pc532netbsd_vec;
     676extern const bfd_target pdp11_aout_vec;
     677extern const bfd_target pef_vec;
     678extern const bfd_target pef_xlib_vec;
    628679extern const bfd_target pmac_xcoff_vec;
    629680extern const bfd_target ppcboot_vec;
     
    645696extern const bfd_target sparcnetbsd_vec;
    646697extern const bfd_target sunos_big_vec;
    647 extern const bfd_target tekhex_vec;
     698extern const bfd_target sym_vec;
    648699extern const bfd_target tic30_aout_vec;
    649700extern const bfd_target tic30_coff_vec;
     701extern const bfd_target tic4x_coff0_beh_vec;
     702extern const bfd_target tic4x_coff0_vec;
     703extern const bfd_target tic4x_coff1_beh_vec;
     704extern const bfd_target tic4x_coff1_vec;
     705extern const bfd_target tic4x_coff2_beh_vec;
     706extern const bfd_target tic4x_coff2_vec;
    650707extern const bfd_target tic54x_coff0_beh_vec;
    651708extern const bfd_target tic54x_coff0_vec;
     
    655712extern const bfd_target tic54x_coff2_vec;
    656713extern const bfd_target tic80coff_vec;
     714extern const bfd_target vaxbsd_vec;
    657715extern const bfd_target vaxnetbsd_vec;
     716extern const bfd_target vax1knetbsd_vec;
    658717extern const bfd_target versados_vec;
    659718extern const bfd_target vms_alpha_vec;
     
    663722extern const bfd_target z8kcoff_vec;
    664723
    665 /* srec is always included.  */
     724/* These are always included.  */
    666725extern const bfd_target srec_vec;
    667726extern const bfd_target symbolsrec_vec;
    668 
    669 /* binary is always included.  */
     727extern const bfd_target tekhex_vec;
    670728extern const bfd_target binary_vec;
    671 
    672 /* ihex is always included.  */
    673729extern const bfd_target ihex_vec;
    674730
     
    677733extern const bfd_target cisco_core_big_vec;
    678734extern const bfd_target cisco_core_little_vec;
     735extern const bfd_target hppabsd_core_vec;
    679736extern const bfd_target hpux_core_vec;
    680 extern const bfd_target hppabsd_core_vec;
    681737extern const bfd_target irix_core_vec;
    682738extern const bfd_target netbsd_core_vec;
    683739extern const bfd_target osf_core_vec;
     740extern const bfd_target ptrace_core_vec;
    684741extern const bfd_target sco5_core_vec;
    685742extern const bfd_target trad_core_vec;
    686 extern const bfd_target ptrace_core_vec;
    687743
    688744static const bfd_target * const _bfd_target_vector[] = {
     
    705761        &a29kcoff_big_vec,
    706762        &a_out_adobe_vec,
    707 #if 0                           /* No one seems to use this.  */
     763#ifdef BFD64
     764        &aix5coff64_vec,
     765#endif
     766        &aout0_big_vec,
     767#if 0
     768        /* We have no way of distinguishing these from other a.out variants.  */
     769        &aout_arm_big_vec,
     770        &aout_arm_little_vec,
     771        /* No one seems to use this.  */
    708772        &aout_mips_big_vec,
    709773#endif
    710774        &aout_mips_little_vec,
     775#if 0
     776        &apollocoff_vec,
     777#endif
     778        &arm_epoc_pe_big_vec,
     779        &arm_epoc_pe_little_vec,
     780        &arm_epoc_pei_big_vec,
     781        &arm_epoc_pei_little_vec,
     782        &armcoff_big_vec,
     783        &armcoff_little_vec,
     784        &armnetbsd_vec,
     785        &armpe_big_vec,
     786        &armpe_little_vec,
     787        &armpei_big_vec,
     788        &armpei_little_vec,
    711789        &b_out_vec_big_host,
    712790        &b_out_vec_little_host,
    713 
    714791        &bfd_efi_app_ia32_vec,
    715792#ifdef BFD64
    716793        &bfd_efi_app_ia64_vec,
    717794#endif
     795        &bfd_elf32_avr_vec,
    718796
    719797        /* This, and other vectors, may not be used in any *.mt configuration.
     
    722800           the file even if we don't recognize the machine type.  */
    723801        &bfd_elf32_big_generic_vec,
    724 #ifdef BFD64
    725         &bfd_elf64_alpha_vec,
    726         &bfd_elf64_hppa_vec,
    727         &bfd_elf64_hppa_linux_vec,
    728         &bfd_elf64_ia64_little_vec,
    729         &bfd_elf64_ia64_big_vec,
    730 #endif
    731         &bfd_elf32_avr_vec,
    732802        &bfd_elf32_bigarc_vec,
    733         &bfd_elf32_bigarm_vec,
    734         &bfd_elf32_bigarm_oabi_vec,
     803        &bfd_elf32_bigarm_oabi_vec,
     804        &bfd_elf32_bigarm_vec,
    735805        &bfd_elf32_bigmips_vec,
    736 #ifdef BFD64
    737         &bfd_elf64_bigmips_vec,
    738 #endif
    739806        &bfd_elf32_cris_vec,
    740         &bfd_elf32_us_cris_vec,
    741807        &bfd_elf32_d10v_vec,
    742808        &bfd_elf32_d30v_vec,
     809        &bfd_elf32_dlx_big_vec,
     810        &bfd_elf32_fr30_vec,
     811        &bfd_elf32_frv_vec,
     812        &bfd_elf32_h8300_vec,
     813        &bfd_elf32_hppa_linux_vec,
    743814        &bfd_elf32_hppa_vec,
    744         &bfd_elf32_hppa_linux_vec,
    745815        &bfd_elf32_i370_vec,
     816        &bfd_elf32_i386_freebsd_vec,
    746817        &bfd_elf32_i386_vec,
    747 #ifdef BFD64
    748         &bfd_elf64_x86_64_vec,
    749 #endif
     818        &bfd_elf32_i860_little_vec,
    750819        &bfd_elf32_i860_vec,
    751         &bfd_elf32_i860_little_vec,
    752820        &bfd_elf32_i960_vec,
     821#if 0
     822        &bfd_elf32_ia64_big_vec,
     823#endif
     824        &bfd_elf32_ia64_hpux_big_vec,
     825        &bfd_elf32_ip2k_vec,
     826        &bfd_elf32_iq2000_vec,
    753827        &bfd_elf32_little_generic_vec,
    754828        &bfd_elf32_littlearc_vec,
    755         &bfd_elf32_littlearm_vec,
    756         &bfd_elf32_littlearm_oabi_vec,
     829        &bfd_elf32_littlearm_oabi_vec,
     830        &bfd_elf32_littlearm_vec,
    757831        &bfd_elf32_littlemips_vec,
    758 #ifdef BFD64
    759         &bfd_elf64_littlemips_vec,
    760 #endif
    761832        &bfd_elf32_m32r_vec,
    762         &bfd_elf32_mn10200_vec,
    763         &bfd_elf32_mn10300_vec,
    764833        &bfd_elf32_m68hc11_vec,
    765834        &bfd_elf32_m68hc12_vec,
    766835        &bfd_elf32_m68k_vec,
    767836        &bfd_elf32_m88k_vec,
     837        &bfd_elf32_mcore_big_vec,
     838        &bfd_elf32_mcore_little_vec,
     839        &bfd_elf32_mn10200_vec,
     840        &bfd_elf32_mn10300_vec,
     841        &bfd_elf32_msp430_vec,
     842#ifdef BFD64
     843        &bfd_elf32_nbigmips_vec,
     844        &bfd_elf32_nlittlemips_vec,
     845        &bfd_elf32_ntradbigmips_vec,
     846        &bfd_elf32_ntradlittlemips_vec,
     847#endif
     848        &bfd_elf32_openrisc_vec,
     849        &bfd_elf32_or32_big_vec,
    768850        &bfd_elf32_pj_vec,
    769851        &bfd_elf32_pjl_vec,
    770852        &bfd_elf32_powerpc_vec,
    771853        &bfd_elf32_powerpcle_vec,
     854        &bfd_elf32_s390_vec,
     855        &bfd_elf32_sh_vec,
     856        &bfd_elf32_shblin_vec,
     857        &bfd_elf32_shl_vec,
     858        &bfd_elf32_shlin_vec,
     859        &bfd_elf32_shlnbsd_vec,
     860        &bfd_elf32_shnbsd_vec,
     861#ifdef BFD64
     862        &bfd_elf32_sh64_vec,
     863        &bfd_elf32_sh64l_vec,
     864        &bfd_elf32_sh64lnbsd_vec,
     865        &bfd_elf32_sh64nbsd_vec,
     866        &bfd_elf32_sh64lin_vec,
     867        &bfd_elf32_sh64blin_vec,
     868#endif
    772869        &bfd_elf32_sparc_vec,
    773         &bfd_elf32_v850_vec,
    774         &bfd_elf32_fr30_vec,
    775         &bfd_elf32_mcore_big_vec,
    776         &bfd_elf32_mcore_little_vec,
    777870        &bfd_elf32_tradbigmips_vec,
    778871        &bfd_elf32_tradlittlemips_vec,
     872        &bfd_elf32_us_cris_vec,
     873        &bfd_elf32_v850_vec,
     874        &bfd_elf32_vax_vec,
     875        &bfd_elf32_xstormy16_vec,
     876        &bfd_elf32_xtensa_be_vec,
     877        &bfd_elf32_xtensa_le_vec,
    779878#ifdef BFD64
     879        &bfd_elf64_alpha_freebsd_vec,
     880        &bfd_elf64_alpha_vec,
     881        &bfd_elf64_big_generic_vec,
     882        &bfd_elf64_bigmips_vec,
     883        &bfd_elf64_hppa_linux_vec,
     884        &bfd_elf64_hppa_vec,
     885        &bfd_elf64_ia64_aix_big_vec,
     886        &bfd_elf64_ia64_aix_little_vec,
     887        &bfd_elf64_ia64_big_vec,
     888        &bfd_elf64_ia64_hpux_big_vec,
     889        &bfd_elf64_ia64_little_vec,
     890        &bfd_elf64_little_generic_vec,
     891        &bfd_elf64_littlemips_vec,
     892        &bfd_elf64_mmix_vec,
     893        &bfd_elf64_powerpc_vec,
     894        &bfd_elf64_powerpcle_vec,
     895        &bfd_elf64_s390_vec,
     896        &bfd_elf64_sh64_vec,
     897        &bfd_elf64_sh64l_vec,
     898        &bfd_elf64_sh64lnbsd_vec,
     899        &bfd_elf64_sh64nbsd_vec,
     900        &bfd_elf64_sh64lin_vec,
     901        &bfd_elf64_sh64blin_vec,
     902#if 0
     903        &bfd_elf64_sparc_vec,
     904#endif
    780905        &bfd_elf64_tradbigmips_vec,
    781906        &bfd_elf64_tradlittlemips_vec,
    782         /* No one seems to use this.  */
    783         &bfd_elf64_big_generic_vec,
    784         &bfd_elf64_little_generic_vec,
    785 #endif
    786 #if 0
    787         &bfd_elf64_sparc_vec,
    788 #endif
    789         /* We don't include cisco_core_*_vec.  Although it has a magic number,
    790            the magic number isn't at the beginning of the file, and thus
    791            might spuriously match other kinds of files.  */
    792 
    793         &cris_aout_vec,
     907        &bfd_elf64_x86_64_vec,
     908        &bfd_mmo_vec,
     909#endif
     910        &bfd_powerpc_pe_vec,
     911        &bfd_powerpc_pei_vec,
     912        &bfd_powerpcle_pe_vec,
     913        &bfd_powerpcle_pei_vec,
     914        &cris_aout_vec,
    794915#ifdef BFD64
    795         &demo_64_vec,   /* Only compiled if host has long-long support */
     916        &demo_64_vec,   /* Only compiled if host has long-long support. */
    796917#endif
    797918        &ecoff_big_vec,
     919        &ecoff_biglittle_vec,
    798920        &ecoff_little_vec,
    799         &ecoff_biglittle_vec,
    800921#ifdef BFD64
    801922        &ecoffalpha_little_vec,
    802923#endif
     924        &go32coff_vec,
     925        &go32stubbedcoff_vec,
    803926        &h8300coff_vec,
    804927        &h8500coff_vec,
     
    807930           which kind of a.out file it is.  */
    808931        &host_aout_vec,
    809 #endif
    810 #if 0                           /* Clashes with sunos_big_vec magic no.  */
     932        /* Clashes with sunos_big_vec magic no.  */
    811933        &hp300bsd_vec,
    812934#endif
    813935        &hp300hpux_vec,
    814 #if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF)
    815         &som_vec,
    816 #endif
    817936        &i386aout_vec,
    818937        &i386bsd_vec,
    819938        &i386coff_vec,
     939#if 0
     940        &i386dynix_vec,
     941#endif
    820942        &i386freebsd_vec,
    821         &i860coff_vec,
    822         &bfd_powerpc_pe_vec,
    823         &bfd_powerpcle_pe_vec,
    824         &bfd_powerpc_pei_vec,
    825         &bfd_powerpcle_pei_vec,
    826         &go32coff_vec,
    827         &go32stubbedcoff_vec,
    828943#if 0
    829944        /* Since a.out files lack decent magic numbers, no way to recognize
     
    842957        &i386pe_vec,
    843958        &i386pei_vec,
    844         &armcoff_little_vec,
    845         &armcoff_big_vec,
    846         &armnetbsd_vec,
    847         &armpe_little_vec,
    848         &armpe_big_vec,
    849         &armpei_little_vec,
    850         &armpei_big_vec,
    851         &arm_epoc_pe_little_vec,
    852         &arm_epoc_pe_big_vec,
    853         &arm_epoc_pei_little_vec,
    854         &arm_epoc_pei_big_vec,
     959        &i860coff_vec,
    855960        &icoff_big_vec,
    856961        &icoff_little_vec,
    857962        &ieee_vec,
     963#if 0
     964        &m68k4knetbsd_vec,
     965        &m68kaux_coff_vec,
     966#endif
    858967        &m68kcoff_vec,
    859968        &m68kcoffun_vec,
     
    869978        &m88kbcs_vec,
    870979        &m88kmach3_vec,
     980        &mach_o_be_vec,
     981        &mach_o_le_vec,
     982        &mach_o_fat_vec,
    871983        &mcore_pe_big_vec,
    872984        &mcore_pe_little_vec,
    873985        &mcore_pei_big_vec,
    874986        &mcore_pei_little_vec,
     987        &mipslpe_vec,
     988        &mipslpei_vec,
    875989        &newsos3_vec,
    876         &nlm32_i386_vec,
    877         &nlm32_sparc_vec,
    878990#ifdef BFD64
    879991        &nlm32_alpha_vec,
    880992#endif
    881         &pc532netbsd_vec,
     993        &nlm32_i386_vec,
     994        &nlm32_powerpc_vec,
     995        &nlm32_sparc_vec,
    882996#if 0
    883997        /* We have no oasys tools anymore, so we can't test any of this
     
    8881002        &oasys_vec,
    8891003#endif
     1004        /* Entry for the OpenRISC family.  */
     1005        &or32coff_big_vec,
     1006
    8901007        &pc532machaout_vec,
    891 #if 0
    892         /* We have no way of distinguishing these from other a.out variants */
    893         &aout_arm_big_vec,
    894         &aout_arm_little_vec,
    895         &riscix_vec,
    896 #endif
     1008        &pc532netbsd_vec,
     1009        &pdp11_aout_vec,
     1010        &pef_vec,
     1011        &pef_xlib_vec,
    8971012#if 0
    8981013        /* This has the same magic number as RS/6000.  */
    8991014        &pmac_xcoff_vec,
    9001015#endif
    901         &rs6000coff_vec,
     1016        &ppcboot_vec,
     1017#if 0
     1018        /* We have no way of distinguishing these from other a.out variants.  */
     1019        &riscix_vec,
     1020#endif
    9021021#ifdef BFD64
    9031022        &rs6000coff64_vec,
    9041023#endif
    905         &ppcboot_vec,
     1024        &rs6000coff_vec,
     1025        &shcoff_small_vec,
    9061026        &shcoff_vec,
     1027        &shlcoff_small_vec,
    9071028        &shlcoff_vec,
    908         &shcoff_small_vec,
    909         &shlcoff_small_vec,
     1029        &shlpe_vec,
     1030        &shlpei_vec,
     1031#if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF)
     1032        &som_vec,
     1033#endif
     1034        &sparccoff_vec,
    9101035        &sparcle_aout_vec,
    9111036        &sparclinux_vec,
     
    9141039        &sparcnetbsd_vec,
    9151040        &sunos_big_vec,
    916         &aout0_big_vec,
     1041        &sym_vec,
    9171042        &tic30_aout_vec,
    9181043        &tic30_coff_vec,
     1044        &tic54x_coff0_beh_vec,
    9191045        &tic54x_coff0_vec,
    920         &tic54x_coff0_beh_vec,
     1046        &tic54x_coff1_beh_vec,
    9211047        &tic54x_coff1_vec,
    922         &tic54x_coff1_beh_vec,
     1048        &tic54x_coff2_beh_vec,
    9231049        &tic54x_coff2_vec,
    924         &tic54x_coff2_beh_vec,
    9251050        &tic80coff_vec,
     1051        &vaxbsd_vec,
    9261052        &vaxnetbsd_vec,
     1053        &vax1knetbsd_vec,
    9271054        &versados_vec,
    9281055#ifdef BFD64
     
    9301057#endif
    9311058        &vms_vax_vec,
     1059        &w65_vec,
    9321060        &we32kcoff_vec,
    9331061        &z8kcoff_vec,
    934 
    9351062#endif /* not SELECT_VECS */
    9361063
     
    9501077        &aix386_core_vec,
    9511078#endif
     1079#if 0
     1080        /* We don't include cisco_core_*_vec.  Although it has a magic number,
     1081           the magic number isn't at the beginning of the file, and thus
     1082           might spuriously match other kinds of files.  */
     1083        &cisco_core_big_vec,
     1084        &cisco_core_little_vec,
     1085#endif
     1086#ifdef HPPABSD_CORE
     1087        &hppabsd_core_vec,
     1088#endif
    9521089#ifdef HPUX_CORE
    9531090        &hpux_core_vec,
    9541091#endif
    955 #ifdef HPPABSD_CORE
    956         &hppabsd_core_vec,
    957 #endif
    9581092#ifdef IRIX_CORE
    9591093        &irix_core_vec,
     
    9651099        &osf_core_vec,
    9661100#endif
     1101#ifdef PTRACE_CORE
     1102        &ptrace_core_vec,
     1103#endif
    9671104#ifdef SCO5_CORE
    9681105        &sco5_core_vec,
    9691106#endif
    970 #ifdef  TRAD_CORE
     1107#ifdef TRAD_CORE
    9711108        &trad_core_vec,
    972 #endif
    973 
    974 #ifdef  PTRACE_CORE
    975         &ptrace_core_vec,
    9761109#endif
    9771110
     
    9891122        NULL
    9901123};
     1124
     1125/* bfd_associated_vector[] contains the associated target vectors used
     1126   to reduce the ambiguity in bfd_check_format_matches.  */
     1127
     1128static const bfd_target *_bfd_associated_vector[] = {
     1129#ifdef ASSOCIATED_VECS
     1130        ASSOCIATED_VECS,
     1131#endif
     1132        NULL
     1133};
     1134const bfd_target * const *bfd_associated_vector = _bfd_associated_vector;
    9911135
    9921136/* When there is an ambiguous match, bfd_check_format_matches puts the
     
    10521196
    10531197SYNOPSIS
    1054         boolean bfd_set_default_target (const char *name);
     1198        bfd_boolean bfd_set_default_target (const char *name);
    10551199
    10561200DESCRIPTION
     
    10601204*/
    10611205
    1062 boolean
     1206bfd_boolean
    10631207bfd_set_default_target (name)
    10641208     const char *name;
     
    10681212  if (bfd_default_vector[0] != NULL
    10691213      && strcmp (name, bfd_default_vector[0]->name) == 0)
    1070     return true;
     1214    return TRUE;
    10711215
    10721216  target = find_target (name);
    10731217  if (target == NULL)
    1074     return false;
     1218    return FALSE;
    10751219
    10761220  bfd_default_vector[0] = target;
    1077   return true;
     1221  return TRUE;
    10781222}
    10791223
     
    10831227
    10841228SYNOPSIS
    1085         const bfd_target *bfd_find_target(CONST char *target_name, bfd *abfd);
     1229        const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
    10861230
    10871231DESCRIPTION
     
    11101254    targname = getenv ("GNUTARGET");
    11111255
    1112   /* This is safe; the vector cannot be null */
     1256  /* This is safe; the vector cannot be null. */
    11131257  if (targname == NULL || strcmp (targname, "default") == 0)
    11141258    {
    1115       abfd->target_defaulted = true;
     1259      abfd->target_defaulted = TRUE;
    11161260      if (bfd_default_vector[0] != NULL)
    11171261        abfd->xvec = bfd_default_vector[0];
     
    11211265    }
    11221266
    1123   abfd->target_defaulted = false;
     1267  abfd->target_defaulted = FALSE;
    11241268
    11251269  target = find_target (targname);
     
    11361280
    11371281SYNOPSIS
    1138         const char **bfd_target_list(void);
     1282        const char ** bfd_target_list (void);
    11391283
    11401284DESCRIPTION
     
    11491293{
    11501294  int vec_length= 0;
     1295  bfd_size_type amt;
    11511296#if defined (HOST_HPPAHPUX) && ! defined (__STDC__)
    11521297  /* The native compiler on the HP9000/700 has a bug which causes it
     
    11541299  volatile
    11551300#endif
    1156     const bfd_target * const *target;
    1157   CONST  char **name_list, **name_ptr;
     1301  const bfd_target * const *target;
     1302  const  char **name_list, **name_ptr;
    11581303
    11591304  for (target = &bfd_target_vector[0]; *target != NULL; target++)
    11601305    vec_length++;
    11611306
    1162   name_ptr = name_list = (CONST char **)
    1163     bfd_zmalloc ((vec_length + 1) * sizeof (char **));
     1307  amt = (vec_length + 1) * sizeof (char **);
     1308  name_ptr = name_list = (const char **) bfd_malloc (amt);
    11641309
    11651310  if (name_list == NULL)
     
    11671312
    11681313  for (target = &bfd_target_vector[0]; *target != NULL; target++)
    1169     *(name_ptr++) = (*target)->name;
    1170 
     1314    if (target == &bfd_target_vector[0]
     1315        || *target != bfd_target_vector[0])
     1316      *name_ptr++ = (*target)->name;
     1317
     1318  *name_ptr = NULL;
    11711319  return name_list;
    11721320}
     
    11771325
    11781326SYNOPSIS
    1179         const bfd_target * bfd_search_for_target (int (* search_func) (const bfd_target *, void *), void *);
     1327        const bfd_target * bfd_search_for_target (int (* search_func)
     1328                                                  (const bfd_target *, void *),
     1329                                                  void *);
    11801330
    11811331DESCRIPTION
Note: See TracChangeset for help on using the changeset viewer.