Back to index

cell-binutils  2.17cvs20070401
nlm-target.h
Go to the documentation of this file.
00001 /* Target definitions for 32/64-bit NLM (NetWare Loadable Module)
00002    Copyright 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
00003    2005, 2007 Free Software Foundation, Inc.
00004 
00005    This file is part of BFD, the Binary File Descriptor library.
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 2 of the License, or
00010    (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program; if not, write to the Free Software
00019    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00020 
00021 #define nlm_core_file_p _bfd_dummy_target
00022 
00023 #define nlm_get_symtab_upper_bound              nlmNAME (get_symtab_upper_bound)
00024 #define nlm_canonicalize_symtab                 nlmNAME (canonicalize_symtab)
00025 #define nlm_make_empty_symbol                   nlmNAME (make_empty_symbol)
00026 #define nlm_print_symbol                        nlmNAME (print_symbol)
00027 #define nlm_get_symbol_info                     nlmNAME (get_symbol_info)
00028 #define nlm_bfd_is_local_label_name             bfd_generic_is_local_label_name
00029 #define nlm_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
00030 #define nlm_get_lineno                          _bfd_nosymbols_get_lineno
00031 #define nlm_find_nearest_line                   _bfd_nosymbols_find_nearest_line
00032 #define nlm_find_inliner_info                   _bfd_nosymbols_find_inliner_info
00033 #define nlm_bfd_make_debug_symbol               _bfd_nosymbols_bfd_make_debug_symbol
00034 #define nlm_read_minisymbols                    _bfd_generic_read_minisymbols
00035 #define nlm_minisymbol_to_symbol                _bfd_generic_minisymbol_to_symbol
00036 
00037 #define nlm_get_reloc_upper_bound               nlmNAME (get_reloc_upper_bound)
00038 #define nlm_canonicalize_reloc                  nlmNAME (canonicalize_reloc)
00039 #define nlm_bfd_reloc_type_lookup               bfd_default_reloc_type_lookup
00040 #define nlm_bfd_reloc_name_lookup         _bfd_norelocs_bfd_reloc_name_lookup
00041 #define nlm_set_section_contents                nlmNAME (set_section_contents)
00042 
00043 #define nlm_sizeof_headers                      _bfd_nolink_sizeof_headers
00044 #define nlm_bfd_get_relocated_section_contents  bfd_generic_get_relocated_section_contents
00045 #define nlm_bfd_relax_section                   bfd_generic_relax_section
00046 #define nlm_bfd_gc_sections                     bfd_generic_gc_sections
00047 #define nlm_bfd_merge_sections                  bfd_generic_merge_sections
00048 #define nlm_bfd_is_group_section                bfd_generic_is_group_section
00049 #define nlm_bfd_discard_group                   bfd_generic_discard_group
00050 #define nlm_section_already_linked              _bfd_generic_section_already_linked
00051 #define nlm_bfd_link_hash_table_create          _bfd_generic_link_hash_table_create
00052 #define nlm_bfd_link_hash_table_free            _bfd_generic_link_hash_table_free
00053 #define nlm_bfd_link_add_symbols                _bfd_generic_link_add_symbols
00054 #define nlm_bfd_link_just_syms                  _bfd_generic_link_just_syms
00055 #define nlm_bfd_final_link                      _bfd_generic_final_link
00056 #define nlm_bfd_link_split_section              _bfd_generic_link_split_section
00057 
00058 /* This structure contains everything that BFD knows about a target.
00059    It includes things like its byte order, name, what routines to call
00060    to do various operations, etc.  Every BFD points to a target structure
00061    with its "xvec" member.
00062 
00063    There are two such structures here:  one for big-endian machines and
00064    one for little-endian machines.   */
00065 
00066 /* Forward declaration for use when initialising alternative_target field.  */
00067 #ifdef TARGET_LITTLE_SYM
00068 extern const bfd_target TARGET_LITTLE_SYM;
00069 #endif
00070 
00071 #ifdef TARGET_BIG_SYM
00072 const bfd_target TARGET_BIG_SYM =
00073 {
00074   /* Name: identify kind of target.  */
00075   TARGET_BIG_NAME,
00076 
00077   /* Flavour: general indication about file.  */
00078   bfd_target_nlm_flavour,
00079 
00080   /* Byteorder: data is big endian.  */
00081   BFD_ENDIAN_BIG,
00082 
00083   /* Header_byteorder: header is also big endian.  */
00084   BFD_ENDIAN_BIG,
00085 
00086   /* Object_flags: mask of all file flags.  */
00087   (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS
00088    | WP_TEXT),
00089 
00090   /* Section_flags: mask of all section flags.  */
00091   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY
00092    | SEC_CODE | SEC_DATA),
00093 
00094    /* Leading_symbol_char: is the first char of a user symbol
00095       predictable, and if so what is it.  */
00096    0,
00097 
00098   /* AR_pad_char: pad character for filenames within an archive header
00099      FIXME:  this really has nothing to do with NLM, this is a characteristic
00100      of the archiver and/or os and should be independently tunable.  */
00101   '/',
00102 
00103   /* AR_max_namelen: maximum number of characters in an archive header
00104      FIXME:  this really has nothing to do with NLM, this is a characteristic
00105      of the archiver and should be independently tunable.  This value is
00106      a WAG (wild a** guess).  */
00107   15,
00108 
00109   /* Routines to byte-swap various sized integers from the data sections.  */
00110   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
00111   bfd_getb32, bfd_getb_signed_32, bfd_putb32,
00112   bfd_getb16, bfd_getb_signed_16, bfd_putb16,
00113 
00114   /* Routines to byte-swap various sized integers from the file headers.  */
00115   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
00116   bfd_getb32, bfd_getb_signed_32, bfd_putb32,
00117   bfd_getb16, bfd_getb_signed_16, bfd_putb16,
00118 
00119   /* bfd_check_format: check the format of a file being read.  */
00120   { _bfd_dummy_target,             /* Unknown format.  */
00121     nlmNAME (object_p),            /* Assembler/linker output (object file).  */
00122     bfd_generic_archive_p,  /* An archive.  */
00123     nlm_core_file_p         /* A core file.  */
00124   },
00125 
00126   /* bfd_set_format: set the format of a file being written.  */
00127   { bfd_false,
00128     nlm_mkobject,
00129     _bfd_generic_mkarchive,
00130     bfd_false
00131   },
00132 
00133   /* bfd_write_contents: write cached information into a file being written.  */
00134   { bfd_false,
00135     nlmNAME (write_object_contents),
00136     _bfd_write_archive_contents,
00137     bfd_false
00138   },
00139 
00140   /* Initialize a jump table with the standard macro.
00141      All names start with "nlm".  */
00142   BFD_JUMP_TABLE_GENERIC (_bfd_generic),
00143   BFD_JUMP_TABLE_COPY (_bfd_generic),
00144   BFD_JUMP_TABLE_CORE (_bfd_nocore),
00145   BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
00146   BFD_JUMP_TABLE_SYMBOLS (nlm),
00147   BFD_JUMP_TABLE_RELOCS (nlm),
00148   BFD_JUMP_TABLE_WRITE (nlm),
00149   BFD_JUMP_TABLE_LINK (nlm),
00150   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
00151 
00152   /* Alternative endian target.  */
00153 #ifdef TARGET_LITTLE_SYM
00154   & TARGET_LITTLE_SYM,
00155 #else
00156   NULL,
00157 #endif
00158 
00159   /* Backend_data.  */
00160   (void *) TARGET_BACKEND_DATA
00161 };
00162 #endif
00163 
00164 #ifdef TARGET_LITTLE_SYM
00165 const bfd_target TARGET_LITTLE_SYM =
00166 {
00167   /* Name: identify kind of target.  */
00168   TARGET_LITTLE_NAME,
00169 
00170   /* Flavour: general indication about file.  */
00171   bfd_target_nlm_flavour,
00172 
00173   /* Byteorder: data is little endian.  */
00174   BFD_ENDIAN_LITTLE,
00175 
00176   /* Header_byteorder: header is also little endian.  */
00177   BFD_ENDIAN_LITTLE,
00178 
00179   /* Object_flags: mask of all file flags.  */
00180   (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS
00181    | WP_TEXT),
00182 
00183   /* Section_flags: mask of all section flags.  */
00184   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY
00185    | SEC_DATA),
00186 
00187    /* Leading_symbol_char: is the first char of a user symbol
00188       predictable, and if so what is it.  */
00189    0,
00190 
00191   /* AR_pad_char: pad character for filenames within an archive header
00192      FIXME:  this really has nothing to do with NLM, this is a characteristic
00193      of the archiver and/or os and should be independently tunable.  */
00194   '/',
00195 
00196   /* AR_max_namelen: maximum number of characters in an archive header
00197      FIXME:  this really has nothing to do with NLM, this is a characteristic
00198      of the archiver and should be independently tunable.  This value is
00199      a WAG (wild a** guess).  */
00200   15,
00201 
00202   /* Routines to byte-swap various sized integers from the data sections.  */
00203   bfd_getl64, bfd_getl_signed_64, bfd_putl64,
00204   bfd_getl32, bfd_getl_signed_32, bfd_putl32,
00205   bfd_getl16, bfd_getl_signed_16, bfd_putl16,
00206 
00207   /* Routines to byte-swap various sized integers from the file headers.  */
00208   bfd_getl64, bfd_getl_signed_64, bfd_putl64,
00209   bfd_getl32, bfd_getl_signed_32, bfd_putl32,
00210   bfd_getl16, bfd_getl_signed_16, bfd_putl16,
00211 
00212   /* bfd_check_format: check the format of a file being read.  */
00213   { _bfd_dummy_target,             /* Unknown format.  */
00214     nlmNAME(object_p),             /* Assembler/linker output (object file).  */
00215     bfd_generic_archive_p,  /* An archive.  */
00216     nlm_core_file_p         /* A core file.  */
00217   },
00218 
00219   /* bfd_set_format: set the format of a file being written.  */
00220   { bfd_false,
00221     nlm_mkobject,
00222     _bfd_generic_mkarchive,
00223     bfd_false
00224   },
00225 
00226   /* bfd_write_contents: write cached information into a file being written.  */
00227   { bfd_false,
00228     nlmNAME(write_object_contents),
00229     _bfd_write_archive_contents,
00230     bfd_false
00231   },
00232 
00233   /* Initialize a jump table with the standard macro.
00234      All names start with "nlm".  */
00235   BFD_JUMP_TABLE_GENERIC (_bfd_generic),
00236   BFD_JUMP_TABLE_COPY (_bfd_generic),
00237   BFD_JUMP_TABLE_CORE (_bfd_nocore),
00238   BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
00239   BFD_JUMP_TABLE_SYMBOLS (nlm),
00240   BFD_JUMP_TABLE_RELOCS (nlm),
00241   BFD_JUMP_TABLE_WRITE (nlm),
00242   BFD_JUMP_TABLE_LINK (nlm),
00243   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
00244 
00245   /* Alternative endian target.  */
00246 #ifdef TARGET_BIG_SYM
00247   & TARGET_BIG_SYM,
00248 #else
00249   NULL,
00250 #endif
00251 
00252   /* Backend_data.  */
00253   (void *) TARGET_BACKEND_DATA
00254 };
00255 #endif