Back to index

cell-binutils  2.17cvs20070401
tc-m68k.h
Go to the documentation of this file.
00001 /* This file is tc-m68k.h
00002    Copyright 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
00003    1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
00004    Free Software Foundation, Inc.
00005 
00006    This file is part of GAS, the GNU Assembler.
00007 
00008    GAS 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, or (at your option)
00011    any later version.
00012 
00013    GAS 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 GAS; see the file COPYING.  If not, write to the Free
00020    Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
00021    02110-1301, USA.  */
00022 
00023 #define TC_M68K 1
00024 
00025 struct fix;
00026 
00027 #define TARGET_BYTES_BIG_ENDIAN 1
00028 
00029 #ifdef OBJ_AOUT
00030 #ifdef TE_SUN3
00031 #define TARGET_FORMAT "a.out-sunos-big"
00032 #endif
00033 #ifdef TE_NetBSD
00034 #define TARGET_FORMAT "a.out-m68k-netbsd"
00035 #endif
00036 #ifdef TE_LINUX
00037 #define TARGET_FORMAT "a.out-m68k-linux"
00038 #endif
00039 #ifndef TARGET_FORMAT
00040 #define TARGET_FORMAT "a.out-zero-big"
00041 #endif
00042 #endif
00043 
00044 #ifdef OBJ_ELF
00045 #define TARGET_FORMAT "elf32-m68k"
00046 #endif
00047 
00048 #ifdef TE_APOLLO
00049 #define COFF_MAGIC          APOLLOM68KMAGIC
00050 #define COFF_AOUTHDR_MAGIC  APOLLO_COFF_VERSION_NUMBER
00051 #undef OBJ_COFF_OMIT_OPTIONAL_HEADER
00052 #endif
00053 
00054 #ifdef TE_AUX
00055 #define TARGET_FORMAT              "coff-m68k-aux"
00056 #endif
00057 #ifdef TE_DELTA
00058 #define TARGET_FORMAT              "coff-m68k-sysv"
00059 #endif
00060 
00061 #ifndef COFF_MAGIC
00062 #define COFF_MAGIC MC68MAGIC
00063 #endif
00064 #define TARGET_ARCH bfd_arch_m68k
00065 
00066 #define tc_comment_chars m68k_comment_chars
00067 extern const char *m68k_comment_chars;
00068 
00069 #define LISTING_WORD_SIZE 2 /* A word is 2 bytes */
00070 #define LISTING_LHS_WIDTH 2 /* One word on the first line */
00071 #define LISTING_LHS_WIDTH_SECOND 2 /* One word on the second line */
00072 #define LISTING_LHS_CONT_LINES 4/* And 4 lines max */
00073 #define LISTING_HEADER "68K GAS "
00074 
00075 #ifndef REGISTER_PREFIX
00076 #define REGISTER_PREFIX '%'
00077 #endif
00078 
00079 #if !defined (REGISTER_PREFIX_OPTIONAL)
00080 #if defined (M68KCOFF) || defined (OBJ_ELF)
00081 #define REGISTER_PREFIX_OPTIONAL 0
00082 #else /* ! (COFF || ELF) */
00083 #define REGISTER_PREFIX_OPTIONAL 1
00084 #endif /* ! (COFF || ELF) */
00085 #endif /* not def REGISTER_PREFIX and not def OPTIONAL_REGISTER_PREFIX */
00086 
00087 #ifdef TE_DELTA
00088 /* On the Delta, `%' can occur within a label name, but not as the
00089    initial character.  */
00090 #define LEX_PCT LEX_NAME
00091 /* On the Delta, `~' can start a label name, but is converted to '.'.  */
00092 #define LEX_TILDE LEX_BEGIN_NAME
00093 #define tc_canonicalize_symbol_name(s) ((*(s) == '~' ? *(s) = '.' : '.'), s)
00094 /* On the Delta, dots are not required before pseudo-ops.  */
00095 #define NO_PSEUDO_DOT 1
00096 #endif
00097 
00098 extern void m68k_mri_mode_change (int);
00099 #define MRI_MODE_CHANGE(i) m68k_mri_mode_change (i)
00100 
00101 extern int m68k_conditional_pseudoop (pseudo_typeS *);
00102 #define tc_conditional_pseudoop(pop) m68k_conditional_pseudoop (pop)
00103 
00104 extern void m68k_frob_label (symbolS *);
00105 #define tc_frob_label(sym) m68k_frob_label (sym)
00106 
00107 extern void m68k_flush_pending_output (void);
00108 #define md_flush_pending_output() m68k_flush_pending_output ()
00109 
00110 extern void m68k_frob_symbol (symbolS *);
00111 
00112 #define tc_frob_symbol(sym,punt)                        \
00113 do                                                      \
00114   {                                                     \
00115     if (S_GET_SEGMENT (sym) == reg_section)                    \
00116       punt = 1;                                                \
00117     m68k_frob_symbol (sym);                             \
00118   }                                                     \
00119 while (0)
00120 
00121 #define NO_RELOC BFD_RELOC_NONE
00122 #define RELAX_RELOC_ABS8  BFD_RELOC_8
00123 #define RELAX_RELOC_ABS16 BFD_RELOC_16
00124 #define RELAX_RELOC_ABS32 BFD_RELOC_32
00125 #define RELAX_RELOC_PC8   BFD_RELOC_8_PCREL
00126 #define RELAX_RELOC_PC16  BFD_RELOC_16_PCREL
00127 #define RELAX_RELOC_PC32  BFD_RELOC_32_PCREL
00128 
00129 #ifdef OBJ_ELF
00130 #define tc_fix_adjustable(X) tc_m68k_fix_adjustable(X)
00131 extern int tc_m68k_fix_adjustable (struct fix *);
00132 
00133 /* Target *-*-elf implies an embedded target.  No shared libs.
00134    *-*-uclinux also requires special casing to prevent GAS from
00135    generating unsupported R_68K_PC16 relocs.  */
00136 #define EXTERN_FORCE_RELOC \
00137   ((strcmp (TARGET_OS, "elf") != 0) && (strcmp (TARGET_OS, "uclinux") != 0))
00138 
00139 /* Values passed to md_apply_fix don't include symbol values.  */
00140 #define MD_APPLY_SYM_VALUE(FIX) 0
00141 
00142 #define elf_tc_final_processing m68k_elf_final_processing
00143 extern void m68k_elf_final_processing (void);
00144 #endif
00145 
00146 #define DIFF_EXPR_OK
00147 
00148 extern int m68k_parse_long_option (char *);
00149 #define md_parse_long_option m68k_parse_long_option
00150 
00151 #define md_operand(x)
00152 
00153 #define TARGET_ARCH bfd_arch_m68k
00154 
00155 extern struct relax_type md_relax_table[];
00156 #define TC_GENERIC_RELAX_TABLE md_relax_table
00157 
00158 /* We can't do a byte jump to the next instruction, so in that case
00159    force word mode by faking AIM.  */
00160 #define md_prepare_relax_scan(fragP, address, aim, this_state, this_type) \
00161   do                                                             \
00162     {                                                            \
00163       if (aim == 0 && this_type->rlx_forward == 127)                    \
00164         aim = 128;                                               \
00165     }                                                            \
00166   while (0)
00167 
00168 #define DWARF2_LINE_MIN_INSN_LENGTH 2
00169 
00170 /* We want .cfi_* pseudo-ops for generating unwind info.  */
00171 #define TARGET_USE_CFIPOP 1
00172 
00173 #define DWARF2_DEFAULT_RETURN_COLUMN 24
00174 #define DWARF2_CIE_DATA_ALIGNMENT (-4)
00175 
00176 #define tc_regname_to_dw2regnum tc_m68k_regname_to_dw2regnum
00177 extern int tc_m68k_regname_to_dw2regnum (char *regname);
00178 
00179 #define tc_cfi_frame_initial_instructions tc_m68k_frame_initial_instructions
00180 extern void tc_m68k_frame_initial_instructions (void);