Back to index

cell-binutils  2.17cvs20070401
ticoff.h
Go to the documentation of this file.
00001 /* Copyright 2002 Free Software Foundation, Inc.
00002 
00003    This file is part of BFD, the Binary File Descriptor library.
00004 
00005    This program is free software; you can redistribute it and/or modify
00006    it under the terms of the GNU General Public License as published by
00007    the Free Software Foundation; either version 2 of the License, or
00008    (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software
00017    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00018 
00019 #undef  F_LSYMS
00020 #define       F_LSYMS              F_LSYMS_TICOFF
00021 
00022 static bfd_boolean
00023 ticoff0_bad_format_hook (abfd, filehdr)
00024      bfd *abfd;
00025      PTR filehdr;
00026 {
00027   struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
00028 
00029   if (COFF0_BADMAG (*internal_f))
00030     return FALSE;
00031 
00032   return TRUE;
00033 }
00034 
00035 static bfd_boolean
00036 ticoff1_bad_format_hook (abfd, filehdr)
00037      bfd *abfd ATTRIBUTE_UNUSED;
00038      PTR filehdr;
00039 {
00040   struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
00041 
00042   if (COFF1_BADMAG (*internal_f))
00043     return FALSE;
00044 
00045   return TRUE;
00046 }
00047 
00048 /* Replace the stock _bfd_coff_is_local_label_name
00049    to recognize TI COFF local labels.  */
00050 static bfd_boolean 
00051 ticoff_bfd_is_local_label_name (abfd, name)
00052   bfd *abfd ATTRIBUTE_UNUSED;
00053   const char *name;
00054 {
00055   if (TICOFF_LOCAL_LABEL_P(name))
00056     return TRUE;
00057   return FALSE;
00058 }
00059 
00060 #define coff_bfd_is_local_label_name ticoff_bfd_is_local_label_name
00061 
00062 /* Customize coffcode.h; the default coff_ functions are set up to use COFF2; 
00063    coff_bad_format_hook uses BADMAG, so set that for COFF2.  The COFF1
00064    and COFF0 vectors use custom _bad_format_hook procs instead of setting
00065    BADMAG.  */ 
00066 #define BADMAG(x) COFF2_BADMAG(x)
00067 #include "coffcode.h"
00068 
00069 /* COFF0 differs in file/section header size and relocation entry size.  */
00070 static const bfd_coff_backend_data ticoff0_swap_table = 
00071 {
00072   coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in,
00073   coff_SWAP_aux_out, coff_SWAP_sym_out,
00074   coff_SWAP_lineno_out, coff_SWAP_reloc_out,
00075   coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out,
00076   coff_SWAP_scnhdr_out,
00077   FILHSZ_V0, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ_V0, LINESZ, FILNMLEN,
00078 #ifdef COFF_LONG_FILENAMES
00079   TRUE,
00080 #else
00081   FALSE,
00082 #endif
00083 #ifdef COFF_LONG_SECTION_NAMES
00084   TRUE,
00085 #else
00086   FALSE,
00087 #endif
00088   COFF_DEFAULT_SECTION_ALIGNMENT_POWER,
00089   coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in,
00090   coff_SWAP_reloc_in, ticoff0_bad_format_hook, coff_set_arch_mach_hook,
00091   coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook,
00092   coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook,
00093   coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate,
00094   coff_classify_symbol, coff_compute_section_file_positions,
00095   coff_start_final_link, coff_relocate_section, coff_rtype_to_howto,
00096   coff_adjust_symndx, coff_link_add_one_symbol,
00097   coff_link_output_has_begun, coff_final_link_postscript
00098 };
00099 
00100 /* COFF1 differs in section header size.  */
00101 static const bfd_coff_backend_data ticoff1_swap_table = 
00102 {
00103   coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in,
00104   coff_SWAP_aux_out, coff_SWAP_sym_out,
00105   coff_SWAP_lineno_out, coff_SWAP_reloc_out,
00106   coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out,
00107   coff_SWAP_scnhdr_out,
00108   FILHSZ, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ, LINESZ, FILNMLEN,
00109 #ifdef COFF_LONG_FILENAMES
00110   TRUE,
00111 #else
00112   FALSE,
00113 #endif
00114 #ifdef COFF_LONG_SECTION_NAMES
00115   TRUE,
00116 #else
00117   FALSE,
00118 #endif
00119   COFF_DEFAULT_SECTION_ALIGNMENT_POWER,
00120   coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in,
00121   coff_SWAP_reloc_in, ticoff1_bad_format_hook, coff_set_arch_mach_hook,
00122   coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook,
00123   coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook,
00124   coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate,
00125   coff_classify_symbol, coff_compute_section_file_positions,
00126   coff_start_final_link, coff_relocate_section, coff_rtype_to_howto,
00127   coff_adjust_symndx, coff_link_add_one_symbol,
00128   coff_link_output_has_begun, coff_final_link_postscript
00129 };
00130