]>
Commit | Line | Data |
---|---|---|
252b5132 | 1 | /* This file is tc-m68k.h |
f7e42eb4 NC |
2 | Copyright 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, |
3 | 1998, 1999, 2000 | |
252b5132 RH |
4 | Free Software Foundation, Inc. |
5 | ||
6 | This file is part of GAS, the GNU Assembler. | |
7 | ||
8 | GAS is free software; you can redistribute it and/or modify | |
9 | it under the terms of the GNU General Public License as published by | |
10 | the Free Software Foundation; either version 2, or (at your option) | |
11 | any later version. | |
12 | ||
13 | GAS is distributed in the hope that it will be useful, | |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
19 | along with GAS; see the file COPYING. If not, write to the Free | |
20 | Software Foundation, 59 Temple Place - Suite 330, Boston, MA | |
21 | 02111-1307, USA. */ | |
22 | ||
23 | #define TC_M68K 1 | |
24 | ||
25 | #ifdef ANSI_PROTOTYPES | |
252b5132 RH |
26 | struct fix; |
27 | #endif | |
28 | ||
29 | #define TARGET_BYTES_BIG_ENDIAN 1 | |
30 | ||
31 | #ifdef OBJ_AOUT | |
32 | #ifdef TE_SUN3 | |
33 | #define TARGET_FORMAT "a.out-sunos-big" | |
34 | #endif | |
35 | #ifdef TE_NetBSD | |
36 | #define TARGET_FORMAT "a.out-m68k-netbsd" | |
37 | #endif | |
38 | #ifdef TE_LINUX | |
39 | #define TARGET_FORMAT "a.out-m68k-linux" | |
40 | #endif | |
41 | #ifndef TARGET_FORMAT | |
42 | #define TARGET_FORMAT "a.out-zero-big" | |
43 | #endif | |
44 | #endif | |
45 | ||
46 | #ifdef OBJ_ELF | |
47 | #define TARGET_FORMAT "elf32-m68k" | |
48 | #endif | |
49 | ||
50 | #ifdef TE_APOLLO | |
51 | #define COFF_MAGIC APOLLOM68KMAGIC | |
52 | #define COFF_AOUTHDR_MAGIC APOLLO_COFF_VERSION_NUMBER | |
53 | #undef OBJ_COFF_OMIT_OPTIONAL_HEADER | |
54 | #endif | |
55 | ||
56 | #ifdef TE_LYNX | |
57 | #define TARGET_FORMAT "coff-m68k-lynx" | |
58 | #endif | |
59 | #ifdef TE_AUX | |
60 | #define TARGET_FORMAT "coff-m68k-aux" | |
61 | #endif | |
62 | #ifdef TE_DELTA | |
63 | #define TARGET_FORMAT "coff-m68k-sysv" | |
64 | #endif | |
65 | ||
66 | #ifndef COFF_MAGIC | |
67 | #define COFF_MAGIC MC68MAGIC | |
68 | #endif | |
69 | #define BFD_ARCH bfd_arch_m68k /* for non-BFD_ASSEMBLER */ | |
70 | #define TARGET_ARCH bfd_arch_m68k /* BFD_ASSEMBLER */ | |
71 | #define COFF_FLAGS F_AR32W | |
72 | #define TC_COUNT_RELOC(x) ((x)->fx_addsy||(x)->fx_subsy) | |
73 | ||
74 | #define TC_COFF_FIX2RTYPE(fixP) tc_coff_fix2rtype(fixP) | |
75 | #define TC_COFF_SIZEMACHDEP(frag) tc_coff_sizemachdep(frag) | |
76 | extern int tc_coff_sizemachdep PARAMS ((struct frag *)); | |
77 | #ifdef TE_SUN3 | |
78 | /* This variable contains the value to write out at the beginning of | |
79 | the a.out file. The 2<<16 means that this is a 68020 file instead | |
80 | of an old-style 68000 file */ | |
81 | ||
82 | #define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (2<<16|OMAGIC); /* Magic byte for file header */ | |
83 | #endif /* TE_SUN3 */ | |
84 | ||
85 | #ifndef AOUT_MACHTYPE | |
86 | #define AOUT_MACHTYPE m68k_aout_machtype | |
87 | extern int m68k_aout_machtype; | |
88 | #endif | |
89 | ||
90 | #define tc_comment_chars m68k_comment_chars | |
91 | extern const char *m68k_comment_chars; | |
92 | ||
93 | #define tc_crawl_symbol_chain(a) {;} /* not used */ | |
94 | #define tc_headers_hook(a) {;} /* not used */ | |
95 | #define tc_aout_pre_write_hook(x) {;} /* not used */ | |
96 | ||
97 | #define LISTING_WORD_SIZE 2 /* A word is 2 bytes */ | |
98 | #define LISTING_LHS_WIDTH 2 /* One word on the first line */ | |
99 | #define LISTING_LHS_WIDTH_SECOND 2 /* One word on the second line */ | |
100 | #define LISTING_LHS_CONT_LINES 4/* And 4 lines max */ | |
101 | #define LISTING_HEADER "68K GAS " | |
102 | ||
103 | #ifndef REGISTER_PREFIX | |
104 | #define REGISTER_PREFIX '%' | |
105 | #endif | |
106 | ||
107 | #if !defined (REGISTER_PREFIX_OPTIONAL) | |
108 | #if defined (M68KCOFF) || defined (OBJ_ELF) | |
109 | #ifndef BFD_ASSEMBLER | |
110 | #define LOCAL_LABEL(name) (name[0] == '.' \ | |
111 | && (name[1] == 'L' || name[1] == '.')) | |
112 | #endif /* ! BFD_ASSEMBLER */ | |
113 | #define REGISTER_PREFIX_OPTIONAL 0 | |
114 | #else /* ! (COFF || ELF) */ | |
115 | #define REGISTER_PREFIX_OPTIONAL 1 | |
116 | #endif /* ! (COFF || ELF) */ | |
117 | #endif /* not def REGISTER_PREFIX and not def OPTIONAL_REGISTER_PREFIX */ | |
118 | ||
119 | #ifdef TE_DELTA | |
120 | /* On the Delta, `%' can occur within a label name, but not as the | |
121 | initial character. */ | |
122 | #define LEX_PCT LEX_NAME | |
81d4177b | 123 | /* On the Delta, `~' can start a label name, but is converted to '.'. */ |
252b5132 RH |
124 | #define LEX_TILDE LEX_BEGIN_NAME |
125 | #define tc_canonicalize_symbol_name(s) ((*(s) == '~' ? *(s) = '.' : '.'), s) | |
126 | /* On the Delta, dots are not required before pseudo-ops. */ | |
abd63a32 | 127 | #define NO_PSEUDO_DOT 1 |
252b5132 RH |
128 | #ifndef BFD_ASSEMBLER |
129 | #undef LOCAL_LABEL | |
130 | #define LOCAL_LABEL(name) \ | |
131 | (name[0] == '.' || (name[0] == 'L' && name[1] == '%')) | |
132 | #endif | |
133 | #endif | |
134 | ||
135 | extern void m68k_mri_mode_change PARAMS ((int)); | |
136 | #define MRI_MODE_CHANGE(i) m68k_mri_mode_change (i) | |
137 | ||
138 | extern int m68k_conditional_pseudoop PARAMS ((pseudo_typeS *)); | |
139 | #define tc_conditional_pseudoop(pop) m68k_conditional_pseudoop (pop) | |
140 | ||
49309057 | 141 | extern void m68k_frob_label PARAMS ((symbolS *)); |
252b5132 RH |
142 | #define tc_frob_label(sym) m68k_frob_label (sym) |
143 | ||
144 | extern void m68k_flush_pending_output PARAMS ((void)); | |
145 | #define md_flush_pending_output() m68k_flush_pending_output () | |
146 | ||
49309057 | 147 | extern void m68k_frob_symbol PARAMS ((symbolS *)); |
252b5132 RH |
148 | |
149 | #ifdef BFD_ASSEMBLER | |
150 | ||
151 | #define tc_frob_symbol(sym,punt) \ | |
152 | do \ | |
153 | { \ | |
154 | if (S_GET_SEGMENT (sym) == reg_section) \ | |
155 | punt = 1; \ | |
156 | m68k_frob_symbol (sym); \ | |
157 | } \ | |
158 | while (0) | |
159 | ||
160 | #define NO_RELOC BFD_RELOC_NONE | |
5cbdaa77 NC |
161 | #define RELAX_RELOC_ABS8 BFD_RELOC_8 |
162 | #define RELAX_RELOC_ABS16 BFD_RELOC_16 | |
163 | #define RELAX_RELOC_ABS32 BFD_RELOC_32 | |
164 | #define RELAX_RELOC_PC8 BFD_RELOC_8_PCREL | |
165 | #define RELAX_RELOC_PC16 BFD_RELOC_16_PCREL | |
166 | #define RELAX_RELOC_PC32 BFD_RELOC_32_PCREL | |
252b5132 RH |
167 | |
168 | #ifdef OBJ_ELF | |
169 | ||
170 | /* This expression evaluates to false if the relocation is for a local object | |
171 | for which we still want to do the relocation at runtime. True if we | |
172 | are willing to perform this relocation while building the .o file. If | |
173 | the reloc is against an externally visible symbol, then the assembler | |
174 | should never do the relocation. */ | |
175 | ||
176 | #define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \ | |
177 | ((FIX)->fx_addsy == NULL \ | |
178 | || (! S_IS_EXTERNAL ((FIX)->fx_addsy) \ | |
179 | && ! S_IS_WEAK ((FIX)->fx_addsy) \ | |
180 | && S_IS_DEFINED ((FIX)->fx_addsy) \ | |
181 | && ! S_IS_COMMON ((FIX)->fx_addsy))) | |
182 | ||
8f36cd18 AO |
183 | #define tc_fix_adjustable(X) tc_m68k_fix_adjustable(X) |
184 | extern int tc_m68k_fix_adjustable PARAMS ((struct fix *)); | |
185 | ||
186 | #ifdef OBJ_ELF | |
02198638 AO |
187 | /* This arranges for gas/write.c to not apply a relocation if |
188 | tc_fix_adjustable() says it is not adjustable. */ | |
8f36cd18 AO |
189 | #define TC_FIX_ADJUSTABLE(fixP) tc_fix_adjustable (fixP) |
190 | #endif | |
02198638 | 191 | |
0d96863f CM |
192 | #define elf_tc_final_processing m68k_elf_final_processing |
193 | extern void m68k_elf_final_processing PARAMS ((void)); | |
252b5132 RH |
194 | #endif |
195 | ||
196 | #define TC_FORCE_RELOCATION(FIX) \ | |
197 | ((FIX)->fx_r_type == BFD_RELOC_VTABLE_INHERIT \ | |
198 | || (FIX)->fx_r_type == BFD_RELOC_VTABLE_ENTRY) | |
199 | ||
200 | #else /* ! BFD_ASSEMBLER */ | |
201 | ||
202 | #define tc_frob_coff_symbol(sym) m68k_frob_symbol (sym) | |
203 | ||
5cbdaa77 NC |
204 | #define NO_RELOC 0 |
205 | #define RELAX_RELOC_ABS8 0 | |
206 | #define RELAX_RELOC_ABS16 0 | |
207 | #define RELAX_RELOC_ABS32 0 | |
208 | #define RELAX_RELOC_PC8 0 | |
209 | #define RELAX_RELOC_PC16 0 | |
210 | #define RELAX_RELOC_PC32 0 | |
252b5132 RH |
211 | |
212 | #endif /* ! BFD_ASSEMBLER */ | |
213 | ||
214 | #define DIFF_EXPR_OK | |
215 | ||
216 | extern void m68k_init_after_args PARAMS ((void)); | |
217 | #define tc_init_after_args m68k_init_after_args | |
218 | ||
219 | extern int m68k_parse_long_option PARAMS ((char *)); | |
220 | #define md_parse_long_option m68k_parse_long_option | |
221 | ||
222 | #define md_operand(x) | |
223 | ||
224 | #define TARGET_WORD_SIZE 32 | |
225 | #define TARGET_ARCH bfd_arch_m68k | |
226 | ||
227 | extern struct relax_type md_relax_table[]; | |
228 | #define TC_GENERIC_RELAX_TABLE md_relax_table | |
229 | ||
d7861ad2 AM |
230 | /* We can't do a byte jump to the next instruction, so in that case |
231 | force word mode by faking AIM. */ | |
252b5132 | 232 | #define md_prepare_relax_scan(fragP, address, aim, this_state, this_type) \ |
d7861ad2 AM |
233 | do \ |
234 | { \ | |
235 | if (aim == 0 && this_type->rlx_forward == 127) \ | |
236 | aim = 128; \ | |
237 | } \ | |
238 | while (0) | |
f27a3839 AS |
239 | |
240 | #define DWARF2_LINE_MIN_INSN_LENGTH 2 |