tc-mips.h revision 292340
1165670Sache/* tc-mips.h -- header file for tc-mips.c. 2165670Sache Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003, 2004, 3165670Sache 2005, 2006 Free Software Foundation, Inc. 4165670Sache Contributed by the OSF and Ralph Campbell. 5165670Sache Written by Keith Knowles and Ralph Campbell, working independently. 6165670Sache Modified for ECOFF support by Ian Lance Taylor of Cygnus Support. 7165670Sache 8165670Sache This file is part of GAS. 9165670Sache 10165670Sache GAS is free software; you can redistribute it and/or modify 11165670Sache it under the terms of the GNU General Public License as published by 12165670Sache the Free Software Foundation; either version 2, or (at your option) 13165670Sache any later version. 14165670Sache 15165670Sache GAS is distributed in the hope that it will be useful, 16165670Sache but WITHOUT ANY WARRANTY; without even the implied warranty of 17165670Sache MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18165670Sache GNU General Public License for more details. 19165670Sache 20165670Sache You should have received a copy of the GNU General Public License 21165670Sache along with GAS; see the file COPYING. If not, write to the Free 22165670Sache Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 23165670Sache 02110-1301, USA. */ 24165670Sache 25165670Sache#ifndef TC_MIPS 26165670Sache#define TC_MIPS 27165670Sache 28165670Sachestruct frag; 29165670Sachestruct expressionS; 30165670Sache 31165670Sache/* Default to big endian. */ 32165670Sache#ifndef TARGET_BYTES_BIG_ENDIAN 33165670Sache#define TARGET_BYTES_BIG_ENDIAN 1 34165670Sache#endif 35165670Sache 36165670Sache#define TARGET_ARCH bfd_arch_mips 37165670Sache 38165670Sache#define WORKING_DOT_WORD 1 39165670Sache#define OLD_FLOAT_READS 40165670Sache#define REPEAT_CONS_EXPRESSIONS 41165670Sache#define RELOC_EXPANSION_POSSIBLE 42165670Sache#define MAX_RELOC_EXPANSION 3 43165670Sache#define LOCAL_LABELS_FB 1 44165670Sache 45165670Sache/* Maximum symbol offset that can be encoded in a BFD_RELOC_GPREL16 46165670Sache relocation. */ 47165670Sache#define MAX_GPREL_OFFSET (0x7FF0) 48165670Sache 49165670Sache#define md_relax_frag(segment, fragp, stretch) \ 50165670Sache mips_relax_frag(segment, fragp, stretch) 51165670Sacheextern int mips_relax_frag (asection *, struct frag *, long); 52165670Sache 53165670Sache#define md_undefined_symbol(name) (0) 54165670Sache#define md_operand(x) 55165670Sache 56165670Sacheextern void mips_handle_align (struct frag *); 57165670Sache#define HANDLE_ALIGN(fragp) mips_handle_align (fragp) 58165670Sache 59165670Sache#define MAX_MEM_FOR_RS_ALIGN_CODE (1 + 2) 60165670Sache 61165670Sachestruct insn_label_list; 62165670Sache#define TC_SEGMENT_INFO_TYPE struct insn_label_list * 63165670Sache 64165670Sache/* This field is nonzero if the symbol is the target of a MIPS16 jump. */ 65165670Sache#define TC_SYMFIELD_TYPE int 66165670Sache 67165670Sache/* Tell assembler that we have an itbl_mips.h header file to include. */ 68165670Sache#define HAVE_ITBL_CPU 69165670Sache 70165670Sache/* The endianness of the target format may change based on command 71165670Sache line arguments. */ 72165670Sache#define TARGET_FORMAT mips_target_format() 73165670Sacheextern const char *mips_target_format (void); 74165670Sache 75157184Sache/* MIPS PIC level. */ 76157184Sache 77157184Sacheenum mips_pic_level 78157184Sache{ 79157184Sache /* Do not generate PIC code. */ 80157184Sache NO_PIC, 81157184Sache 82157184Sache /* Generate PIC code as in the SVR4 MIPS ABI. */ 83157184Sache SVR4_PIC, 84157184Sache 85157184Sache /* VxWorks's PIC model. */ 86157184Sache VXWORKS_PIC 87157184Sache}; 88157184Sache 89157184Sacheextern enum mips_pic_level mips_pic; 90157184Sache 91157184Sacheextern int tc_get_register (int frame); 92157184Sache 93157184Sache#define md_after_parse_args() mips_after_parse_args() 94157184Sacheextern void mips_after_parse_args (void); 95157184Sache 96157184Sache#define tc_init_after_args() mips_init_after_args() 97157184Sacheextern void mips_init_after_args (void); 98157184Sache 99157184Sache#define md_parse_long_option(arg) mips_parse_long_option (arg) 100157184Sacheextern int mips_parse_long_option (const char *); 101157184Sache 102157184Sache#define tc_frob_label(sym) mips_define_label (sym) 103157184Sacheextern void mips_define_label (symbolS *); 104157184Sache 105157184Sache#define tc_frob_file_before_adjust() mips_frob_file_before_adjust () 106157184Sacheextern void mips_frob_file_before_adjust (void); 107157184Sache 108157184Sache#define tc_frob_file_before_fix() mips_frob_file () 109157184Sacheextern void mips_frob_file (void); 110157184Sache 111157184Sache#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) 112157184Sache#define tc_frob_file_after_relocs mips_frob_file_after_relocs 113157184Sacheextern void mips_frob_file_after_relocs (void); 114157184Sache#endif 115157184Sache 116157184Sache#define tc_fix_adjustable(fixp) mips_fix_adjustable (fixp) 117157184Sacheextern int mips_fix_adjustable (struct fix *); 118157184Sache 119157184Sache/* Values passed to md_apply_fix don't include symbol values. */ 120157184Sache#define MD_APPLY_SYM_VALUE(FIX) 0 121157184Sache 122157184Sache/* Global syms must not be resolved, to support ELF shared libraries. */ 123157184Sache#define EXTERN_FORCE_RELOC \ 124157184Sache (OUTPUT_FLAVOR == bfd_target_elf_flavour) 125157184Sache 126157184Sache/* When generating NEWABI code, we may need to have to keep combined 127157184Sache relocations which don't have symbols. */ 128157184Sache#define TC_FORCE_RELOCATION(FIX) mips_force_relocation (FIX) 129157184Sacheextern int mips_force_relocation (struct fix *); 130157184Sache 131157184Sache#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG) \ 132157184Sache (! SEG_NORMAL (SEG) || mips_force_relocation (FIX)) 133157184Sache 134157184Sache/* Register mask variables. These are set by the MIPS assembly code 135157184Sache and used by ECOFF and possibly other object file formats. */ 136157184Sacheextern unsigned long mips_gprmask; 137157184Sacheextern unsigned long mips_cprmask[4]; 138157184Sache 139157184Sache#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) 140157184Sache 141157184Sache#define elf_tc_final_processing mips_elf_final_processing 142157184Sacheextern void mips_elf_final_processing (void); 143157184Sache 144157184Sache#endif 145157184Sache 146157184Sacheextern void md_mips_end (void); 147157184Sache#define md_end() md_mips_end() 148157184Sache 149157184Sacheextern void mips_pop_insert (void); 150157184Sache#define md_pop_insert() mips_pop_insert() 151157184Sache 152157184Sacheextern void mips_emit_delays (void); 153157184Sache#define md_flush_pending_output mips_emit_delays 154157184Sache 155157184Sacheextern void mips_enable_auto_align (void); 156157184Sache#define md_elf_section_change_hook() mips_enable_auto_align() 157157184Sache 158157184Sacheextern int mips_dwarf2_addr_size (void); 159157184Sache#define DWARF2_ADDR_SIZE(bfd) mips_dwarf2_addr_size () 160157184Sache 161157184Sache#define TARGET_USE_CFIPOP 1 162157184Sache 163157184Sache#define tc_cfi_frame_initial_instructions mips_cfi_frame_initial_instructions 164157184Sacheextern void mips_cfi_frame_initial_instructions (void); 165157184Sache 166157184Sache#define tc_regname_to_dw2regnum tc_mips_regname_to_dw2regnum 167157184Sacheextern int tc_mips_regname_to_dw2regnum (char *regname); 168157184Sache 169157184Sache#define DWARF2_DEFAULT_RETURN_COLUMN 31 170157184Sache#define DWARF2_CIE_DATA_ALIGNMENT (-4) 171157184Sache 172157184Sache#endif /* TC_MIPS */ 173157184Sache