0
|
1 /* Definitions for Motorola 68k running Linux-based GNU systems with
|
|
2 ELF format.
|
|
3 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2006,
|
|
4 2007 Free Software Foundation, Inc.
|
|
5
|
|
6 This file is part of GCC.
|
|
7
|
|
8 GCC 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 3, or (at your option)
|
|
11 any later version.
|
|
12
|
|
13 GCC 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 GCC; see the file COPYING3. If not see
|
|
20 <http://www.gnu.org/licenses/>. */
|
|
21
|
|
22 #undef TARGET_VERSION
|
|
23 #define TARGET_VERSION fprintf (stderr, " (68k GNU/Linux with ELF)");
|
|
24
|
|
25 /* Add %(asm_cpu_spec) to the svr4.h definition of ASM_SPEC. */
|
|
26 #undef ASM_SPEC
|
|
27 #define ASM_SPEC "%(asm_cpu_spec) %(asm_pcrel_spec) \
|
|
28 %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*}"
|
|
29
|
|
30 #undef PREFERRED_STACK_BOUNDARY
|
|
31 #define PREFERRED_STACK_BOUNDARY 32
|
|
32
|
|
33 /* for 68k machines this only needs to be TRUE for the 68000 */
|
|
34
|
|
35 #undef STRICT_ALIGNMENT
|
|
36 #define STRICT_ALIGNMENT 0
|
|
37 #undef M68K_HONOR_TARGET_STRICT_ALIGNMENT
|
|
38 #define M68K_HONOR_TARGET_STRICT_ALIGNMENT 0
|
|
39
|
|
40 /* Here are four prefixes that are used by asm_fprintf to
|
|
41 facilitate customization for alternate assembler syntaxes.
|
|
42 Machines with no likelihood of an alternate syntax need not
|
|
43 define these and need not use asm_fprintf. */
|
|
44
|
|
45 /* The prefix for register names. Note that REGISTER_NAMES
|
|
46 is supposed to include this prefix. Also note that this is NOT an
|
|
47 fprintf format string, it is a literal string */
|
|
48
|
|
49 #undef REGISTER_PREFIX
|
|
50 #define REGISTER_PREFIX "%"
|
|
51
|
|
52 /* The prefix for local (compiler generated) labels.
|
|
53 These labels will not appear in the symbol table. */
|
|
54
|
|
55 #undef LOCAL_LABEL_PREFIX
|
|
56 #define LOCAL_LABEL_PREFIX "."
|
|
57
|
|
58 /* The prefix to add to user-visible assembler symbols. */
|
|
59
|
|
60 #undef USER_LABEL_PREFIX
|
|
61 #define USER_LABEL_PREFIX ""
|
|
62
|
|
63 #define ASM_COMMENT_START "|"
|
|
64
|
|
65 /* Target OS builtins. */
|
|
66 #define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
|
|
67
|
|
68 #undef CPP_SPEC
|
|
69 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
|
|
70
|
|
71 /* Provide a LINK_SPEC appropriate for GNU/Linux. Here we provide support
|
|
72 for the special GCC options -static and -shared, which allow us to
|
|
73 link things in one of these three modes by applying the appropriate
|
|
74 combinations of options at link-time. We like to support here for
|
|
75 as many of the other GNU linker options as possible. But I don't
|
|
76 have the time to search for those flags. I am sure how to add
|
|
77 support for -soname shared_object_name. H.J.
|
|
78
|
|
79 I took out %{v:%{!V:-V}}. It is too much :-(. They can use
|
|
80 -Wl,-V.
|
|
81
|
|
82 When the -shared link option is used a final link is not being
|
|
83 done. */
|
|
84
|
|
85 /* If ELF is the default format, we should not use /lib/elf. */
|
|
86
|
|
87 #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
|
|
88
|
|
89 #undef LINK_SPEC
|
|
90 #define LINK_SPEC "-m m68kelf %{shared} \
|
|
91 %{!shared: \
|
|
92 %{!static: \
|
|
93 %{rdynamic:-export-dynamic} \
|
|
94 %{!dynamic-linker*:-dynamic-linker " LINUX_DYNAMIC_LINKER "}} \
|
|
95 %{static}}"
|
|
96
|
|
97 /* For compatibility with linux/a.out */
|
|
98
|
|
99 #undef PCC_BITFIELD_TYPE_MATTERS
|
|
100
|
|
101 /* Currently, JUMP_TABLES_IN_TEXT_SECTION must be defined in order to
|
|
102 keep switch tables in the text section. */
|
|
103
|
|
104 #define JUMP_TABLES_IN_TEXT_SECTION 1
|
|
105
|
|
106 /* Use the default action for outputting the case label. */
|
|
107 #undef ASM_OUTPUT_CASE_LABEL
|
|
108 #define ASM_RETURN_CASE_JUMP \
|
|
109 do { \
|
|
110 if (TARGET_COLDFIRE) \
|
|
111 { \
|
|
112 if (ADDRESS_REG_P (operands[0])) \
|
|
113 return "jmp %%pc@(2,%0:l)"; \
|
|
114 else \
|
|
115 return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \
|
|
116 } \
|
|
117 else \
|
|
118 return "jmp %%pc@(2,%0:w)"; \
|
|
119 } while (0)
|
|
120
|
|
121 /* This is how to output an assembler line that says to advance the
|
|
122 location counter to a multiple of 2**LOG bytes. */
|
|
123
|
|
124 #undef ASM_OUTPUT_ALIGN
|
|
125 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
|
|
126 if ((LOG) > 0) \
|
|
127 fprintf ((FILE), "%s%u\n", ALIGN_ASM_OP, 1 << (LOG));
|
|
128
|
|
129 #ifdef HAVE_GAS_BALIGN_AND_P2ALIGN
|
|
130 /* Use "move.l %a4,%a4" to advance within code. */
|
|
131 #define ASM_OUTPUT_ALIGN_WITH_NOP(FILE,LOG) \
|
|
132 if ((LOG) > 0) \
|
|
133 fprintf ((FILE), "\t.balignw %u,0x284c\n", 1 << (LOG));
|
|
134 #endif
|
|
135
|
|
136 /* If defined, a C expression whose value is a string containing the
|
|
137 assembler operation to identify the following data as uninitialized global
|
|
138 data. */
|
|
139
|
|
140 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
|
|
141
|
|
142 /* A C statement (sans semicolon) to output to the stdio stream
|
|
143 FILE the assembler definition of uninitialized global DECL named
|
|
144 NAME whose size is SIZE bytes and alignment is ALIGN bytes.
|
|
145 Try to use asm_output_aligned_bss to implement this macro. */
|
|
146
|
|
147 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
|
|
148 asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
|
|
149
|
|
150 /* Output assembler code to FILE to increment profiler label # LABELNO
|
|
151 for profiling a function entry. */
|
|
152
|
|
153 #undef FUNCTION_PROFILER
|
|
154 #define FUNCTION_PROFILER(FILE, LABELNO) \
|
|
155 { \
|
|
156 asm_fprintf (FILE, "\tlea (%LLP%d,%Rpc),%Ra1\n", (LABELNO)); \
|
|
157 if (flag_pic) \
|
|
158 fprintf (FILE, "\tbsr.l _mcount@PLTPC\n"); \
|
|
159 else \
|
|
160 fprintf (FILE, "\tjbsr _mcount\n"); \
|
|
161 }
|
|
162
|
|
163 /* Do not break .stabs pseudos into continuations. */
|
|
164
|
|
165 #define DBX_CONTIN_LENGTH 0
|
|
166
|
|
167 /* 1 if N is a possible register number for a function value. For
|
|
168 m68k/SVR4 allow d0, a0, or fp0 as return registers, for integral,
|
|
169 pointer, or floating types, respectively. Reject fp0 if not using
|
|
170 a 68881 coprocessor. */
|
|
171
|
|
172 #undef FUNCTION_VALUE_REGNO_P
|
|
173 #define FUNCTION_VALUE_REGNO_P(N) \
|
|
174 ((N) == D0_REG || (N) == A0_REG || (TARGET_68881 && (N) == FP0_REG))
|
|
175
|
|
176 /* Define this to be true when FUNCTION_VALUE_REGNO_P is true for
|
|
177 more than one register. */
|
|
178
|
|
179 #undef NEEDS_UNTYPED_CALL
|
|
180 #define NEEDS_UNTYPED_CALL 1
|
|
181
|
|
182 /* Define how to generate (in the callee) the output value of a
|
|
183 function and how to find (in the caller) the value returned by a
|
|
184 function. VALTYPE is the data type of the value (as a tree). If
|
|
185 the precise function being called is known, FUNC is its
|
|
186 FUNCTION_DECL; otherwise, FUNC is 0. For m68k/SVR4 generate the
|
|
187 result in d0, a0, or fp0 as appropriate. */
|
|
188
|
|
189 #undef FUNCTION_VALUE
|
|
190 #define FUNCTION_VALUE(VALTYPE, FUNC) \
|
|
191 m68k_function_value (VALTYPE, FUNC)
|
|
192
|
|
193 /* Define how to find the value returned by a library function
|
|
194 assuming the value has mode MODE.
|
|
195 For m68k/SVR4 look for integer values in d0, pointer values in d0
|
|
196 (returned in both d0 and a0), and floating values in fp0. */
|
|
197
|
|
198 #undef LIBCALL_VALUE
|
|
199 #define LIBCALL_VALUE(MODE) \
|
|
200 m68k_libcall_value (MODE)
|
|
201
|
|
202 /* For m68k SVR4, structures are returned using the reentrant
|
|
203 technique. */
|
|
204 #undef PCC_STATIC_STRUCT_RETURN
|
|
205 #define DEFAULT_PCC_STRUCT_RETURN 0
|
|
206
|
|
207 /* Finalize the trampoline by flushing the insn cache. */
|
|
208
|
|
209 #undef FINALIZE_TRAMPOLINE
|
|
210 #define FINALIZE_TRAMPOLINE(TRAMP) \
|
|
211 emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \
|
|
212 0, VOIDmode, 2, TRAMP, Pmode, \
|
|
213 plus_constant (TRAMP, TRAMPOLINE_SIZE), Pmode);
|
|
214
|
|
215 /* Clear the instruction cache from `beg' to `end'. This makes an
|
|
216 inline system call to SYS_cacheflush. The arguments are as
|
|
217 follows:
|
|
218
|
|
219 cacheflush (addr, scope, cache, len)
|
|
220
|
|
221 addr - the start address for the flush
|
|
222 scope - the scope of the flush (see the cpush insn)
|
|
223 cache - which cache to flush (see the cpush insn)
|
|
224 len - a factor relating to the number of flushes to perform:
|
|
225 len/16 lines, or len/4096 pages. */
|
|
226
|
|
227 #define CLEAR_INSN_CACHE(BEG, END) \
|
|
228 { \
|
|
229 register unsigned long _beg __asm ("%d1") = (unsigned long) (BEG); \
|
|
230 unsigned long _end = (unsigned long) (END); \
|
|
231 register unsigned long _len __asm ("%d4") = (_end - _beg + 32); \
|
|
232 __asm __volatile \
|
|
233 ("move%.l #123, %/d0\n\t" /* system call nr */ \
|
|
234 "move%.l #1, %/d2\n\t" /* clear lines */ \
|
|
235 "move%.l #3, %/d3\n\t" /* insn+data caches */ \
|
|
236 "trap #0" \
|
|
237 : /* no outputs */ \
|
|
238 : "d" (_beg), "d" (_len) \
|
|
239 : "%d0", "%d2", "%d3"); \
|
|
240 }
|
|
241
|
|
242 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
|
|
243
|
|
244 #define MD_UNWIND_SUPPORT "config/m68k/linux-unwind.h"
|