Back to index

cell-binutils  2.17cvs20070401
tc-cris.h
Go to the documentation of this file.
00001 /* tc-cris.h -- Header file for tc-cris.c, the CRIS GAS port.
00002    Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2007
00003    Free Software Foundation, Inc.
00004 
00005    Contributed by Axis Communications AB, Lund, Sweden.
00006    Originally written for GAS 1.38.1 by Mikael Asker.
00007    Updates, BFDizing, GNUifying and ELF by Hans-Peter Nilsson.
00008 
00009    This file is part of GAS, the GNU Assembler.
00010 
00011    GAS is free software; you can redistribute it and/or modify
00012    it under the terms of the GNU General Public License as published by
00013    the Free Software Foundation; either version 2, or (at your option)
00014    any later version.
00015 
00016    GAS is distributed in the hope that it will be useful,
00017    but WITHOUT ANY WARRANTY; without even the implied warranty of
00018    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019    GNU General Public License for more details.
00020 
00021    You should have received a copy of the GNU General Public License
00022    along with GAS; see the file COPYING.  If not, write to the
00023    Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
00024    MA 02110-1301, USA.  */
00025 
00026 /* See the GAS "internal" document for general documentation on this.
00027    It is called internals.texi (internals.info when makeinfo:d), but is
00028    not installed or makeinfo:d by "make info".  */
00029 
00030 /* Functions and variables that aren't declared in tc.h are declared here,
00031    with the type/prototype that is used in the local extern-declaration of
00032    their usage.  */
00033 
00034 #ifndef TC_CRIS
00035 #define TC_CRIS
00036 
00037 /* Multi-target support is always on.  */
00038 extern const char *cris_target_format (void);
00039 #define TARGET_FORMAT cris_target_format ()
00040 
00041 #define TARGET_ARCH bfd_arch_cris
00042 
00043 extern unsigned int cris_mach (void);
00044 #define TARGET_MACH (cris_mach ())
00045 
00046 #define TARGET_BYTES_BIG_ENDIAN 0
00047 
00048 extern const char *md_shortopts;
00049 extern struct option md_longopts[];
00050 extern size_t md_longopts_size;
00051 
00052 extern const pseudo_typeS md_pseudo_table[];
00053 
00054 #define tc_comment_chars cris_comment_chars
00055 extern const char cris_comment_chars[];
00056 extern const char line_comment_chars[];
00057 extern const char line_separator_chars[];
00058 extern const char EXP_CHARS[];
00059 extern const char FLT_CHARS[];
00060 
00061 /* This should be optional, since it is ignored as an escape (assumed to
00062    be itself) if it is not recognized.  */
00063 #define ONLY_STANDARD_ESCAPES
00064 
00065 /* Note that we do not define TC_EQUAL_IN_INSN, since its current use is
00066    in the instruction rather than the operand, and thus does not come to
00067    use for side-effect assignments such as "and.d [r0 = r1 + 42], r3".  */
00068 #define md_operand(x)
00069 
00070 #define md_number_to_chars number_to_chars_littleendian
00071 
00072 /* There's no use having different functions for this; the sizes are the
00073    same.  Note that we can't #define md_short_jump_size here.  */
00074 #define md_create_short_jump md_create_long_jump
00075 
00076 extern const struct relax_type md_cris_relax_table[];
00077 #define TC_GENERIC_RELAX_TABLE md_cris_relax_table
00078 
00079 long cris_relax_frag (segT, fragS *, long);
00080 
00081 /* GAS only handles relaxations for pc-relative data targeting addresses
00082    in the same segment, so we have to handle the rest on our own.  */
00083 #define md_relax_frag(SEG, FRAGP, STRETCH)              \
00084  ((FRAGP)->fr_symbol != NULL                            \
00085   && S_GET_SEGMENT ((FRAGP)->fr_symbol) == (SEG) \
00086   ? relax_frag (SEG, FRAGP, STRETCH)                    \
00087   : cris_relax_frag (SEG, FRAGP, STRETCH))
00088 
00089 #define TC_FORCE_RELOCATION(FIX) md_cris_force_relocation (FIX)
00090 extern int md_cris_force_relocation (struct fix *);
00091 
00092 #define IS_CRIS_PIC_RELOC(RTYPE)                 \
00093   ((RTYPE) == BFD_RELOC_CRIS_16_GOT                     \
00094    || (RTYPE) == BFD_RELOC_CRIS_32_GOT                  \
00095    || (RTYPE) == BFD_RELOC_CRIS_16_GOTPLT        \
00096    || (RTYPE) == BFD_RELOC_CRIS_32_GOTPLT        \
00097    || (RTYPE) == BFD_RELOC_CRIS_32_GOTREL        \
00098    || (RTYPE) == BFD_RELOC_CRIS_32_PLT_GOTREL           \
00099    || (RTYPE) == BFD_RELOC_CRIS_32_PLT_PCREL)
00100 
00101 /* Make sure we don't resolve fixups for which we want to emit dynamic
00102    relocations.  */
00103 #define TC_FORCE_RELOCATION_LOCAL(FIX)                  \
00104   (!(FIX)->fx_pcrel                              \
00105    || IS_CRIS_PIC_RELOC ((FIX)->fx_r_type)              \
00106    || TC_FORCE_RELOCATION (FIX))
00107 
00108 /* For some reloc types, don't adjust fixups by reducing to a section
00109    symbol.  */
00110 #define tc_fix_adjustable(FIX)                          \
00111  ((FIX)->fx_r_type != BFD_RELOC_VTABLE_INHERIT          \
00112   && (FIX)->fx_r_type != BFD_RELOC_VTABLE_ENTRY         \
00113   && (! IS_CRIS_PIC_RELOC ((FIX)->fx_r_type)            \
00114       || (FIX)->fx_r_type == BFD_RELOC_CRIS_32_GOTREL))
00115 
00116 /* FIXME: This *should* be a redundant definition, as the
00117    TC_FORCE_RELOCATION* definitions already told about the cases where
00118    we *don't* want the symbol value calculated.  Here we seem to answer
00119    the "are you sure" question.  It certainly has very little to do with
00120    whether the symbol value is passed to md_apply_fix.  */
00121 #define MD_APPLY_SYM_VALUE(FIX) 0
00122 
00123 /* When we have fixups against constant expressions, we get a GAS-specific
00124    section symbol at no extra charge for obscure reasons in
00125    adjust_reloc_syms.  Since ELF outputs section symbols, it gladly
00126    outputs this "*ABS*" symbol in every object.  Avoid that.
00127    Also, don't emit undefined symbols (that aren't used in relocations).
00128    They pop up when tentatively parsing register names as symbols.  */
00129 #define tc_frob_symbol(symp, punt)               \
00130  do {                                            \
00131   if ((OUTPUT_FLAVOR == bfd_target_elf_flavour          \
00132        && (symp) == section_symbol (absolute_section))  \
00133       || ! S_IS_DEFINED (symp))                         \
00134     (punt) = 1;                                         \
00135  } while (0)
00136 
00137 #define LISTING_HEADER "GAS for CRIS"
00138 
00139 #if 0
00140 /* The testsuite does not let me define these, although they IMHO should
00141    be preferred over the default.  */
00142 #define LISTING_WORD_SIZE 2
00143 #define LISTING_LHS_WIDTH 4
00144 #define LISTING_LHS_WIDTH_SECOND 4
00145 #endif
00146 
00147 /* END of declaration and definitions described in the "internals"
00148    document.  */
00149 
00150 /* Do this, or we will never know what hit us when the
00151    broken-word-fixes break.  Do _not_ use WARN_SIGNED_OVERFLOW_WORD,
00152    it is only for use with WORKING_DOT_WORD and warns about most stuff.
00153    (still in 2.9.1).  */
00154 struct broken_word;
00155 extern void tc_cris_check_adjusted_broken_word (offsetT,
00156                                           struct broken_word *);
00157 #define TC_CHECK_ADJUSTED_BROKEN_DOT_WORD(new_offset, brokw) \
00158  tc_cris_check_adjusted_broken_word ((offsetT) (new_offset), brokw)
00159 
00160 /* We don't want any implicit alignment, so we do nothing.  */
00161 #define TC_IMPLICIT_LCOMM_ALIGNMENT(SIZE, P2VAR) do { } while (0)
00162 
00163 /* CRIS instructions, with operands and prefixes included, are a multiple
00164    of two bytes long.  */
00165 #define DWARF2_LINE_MIN_INSN_LENGTH 2
00166 
00167 /* Make port immune to unwanted difference in te-generic.h vs. te-linux.h.  */
00168 #define LOCAL_LABELS_DOLLAR 1
00169 
00170 #endif /* TC_CRIS */
00171 /*
00172  * Local variables:
00173  * eval: (c-set-style "gnu")
00174  * indent-tabs-mode: t
00175  * End:
00176  */