1 /* This file is tc-m68k.h
2 Copyright (C) 1987, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
3 Free Software Foundation, Inc.
5 This file is part of GAS, the GNU Assembler.
7 GAS is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GAS is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GAS; see the file COPYING. If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
24 #ifdef ANSI_PROTOTYPES
28 #define TARGET_BYTES_BIG_ENDIAN 1
32 #define TARGET_FORMAT "a.out-sunos-big"
35 #define TARGET_FORMAT "a.out-m68k-netbsd"
38 #define TARGET_FORMAT "a.out-m68k-linux"
41 #define TARGET_FORMAT "a.out-zero-big"
46 #define TARGET_FORMAT "elf32-m68k"
50 #define COFF_MAGIC APOLLOM68KMAGIC
51 #define COFF_AOUTHDR_MAGIC APOLLO_COFF_VERSION_NUMBER
52 #undef OBJ_COFF_OMIT_OPTIONAL_HEADER
56 #define TARGET_FORMAT "coff-m68k-lynx"
59 #define TARGET_FORMAT "coff-m68k-aux"
62 #define TARGET_FORMAT "coff-m68k-sysv"
66 #define COFF_MAGIC MC68MAGIC
68 #define BFD_ARCH bfd_arch_m68k /* for non-BFD_ASSEMBLER */
69 #define TARGET_ARCH bfd_arch_m68k /* BFD_ASSEMBLER */
70 #define COFF_FLAGS F_AR32W
71 #define TC_COUNT_RELOC(x) ((x)->fx_addsy||(x)->fx_subsy)
73 #define TC_COFF_FIX2RTYPE(fixP) tc_coff_fix2rtype(fixP)
74 #define TC_COFF_SIZEMACHDEP(frag) tc_coff_sizemachdep(frag)
75 extern int tc_coff_sizemachdep
PARAMS ((struct frag
*));
77 /* This variable contains the value to write out at the beginning of
78 the a.out file. The 2<<16 means that this is a 68020 file instead
79 of an old-style 68000 file */
81 #define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (2<<16|OMAGIC); /* Magic byte for file header */
85 #define AOUT_MACHTYPE m68k_aout_machtype
86 extern int m68k_aout_machtype
;
89 #define tc_comment_chars m68k_comment_chars
90 extern const char *m68k_comment_chars
;
92 #define tc_crawl_symbol_chain(a) {;} /* not used */
93 #define tc_headers_hook(a) {;} /* not used */
94 #define tc_aout_pre_write_hook(x) {;} /* not used */
96 #define LISTING_WORD_SIZE 2 /* A word is 2 bytes */
97 #define LISTING_LHS_WIDTH 2 /* One word on the first line */
98 #define LISTING_LHS_WIDTH_SECOND 2 /* One word on the second line */
99 #define LISTING_LHS_CONT_LINES 4/* And 4 lines max */
100 #define LISTING_HEADER "68K GAS "
102 #ifndef REGISTER_PREFIX
103 #define REGISTER_PREFIX '%'
106 #if !defined (REGISTER_PREFIX_OPTIONAL)
107 #if defined (M68KCOFF) || defined (OBJ_ELF)
108 #ifndef BFD_ASSEMBLER
109 #define LOCAL_LABEL(name) (name[0] == '.' \
110 && (name[1] == 'L' || name[1] == '.'))
111 #endif /* ! BFD_ASSEMBLER */
112 #define REGISTER_PREFIX_OPTIONAL 0
113 #else /* ! (COFF || ELF) */
114 #define REGISTER_PREFIX_OPTIONAL 1
115 #endif /* ! (COFF || ELF) */
116 #endif /* not def REGISTER_PREFIX and not def OPTIONAL_REGISTER_PREFIX */
119 /* On the Delta, `%' can occur within a label name, but not as the
120 initial character. */
121 #define LEX_PCT LEX_NAME
122 /* On the Delta, `~' can start a label name, but is converted to '.'. */
123 #define LEX_TILDE LEX_BEGIN_NAME
124 #define tc_canonicalize_symbol_name(s) ((*(s) == '~' ? *(s) = '.' : '.'), s)
125 /* On the Delta, dots are not required before pseudo-ops. */
126 #define NO_PSEUDO_DOT 1
127 #ifndef BFD_ASSEMBLER
129 #define LOCAL_LABEL(name) \
130 (name[0] == '.' || (name[0] == 'L' && name[1] == '%'))
134 extern void m68k_mri_mode_change
PARAMS ((int));
135 #define MRI_MODE_CHANGE(i) m68k_mri_mode_change (i)
137 extern int m68k_conditional_pseudoop
PARAMS ((pseudo_typeS
*));
138 #define tc_conditional_pseudoop(pop) m68k_conditional_pseudoop (pop)
140 extern void m68k_frob_label
PARAMS ((symbolS
*));
141 #define tc_frob_label(sym) m68k_frob_label (sym)
143 extern void m68k_flush_pending_output
PARAMS ((void));
144 #define md_flush_pending_output() m68k_flush_pending_output ()
146 extern void m68k_frob_symbol
PARAMS ((symbolS
*));
150 #define tc_frob_symbol(sym,punt) \
153 if (S_GET_SEGMENT (sym) == reg_section) \
155 m68k_frob_symbol (sym); \
159 #define NO_RELOC BFD_RELOC_NONE
163 /* This expression evaluates to false if the relocation is for a local object
164 for which we still want to do the relocation at runtime. True if we
165 are willing to perform this relocation while building the .o file. If
166 the reloc is against an externally visible symbol, then the assembler
167 should never do the relocation. */
169 #define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \
170 ((FIX)->fx_addsy == NULL \
171 || (! S_IS_EXTERNAL ((FIX)->fx_addsy) \
172 && ! S_IS_WEAK ((FIX)->fx_addsy) \
173 && S_IS_DEFINED ((FIX)->fx_addsy) \
174 && ! S_IS_COMMON ((FIX)->fx_addsy)))
176 #define tc_fix_adjustable(X) tc_m68k_fix_adjustable(X)
177 extern int tc_m68k_fix_adjustable
PARAMS ((struct fix
*));
178 #define elf_tc_final_processing m68k_elf_final_processing
179 extern void m68k_elf_final_processing
PARAMS ((void));
182 #define TC_FORCE_RELOCATION(FIX) \
183 ((FIX)->fx_r_type == BFD_RELOC_VTABLE_INHERIT \
184 || (FIX)->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
186 #else /* ! BFD_ASSEMBLER */
188 #define tc_frob_coff_symbol(sym) m68k_frob_symbol (sym)
192 #endif /* ! BFD_ASSEMBLER */
196 extern void m68k_init_after_args
PARAMS ((void));
197 #define tc_init_after_args m68k_init_after_args
199 extern int m68k_parse_long_option
PARAMS ((char *));
200 #define md_parse_long_option m68k_parse_long_option
202 #define md_operand(x)
204 #define TARGET_WORD_SIZE 32
205 #define TARGET_ARCH bfd_arch_m68k
207 extern struct relax_type md_relax_table
[];
208 #define TC_GENERIC_RELAX_TABLE md_relax_table
210 /* Copied from write.c */
211 /* This was formerly called M68K_AIM_KLUDGE. */
212 #define md_prepare_relax_scan(fragP, address, aim, this_state, this_type) \
213 if (aim==0 && this_state== 4) { /* hard encoded from tc-m68k.c */ \
214 aim=this_type->rlx_forward+1; /* Force relaxation into word mode */ \
217 /* end of tc-m68k.h */