Commit | Line | Data |
---|---|---|
3ad9ec6a ILT |
1 | /* This file is tc-m68k.h |
2 | ||
a986926b | 3 | Copyright (C) 1987, 89, 90, 91, 92, 93, 94, 95, 96, 1997 |
a043f579 | 4 | Free Software Foundation, Inc. |
e3fce8d2 | 5 | |
3ad9ec6a | 6 | This file is part of GAS, the GNU Assembler. |
e3fce8d2 | 7 | |
3ad9ec6a ILT |
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. | |
e3fce8d2 | 12 | |
3ad9ec6a ILT |
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. | |
e3fce8d2 | 17 | |
3ad9ec6a ILT |
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 | |
a043f579 | 20 | the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
3ad9ec6a | 21 | |
fecd2382 RP |
22 | #define TC_M68K 1 |
23 | ||
a043f579 ILT |
24 | #define TARGET_BYTES_BIG_ENDIAN 1 |
25 | ||
e3fce8d2 | 26 | #ifdef OBJ_AOUT |
a043f579 | 27 | #ifdef TE_SUN3 |
e3fce8d2 | 28 | #define TARGET_FORMAT "a.out-sunos-big" |
a986926b | 29 | #endif |
a043f579 ILT |
30 | #ifdef TE_NetBSD |
31 | #define TARGET_FORMAT "a.out-m68k-netbsd" | |
a043f579 | 32 | #endif |
a986926b ILT |
33 | #ifdef TE_LINUX |
34 | #define TARGET_FORMAT "a.out-m68k-linux" | |
35 | #endif | |
36 | #ifndef TARGET_FORMAT | |
37 | #define TARGET_FORMAT "a.out-zero-big" | |
a043f579 ILT |
38 | #endif |
39 | #endif | |
40 | ||
41 | #ifdef OBJ_ELF | |
42 | #define TARGET_FORMAT "elf32-m68k" | |
e3fce8d2 | 43 | #endif |
3ad9ec6a | 44 | |
326aa685 KR |
45 | #ifdef TE_APOLLO |
46 | #define COFF_MAGIC APOLLOM68KMAGIC | |
47 | #define COFF_AOUTHDR_MAGIC APOLLO_COFF_VERSION_NUMBER | |
48 | #undef OBJ_COFF_OMIT_OPTIONAL_HEADER | |
49 | #endif | |
50 | ||
dff60b7d ILT |
51 | #ifdef TE_LYNX |
52 | #define TARGET_FORMAT "coff-m68k-lynx" | |
53 | #endif | |
a043f579 ILT |
54 | #ifdef TE_AUX |
55 | #define TARGET_FORMAT "coff-m68k-aux" | |
56 | #endif | |
dff60b7d | 57 | |
326aa685 | 58 | #ifndef COFF_MAGIC |
3ad9ec6a | 59 | #define COFF_MAGIC MC68MAGIC |
326aa685 | 60 | #endif |
a043f579 ILT |
61 | #define BFD_ARCH bfd_arch_m68k /* for non-BFD_ASSEMBLER */ |
62 | #define TARGET_ARCH bfd_arch_m68k /* BFD_ASSEMBLER */ | |
3ad9ec6a | 63 | #define COFF_FLAGS F_AR32W |
e3fce8d2 | 64 | #define TC_COUNT_RELOC(x) ((x)->fx_addsy||(x)->fx_subsy) |
3ad9ec6a ILT |
65 | |
66 | #define TC_COFF_FIX2RTYPE(fixP) tc_coff_fix2rtype(fixP) | |
67 | #define TC_COFF_SIZEMACHDEP(frag) tc_coff_sizemachdep(frag) | |
a043f579 | 68 | extern int tc_coff_sizemachdep PARAMS ((struct frag *)); |
fecd2382 RP |
69 | #ifdef TE_SUN3 |
70 | /* This variable contains the value to write out at the beginning of | |
71 | the a.out file. The 2<<16 means that this is a 68020 file instead | |
72 | of an old-style 68000 file */ | |
73 | ||
74 | #define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (2<<16|OMAGIC); /* Magic byte for file header */ | |
75 | #endif /* TE_SUN3 */ | |
e3fce8d2 KR |
76 | |
77 | #ifndef AOUT_MACHTYPE | |
dff60b7d ILT |
78 | #define AOUT_MACHTYPE m68k_aout_machtype |
79 | extern int m68k_aout_machtype; | |
e3fce8d2 KR |
80 | #endif |
81 | ||
a986926b ILT |
82 | #define tc_comment_chars m68k_comment_chars |
83 | extern const char *m68k_comment_chars; | |
84 | ||
e3fce8d2 KR |
85 | #define tc_crawl_symbol_chain(a) {;} /* not used */ |
86 | #define tc_headers_hook(a) {;} /* not used */ | |
87 | #define tc_aout_pre_write_hook(x) {;} /* not used */ | |
88 | ||
89 | #define LISTING_WORD_SIZE 2 /* A word is 2 bytes */ | |
90 | #define LISTING_LHS_WIDTH 2 /* One word on the first line */ | |
91 | #define LISTING_LHS_WIDTH_SECOND 2 /* One word on the second line */ | |
92 | #define LISTING_LHS_CONT_LINES 4/* And 4 lines max */ | |
a39116f1 RP |
93 | #define LISTING_HEADER "68K GAS " |
94 | ||
326aa685 | 95 | #ifndef REGISTER_PREFIX |
e3fce8d2 | 96 | #define REGISTER_PREFIX '%' |
326aa685 KR |
97 | #endif |
98 | ||
99 | #if !defined (REGISTER_PREFIX_OPTIONAL) | |
a043f579 | 100 | #if defined (M68KCOFF) || defined (OBJ_ELF) |
326aa685 KR |
101 | #define LOCAL_LABEL(name) (name[0] == '.' \ |
102 | && (name[1] == 'L' || name[1] == '.')) | |
103 | #define FAKE_LABEL_NAME ".L0\001" | |
104 | #define REGISTER_PREFIX_OPTIONAL 0 | |
e3fce8d2 | 105 | #else |
326aa685 KR |
106 | #define REGISTER_PREFIX_OPTIONAL 1 |
107 | #endif | |
108 | #endif /* not def REGISTER_PREFIX and not def OPTIONAL_REGISTER_PREFIX */ | |
109 | ||
110 | #ifdef TE_DELTA | |
111 | /* On the Delta, `%' can occur within a label name. I'm assuming it | |
112 | can't be used as the initial character. If that's not true, more | |
113 | work will be needed to fix this up. */ | |
114 | #define LEX_PCT 1 | |
a043f579 ILT |
115 | /* On the Delta, dots are not required before pseudo-ops. */ |
116 | #define NO_PSEUDO_DOT | |
e3fce8d2 KR |
117 | #endif |
118 | ||
20710f1c ILT |
119 | extern void m68k_mri_mode_change PARAMS ((int)); |
120 | #define MRI_MODE_CHANGE(i) m68k_mri_mode_change (i) | |
121 | ||
a986926b ILT |
122 | extern int m68k_conditional_pseudoop PARAMS ((pseudo_typeS *)); |
123 | #define tc_conditional_pseudoop(pop) m68k_conditional_pseudoop (pop) | |
124 | ||
e3fce8d2 | 125 | #ifdef BFD_ASSEMBLER |
a043f579 | 126 | |
9f94df38 ILT |
127 | #define tc_frob_symbol(sym,punt) \ |
128 | do \ | |
129 | { \ | |
130 | if (S_GET_SEGMENT (sym) == reg_section) \ | |
131 | punt = 1; \ | |
132 | if (S_GET_SEGMENT (sym) == text_section \ | |
133 | && (S_GET_VALUE (sym) & 1) != 0) \ | |
134 | as_warn ("text label `%s' aligned to odd boundary", \ | |
135 | S_GET_NAME (sym)); \ | |
136 | } \ | |
137 | while (0) | |
a043f579 ILT |
138 | |
139 | #define NO_RELOC BFD_RELOC_NONE | |
140 | ||
141 | #ifdef OBJ_ELF | |
142 | ||
143 | /* This expression evaluates to false if the relocation is for a local object | |
144 | for which we still want to do the relocation at runtime. True if we | |
145 | are willing to perform this relocation while building the .o file. */ | |
146 | ||
147 | #define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \ | |
148 | ((FIX)->fx_r_type != BFD_RELOC_8_PLT_PCREL \ | |
149 | && (FIX)->fx_r_type != BFD_RELOC_16_PLT_PCREL \ | |
150 | && (FIX)->fx_r_type != BFD_RELOC_32_PLT_PCREL \ | |
151 | && (FIX)->fx_r_type != BFD_RELOC_8_GOT_PCREL \ | |
152 | && (FIX)->fx_r_type != BFD_RELOC_16_GOT_PCREL \ | |
153 | && (FIX)->fx_r_type != BFD_RELOC_32_GOT_PCREL) | |
154 | ||
155 | #define tc_fix_adjustable(X) tc_m68k_fix_adjustable(X) | |
156 | #endif | |
157 | ||
9f94df38 ILT |
158 | #else /* ! BFD_ASSEMBLER */ |
159 | ||
160 | #define tc_frob_coff_symbol(sym) \ | |
161 | do \ | |
162 | { \ | |
163 | if (S_GET_SEGMENT (sym) == text_section \ | |
164 | && (S_GET_VALUE (sym) & 1) != 0) \ | |
165 | as_warn ("text label `%s' aligned to odd boundary", \ | |
166 | S_GET_NAME (sym)); \ | |
167 | } \ | |
168 | while (0) | |
169 | ||
a043f579 | 170 | #define NO_RELOC 0 |
9f94df38 ILT |
171 | |
172 | #endif /* ! BFD_ASSEMBLER */ | |
e3fce8d2 KR |
173 | |
174 | #define DIFF_EXPR_OK | |
fecd2382 | 175 | |
326aa685 KR |
176 | extern void m68k_init_after_args PARAMS ((void)); |
177 | #define tc_init_after_args m68k_init_after_args | |
178 | ||
179 | extern int m68k_parse_long_option PARAMS ((char *)); | |
180 | #define md_parse_long_option m68k_parse_long_option | |
181 | ||
a043f579 ILT |
182 | #define md_operand(x) |
183 | ||
184 | #define TARGET_WORD_SIZE 32 | |
185 | #define TARGET_ARCH bfd_arch_m68k | |
186 | ||
187 | extern struct relax_type md_relax_table[]; | |
188 | #define TC_GENERIC_RELAX_TABLE md_relax_table | |
189 | ||
a986926b ILT |
190 | /* Copied from write.c */ |
191 | /* This was formerly called M68K_AIM_KLUDGE. */ | |
192 | #define md_prepare_relax_scan(fragP, address, aim, this_state, this_type) \ | |
193 | if (aim==0 && this_state== 4) { /* hard encoded from tc-m68k.c */ \ | |
194 | aim=this_type->rlx_forward+1; /* Force relaxation into word mode */ \ | |
195 | } | |
196 | ||
fecd2382 | 197 | /* end of tc-m68k.h */ |