Back to index

cell-binutils  2.17cvs20070401
xcoff-target.h
Go to the documentation of this file.
00001 /* Common definitions for backends based on IBM RS/6000 "XCOFF64" files.
00002    Copyright 2000, 2001, 2002, 2004, 2005, 2006
00003    Free Software Foundation, Inc.
00004    Contributed by Cygnus Support.
00005 
00006    This file is part of BFD, the Binary File Descriptor library.
00007 
00008    This program is free software; you can redistribute it and/or modify
00009    it under the terms of the GNU General Public License as published by
00010    the Free Software Foundation; either version 2 of the License, or
00011    (at your option) any later version.
00012 
00013    This program is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016    GNU General Public License for more details.
00017 
00018    You should have received a copy of the GNU General Public License
00019    along with this program; if not, write to the Free Software
00020    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00021 
00022 /* Internalcoff.h and coffcode.h modify themselves based on this flag.  */
00023 #define RS6000COFF_C 1
00024 
00025 #define SELECT_RELOC(internal, howto)                                 \
00026   {                                                            \
00027     internal.r_type = howto->type;                             \
00028     internal.r_size =                                                 \
00029       ((howto->complain_on_overflow == complain_overflow_signed              \
00030        ? 0x80                                                  \
00031        : 0)                                                    \
00032        | (howto->bitsize - 1));                                       \
00033   }
00034 
00035 #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER 3
00036 
00037 #define COFF_LONG_FILENAMES
00038 
00039 #define NO_COFF_SYMBOLS
00040 
00041 #define RTYPE2HOWTO(cache_ptr, dst) _bfd_xcoff_rtype2howto (cache_ptr, dst)
00042 
00043 #define coff_mkobject                                  _bfd_xcoff_mkobject
00044 #define coff_bfd_copy_private_bfd_data                 _bfd_xcoff_copy_private_bfd_data
00045 #define coff_bfd_is_local_label_name                   _bfd_xcoff_is_local_label_name
00046 #define coff_bfd_is_target_special_symbol  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
00047 #define coff_bfd_reloc_type_lookup                     _bfd_xcoff_reloc_type_lookup
00048 #define coff_relocate_section                          _bfd_ppc_xcoff_relocate_section
00049 #define coff_core_file_failing_command                 _bfd_nocore_core_file_failing_command
00050 #define coff_core_file_failing_signal                  _bfd_nocore_core_file_failing_signal
00051 #define coff_core_file_matches_executable_p            _bfd_nocore_core_file_matches_executable_p
00052 #define _bfd_xcoff_bfd_get_relocated_section_contents  coff_bfd_get_relocated_section_contents
00053 #define _bfd_xcoff_bfd_relax_section                   coff_bfd_relax_section
00054 #define _bfd_xcoff_bfd_gc_sections                     coff_bfd_gc_sections
00055 #define _bfd_xcoff_bfd_merge_sections                  coff_bfd_merge_sections
00056 #define _bfd_xcoff_bfd_discard_group                   bfd_generic_discard_group
00057 #define _bfd_xcoff_section_already_linked              _bfd_generic_section_already_linked
00058 #define _bfd_xcoff_bfd_link_split_section              coff_bfd_link_split_section
00059 
00060 #define CORE_FILE_P _bfd_dummy_target
00061 
00062 #ifdef AIX_CORE
00063 
00064 #undef  CORE_FILE_P
00065 #define CORE_FILE_P rs6000coff_core_p
00066 extern const bfd_target * rs6000coff_core_p (bfd *);
00067 extern bfd_boolean rs6000coff_core_file_matches_executable_p (bfd *, bfd*);
00068 
00069 #undef coff_core_file_matches_executable_p
00070 #define coff_core_file_matches_executable_p  \
00071                                  rs6000coff_core_file_matches_executable_p
00072 
00073 extern char *rs6000coff_core_file_failing_command (bfd *);
00074 #undef  coff_core_file_failing_command
00075 #define coff_core_file_failing_command rs6000coff_core_file_failing_command
00076 
00077 extern int rs6000coff_core_file_failing_signal (bfd *);
00078 #undef  coff_core_file_failing_signal
00079 #define coff_core_file_failing_signal rs6000coff_core_file_failing_signal
00080 #endif /* AIX_CORE */
00081 
00082 #ifdef LYNX_CORE
00083 
00084 #undef  CORE_FILE_P
00085 #define CORE_FILE_P lynx_core_file_p
00086 extern const bfd_target *lynx_core_file_p (bfd *);
00087 
00088 extern bfd_boolean lynx_core_file_matches_executable_p (bfd *, bfd *);
00089 #undef coff_core_file_matches_executable_p
00090 #define coff_core_file_matches_executable_p lynx_core_file_matches_executable_p
00091 
00092 extern char *lynx_core_file_failing_command (bfd *);
00093 #undef  coff_core_file_failing_command
00094 #define coff_core_file_failing_command lynx_core_file_failing_command
00095 
00096 extern int lynx_core_file_failing_signal (bfd *);
00097 #undef  coff_core_file_failing_signal
00098 #define coff_core_file_failing_signal lynx_core_file_failing_signal
00099 
00100 #endif /* LYNX_CORE */
00101 
00102 /* XCOFF archives do not have anything which corresponds to an
00103    extended name table.  */
00104 
00105 #define _bfd_xcoff_slurp_extended_name_table bfd_false
00106 #define _bfd_xcoff_construct_extended_name_table \
00107   ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false)
00108 #define _bfd_xcoff_truncate_arname bfd_dont_truncate_arname
00109 
00110 /* We can use the standard get_elt_at_index routine.  */
00111 
00112 #define _bfd_xcoff_get_elt_at_index _bfd_generic_get_elt_at_index
00113 
00114 /* XCOFF archives do not have a timestamp.  */
00115 
00116 #define _bfd_xcoff_update_armap_timestamp bfd_true
00117 
00118 extern bfd_boolean        _bfd_xcoff_mkobject (bfd *);
00119 extern bfd_boolean        _bfd_xcoff_copy_private_bfd_data (bfd *, bfd *);
00120 extern bfd_boolean        _bfd_xcoff_is_local_label_name (bfd *, const char *);
00121 extern void               _bfd_xcoff_rtype2howto  (arelent *, struct internal_reloc *);
00122 extern bfd_boolean        _bfd_xcoff_slurp_armap (bfd *);
00123 extern void *             _bfd_xcoff_read_ar_hdr (bfd *);
00124 extern bfd *              _bfd_xcoff_openr_next_archived_file (bfd *, bfd *);
00125 extern int                _bfd_xcoff_generic_stat_arch_elt (bfd *, struct stat *);
00126 extern bfd_boolean        _bfd_xcoff_write_armap  (bfd *, unsigned int, struct orl *, unsigned int, int);
00127 extern bfd_boolean        _bfd_xcoff_write_archive_contents (bfd *);
00128 extern int                _bfd_xcoff_sizeof_headers (bfd *, struct bfd_link_info *);
00129 extern void               _bfd_xcoff_swap_sym_in (bfd *, void *, void *);
00130 extern unsigned int       _bfd_xcoff_swap_sym_out (bfd *, void *, void *);
00131 extern void               _bfd_xcoff_swap_aux_in (bfd *, void *, int, int, int, int, void *);
00132 extern unsigned int       _bfd_xcoff_swap_aux_out (bfd *, void *, int, int, int, int, void *);
00133 extern reloc_howto_type * _bfd_xcoff_reloc_type_lookup  (bfd *, bfd_reloc_code_real_type);
00134 extern const bfd_target * _bfd_xcoff_archive_p (bfd *);
00135 
00136 #ifndef coff_SWAP_sym_in
00137 #define coff_SWAP_sym_in  _bfd_xcoff_swap_sym_in
00138 #define coff_SWAP_sym_out _bfd_xcoff_swap_sym_out
00139 #define coff_SWAP_aux_in  _bfd_xcoff_swap_aux_in
00140 #define coff_SWAP_aux_out _bfd_xcoff_swap_aux_out
00141 #endif
00142 
00143 #include "coffcode.h"
00144 
00145 /* The transfer vector that leads the outside world to all of the above.  */
00146 
00147 const bfd_target TARGET_SYM =
00148 {
00149   TARGET_NAME,
00150   bfd_target_xcoff_flavour,
00151   BFD_ENDIAN_BIG,           /* Data byte order is big.  */
00152   BFD_ENDIAN_BIG,           /* Header byte order is big.  */
00153 
00154   (HAS_RELOC | EXEC_P |            /* Object flags.  */
00155    HAS_LINENO | HAS_DEBUG | DYNAMIC |
00156    HAS_SYMS | HAS_LOCALS | WP_TEXT),
00157 
00158   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags.  */
00159   0,                        /* Leading char.  */
00160   '/',                      /* AR_pad_char.  */
00161   15,                       /* AR_max_namelen??? FIXME.  */
00162 
00163   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
00164      bfd_getb32, bfd_getb_signed_32, bfd_putb32,
00165      bfd_getb16, bfd_getb_signed_16, bfd_putb16,/* Data.  */
00166   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
00167      bfd_getb32, bfd_getb_signed_32, bfd_putb32,
00168      bfd_getb16, bfd_getb_signed_16, bfd_putb16,/* Headers.  */
00169 
00170   {_bfd_dummy_target, coff_object_p,             /* bfd_check_format.  */
00171      _bfd_xcoff_archive_p, CORE_FILE_P},
00172   {bfd_false, coff_mkobject,                     /* bfd_set_format.  */
00173      _bfd_generic_mkarchive, bfd_false},
00174   {bfd_false, coff_write_object_contents, /* bfd_write_contents.  */
00175      _bfd_xcoff_write_archive_contents, bfd_false},
00176 
00177      BFD_JUMP_TABLE_GENERIC (coff),
00178      BFD_JUMP_TABLE_COPY (coff),
00179      BFD_JUMP_TABLE_CORE (coff),
00180      BFD_JUMP_TABLE_ARCHIVE (_bfd_xcoff),
00181      BFD_JUMP_TABLE_SYMBOLS (coff),
00182      BFD_JUMP_TABLE_RELOCS (coff),
00183      BFD_JUMP_TABLE_WRITE (coff),
00184      BFD_JUMP_TABLE_LINK (_bfd_xcoff),
00185      BFD_JUMP_TABLE_DYNAMIC (_bfd_xcoff),
00186 
00187   NULL,
00188 
00189   COFF_SWAP_TABLE
00190 };