1179404Sobrien/* tc-mips.h -- header file for tc-mips.c.
2218822Sdim   Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003, 2004,
3218822Sdim   2005, 2006 Free Software Foundation, Inc.
4179404Sobrien   Contributed by the OSF and Ralph Campbell.
5179404Sobrien   Written by Keith Knowles and Ralph Campbell, working independently.
6179404Sobrien   Modified for ECOFF support by Ian Lance Taylor of Cygnus Support.
7179404Sobrien
8179404Sobrien   This file is part of GAS.
9179404Sobrien
10179404Sobrien   GAS is free software; you can redistribute it and/or modify
11179404Sobrien   it under the terms of the GNU General Public License as published by
12179404Sobrien   the Free Software Foundation; either version 2, or (at your option)
13179404Sobrien   any later version.
14179404Sobrien
15179404Sobrien   GAS is distributed in the hope that it will be useful,
16179404Sobrien   but WITHOUT ANY WARRANTY; without even the implied warranty of
17179404Sobrien   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18179404Sobrien   GNU General Public License for more details.
19179404Sobrien
20179404Sobrien   You should have received a copy of the GNU General Public License
21179404Sobrien   along with GAS; see the file COPYING.  If not, write to the Free
22218822Sdim   Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
23218822Sdim   02110-1301, USA.  */
24179404Sobrien
25179404Sobrien#ifndef TC_MIPS
26179404Sobrien#define TC_MIPS
27179404Sobrien
28179404Sobrienstruct frag;
29179404Sobrienstruct expressionS;
30179404Sobrien
31179404Sobrien/* Default to big endian.  */
32179404Sobrien#ifndef TARGET_BYTES_BIG_ENDIAN
33179404Sobrien#define TARGET_BYTES_BIG_ENDIAN		1
34179404Sobrien#endif
35179404Sobrien
36179404Sobrien#define TARGET_ARCH bfd_arch_mips
37179404Sobrien
38179404Sobrien#define WORKING_DOT_WORD	1
39179404Sobrien#define OLD_FLOAT_READS
40179404Sobrien#define REPEAT_CONS_EXPRESSIONS
41179404Sobrien#define RELOC_EXPANSION_POSSIBLE
42179404Sobrien#define MAX_RELOC_EXPANSION 3
43179404Sobrien#define LOCAL_LABELS_FB 1
44179404Sobrien
45179404Sobrien/* Maximum symbol offset that can be encoded in a BFD_RELOC_GPREL16
46179404Sobrien   relocation.  */
47179404Sobrien#define MAX_GPREL_OFFSET (0x7FF0)
48179404Sobrien
49179404Sobrien#define md_relax_frag(segment, fragp, stretch) \
50179404Sobrien  mips_relax_frag(segment, fragp, stretch)
51179404Sobrienextern int mips_relax_frag (asection *, struct frag *, long);
52179404Sobrien
53179404Sobrien#define md_undefined_symbol(name)	(0)
54179404Sobrien#define md_operand(x)
55179404Sobrien
56179404Sobrienextern void mips_handle_align (struct frag *);
57179404Sobrien#define HANDLE_ALIGN(fragp)  mips_handle_align (fragp)
58179404Sobrien
59179404Sobrien#define MAX_MEM_FOR_RS_ALIGN_CODE  (1 + 2)
60179404Sobrien
61218822Sdimstruct insn_label_list;
62218822Sdim#define TC_SEGMENT_INFO_TYPE struct insn_label_list *
63179404Sobrien
64218822Sdim/* This field is nonzero if the symbol is the target of a MIPS16 jump.  */
65218822Sdim#define TC_SYMFIELD_TYPE int
66218822Sdim
67179404Sobrien/* Tell assembler that we have an itbl_mips.h header file to include.  */
68179404Sobrien#define HAVE_ITBL_CPU
69179404Sobrien
70179404Sobrien/* The endianness of the target format may change based on command
71179404Sobrien   line arguments.  */
72179404Sobrien#define TARGET_FORMAT mips_target_format()
73179404Sobrienextern const char *mips_target_format (void);
74179404Sobrien
75179404Sobrien/* MIPS PIC level.  */
76179404Sobrien
77179404Sobrienenum mips_pic_level
78179404Sobrien{
79179404Sobrien  /* Do not generate PIC code.  */
80179404Sobrien  NO_PIC,
81179404Sobrien
82179404Sobrien  /* Generate PIC code as in the SVR4 MIPS ABI.  */
83179404Sobrien  SVR4_PIC,
84179404Sobrien
85218822Sdim  /* VxWorks's PIC model.  */
86218822Sdim  VXWORKS_PIC
87179404Sobrien};
88179404Sobrien
89179404Sobrienextern enum mips_pic_level mips_pic;
90179404Sobrien
91179404Sobrienextern int tc_get_register (int frame);
92179404Sobrien
93179404Sobrien#define md_after_parse_args() mips_after_parse_args()
94179404Sobrienextern void mips_after_parse_args (void);
95179404Sobrien
96179404Sobrien#define tc_init_after_args() mips_init_after_args()
97179404Sobrienextern void mips_init_after_args (void);
98179404Sobrien
99179404Sobrien#define md_parse_long_option(arg) mips_parse_long_option (arg)
100179404Sobrienextern int mips_parse_long_option (const char *);
101179404Sobrien
102179404Sobrien#define tc_frob_label(sym) mips_define_label (sym)
103179404Sobrienextern void mips_define_label (symbolS *);
104179404Sobrien
105179404Sobrien#define tc_frob_file_before_adjust() mips_frob_file_before_adjust ()
106179404Sobrienextern void mips_frob_file_before_adjust (void);
107179404Sobrien
108179404Sobrien#define tc_frob_file_before_fix() mips_frob_file ()
109179404Sobrienextern void mips_frob_file (void);
110179404Sobrien
111179404Sobrien#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
112179404Sobrien#define tc_frob_file_after_relocs mips_frob_file_after_relocs
113179404Sobrienextern void mips_frob_file_after_relocs (void);
114179404Sobrien#endif
115179404Sobrien
116179404Sobrien#define tc_fix_adjustable(fixp) mips_fix_adjustable (fixp)
117179404Sobrienextern int mips_fix_adjustable (struct fix *);
118179404Sobrien
119218822Sdim/* Values passed to md_apply_fix don't include symbol values.  */
120179404Sobrien#define MD_APPLY_SYM_VALUE(FIX) 0
121179404Sobrien
122218822Sdim/* Global syms must not be resolved, to support ELF shared libraries.  */
123179404Sobrien#define EXTERN_FORCE_RELOC			\
124218822Sdim  (OUTPUT_FLAVOR == bfd_target_elf_flavour)
125179404Sobrien
126218822Sdim/* When generating NEWABI code, we may need to have to keep combined
127218822Sdim   relocations which don't have symbols.  */
128179404Sobrien#define TC_FORCE_RELOCATION(FIX) mips_force_relocation (FIX)
129179404Sobrienextern int mips_force_relocation (struct fix *);
130179404Sobrien
131179404Sobrien#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG) \
132179404Sobrien  (! SEG_NORMAL (SEG) || mips_force_relocation (FIX))
133179404Sobrien
134179404Sobrien/* Register mask variables.  These are set by the MIPS assembly code
135179404Sobrien   and used by ECOFF and possibly other object file formats.  */
136179404Sobrienextern unsigned long mips_gprmask;
137179404Sobrienextern unsigned long mips_cprmask[4];
138179404Sobrien
139179404Sobrien#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
140179404Sobrien
141179404Sobrien#define elf_tc_final_processing mips_elf_final_processing
142179404Sobrienextern void mips_elf_final_processing (void);
143179404Sobrien
144179404Sobrien#endif
145179404Sobrien
146179404Sobrienextern void md_mips_end (void);
147179404Sobrien#define md_end()	md_mips_end()
148179404Sobrien
149179404Sobrienextern void mips_pop_insert (void);
150179404Sobrien#define md_pop_insert()		mips_pop_insert()
151179404Sobrien
152208737Sjmallettextern void mips_emit_delays (void);
153208737Sjmallett#define md_flush_pending_output mips_emit_delays
154179404Sobrien
155179404Sobrienextern void mips_enable_auto_align (void);
156179404Sobrien#define md_elf_section_change_hook()	mips_enable_auto_align()
157179404Sobrien
158218822Sdimextern int mips_dwarf2_addr_size (void);
159179404Sobrien#define DWARF2_ADDR_SIZE(bfd) mips_dwarf2_addr_size ()
160179404Sobrien
161218822Sdim#define TARGET_USE_CFIPOP 1
162218822Sdim
163218822Sdim#define tc_cfi_frame_initial_instructions mips_cfi_frame_initial_instructions
164218822Sdimextern void mips_cfi_frame_initial_instructions (void);
165218822Sdim
166218822Sdim#define tc_regname_to_dw2regnum tc_mips_regname_to_dw2regnum
167218822Sdimextern int tc_mips_regname_to_dw2regnum (char *regname);
168218822Sdim
169218822Sdim#define DWARF2_DEFAULT_RETURN_COLUMN 31
170218822Sdim#define DWARF2_CIE_DATA_ALIGNMENT (-4)
171218822Sdim
172179404Sobrien#endif /* TC_MIPS */
173