]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/arm/aout.h
re PR fortran/30940 (Fortran 2003: Scalar CHARACTER supplied to array dummy)
[thirdparty/gcc.git] / gcc / config / arm / aout.h
CommitLineData
9fb7806b 1/* Definitions of target machine for GNU compiler, for ARM with a.out
5b3e6663 2 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2004, 2007
2398fb2a 3 Free Software Foundation, Inc.
ae3e1bb4 4 Contributed by Richard Earnshaw (rearnsha@armltd.co.uk).
9fb7806b 5
4f448245 6 This file is part of GCC.
9fb7806b 7
4f448245
NC
8 GCC is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published
10 by the Free Software Foundation; either version 2, or (at your
11 option) any later version.
9fb7806b 12
4f448245
NC
13 GCC is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 License for more details.
9fb7806b 17
4f448245
NC
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING. If not, write to
39d14dda
KC
20 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
9fb7806b 22
d5b7b3ae
RE
23#ifndef ASM_APP_ON
24#define ASM_APP_ON ""
25#endif
26#ifndef ASM_APP_OFF
27#define ASM_APP_OFF ""
28#endif
9fb7806b
RE
29
30/* Switch to the text or data segment. */
93de6f51
HPN
31#define TEXT_SECTION_ASM_OP "\t.text"
32#define DATA_SECTION_ASM_OP "\t.data"
33#define BSS_SECTION_ASM_OP "\t.bss"
b355a481
NC
34
35/* Note: If USER_LABEL_PREFIX or LOCAL_LABEL_PREFIX are changed,
36 make sure that this change is reflected in the function
4f448245 37 coff_arm_is_local_label_name() in bfd/coff-arm.c. */
b355a481
NC
38#ifndef REGISTER_PREFIX
39#define REGISTER_PREFIX ""
40#endif
41
42#ifndef USER_LABEL_PREFIX
43#define USER_LABEL_PREFIX "_"
44#endif
45
46#ifndef LOCAL_LABEL_PREFIX
47#define LOCAL_LABEL_PREFIX ""
48#endif
9fb7806b 49
9fb7806b
RE
50/* The assembler's names for the registers. */
51#ifndef REGISTER_NAMES
9b66ebb1 52#define REGISTER_NAMES \
9fb7806b
RE
53{ \
54 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
55 "r8", "r9", "sl", "fp", "ip", "sp", "lr", "pc", \
56 "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
9b6b54e2 57 "cc", "sfp", "afp", \
5a9335ef
NC
58 "mv0", "mv1", "mv2", "mv3", \
59 "mv4", "mv5", "mv6", "mv7", \
60 "mv8", "mv9", "mv10", "mv11", \
61 "mv12", "mv13", "mv14", "mv15", \
62 "wcgr0", "wcgr1", "wcgr2", "wcgr3", \
63 "wr0", "wr1", "wr2", "wr3", \
64 "wr4", "wr5", "wr6", "wr7", \
65 "wr8", "wr9", "wr10", "wr11", \
9b66ebb1
PB
66 "wr12", "wr13", "wr14", "wr15", \
67 "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \
68 "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15", \
69 "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23", \
70 "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31", \
71 "vfpcc" \
9fb7806b
RE
72}
73#endif
74
75#ifndef ADDITIONAL_REGISTER_NAMES
76#define ADDITIONAL_REGISTER_NAMES \
77{ \
78 {"a1", 0}, \
79 {"a2", 1}, \
80 {"a3", 2}, \
81 {"a4", 3}, \
82 {"v1", 4}, \
83 {"v2", 5}, \
84 {"v3", 6}, \
85 {"v4", 7}, \
86 {"v5", 8}, \
87 {"v6", 9}, \
88 {"rfp", 9}, /* Gcc used to call it this */ \
89 {"sb", 9}, \
90 {"v7", 10}, \
91 {"r10", 10}, /* sl */ \
92 {"r11", 11}, /* fp */ \
93 {"r12", 12}, /* ip */ \
94 {"r13", 13}, /* sp */ \
95 {"r14", 14}, /* lr */ \
9b6b54e2
NC
96 {"r15", 15}, /* pc */ \
97 {"mvf0", 27}, \
98 {"mvf1", 28}, \
99 {"mvf2", 29}, \
100 {"mvf3", 30}, \
101 {"mvf4", 31}, \
102 {"mvf5", 32}, \
103 {"mvf6", 33}, \
104 {"mvf7", 34}, \
105 {"mvf8", 35}, \
106 {"mvf9", 36}, \
107 {"mvf10", 37}, \
108 {"mvf11", 38}, \
109 {"mvf12", 39}, \
110 {"mvf13", 40}, \
111 {"mvf14", 41}, \
112 {"mvf15", 42}, \
113 {"mvd0", 27}, \
114 {"mvd1", 28}, \
115 {"mvd2", 29}, \
116 {"mvd3", 30}, \
117 {"mvd4", 31}, \
118 {"mvd5", 32}, \
119 {"mvd6", 33}, \
120 {"mvd7", 34}, \
121 {"mvd8", 35}, \
122 {"mvd9", 36}, \
123 {"mvd10", 37}, \
124 {"mvd11", 38}, \
125 {"mvd12", 39}, \
126 {"mvd13", 40}, \
127 {"mvd14", 41}, \
128 {"mvd15", 42}, \
129 {"mvfx0", 27}, \
130 {"mvfx1", 28}, \
131 {"mvfx2", 29}, \
132 {"mvfx3", 30}, \
133 {"mvfx4", 31}, \
134 {"mvfx5", 32}, \
135 {"mvfx6", 33}, \
136 {"mvfx7", 34}, \
137 {"mvfx8", 35}, \
138 {"mvfx9", 36}, \
139 {"mvfx10", 37}, \
140 {"mvfx11", 38}, \
141 {"mvfx12", 39}, \
142 {"mvfx13", 40}, \
143 {"mvfx14", 41}, \
144 {"mvfx15", 42}, \
145 {"mvdx0", 27}, \
146 {"mvdx1", 28}, \
147 {"mvdx2", 29}, \
148 {"mvdx3", 30}, \
149 {"mvdx4", 31}, \
150 {"mvdx5", 32}, \
151 {"mvdx6", 33}, \
152 {"mvdx7", 34}, \
153 {"mvdx8", 35}, \
154 {"mvdx9", 36}, \
155 {"mvdx10", 37}, \
156 {"mvdx11", 38}, \
157 {"mvdx12", 39}, \
158 {"mvdx13", 40}, \
159 {"mvdx14", 41}, \
9b66ebb1
PB
160 {"mvdx15", 42}, \
161 {"d0", 63}, \
162 {"d1", 65}, \
163 {"d2", 67}, \
164 {"d3", 69}, \
165 {"d4", 71}, \
166 {"d5", 73}, \
167 {"d6", 75}, \
168 {"d7", 77}, \
169 {"d8", 79}, \
170 {"d9", 81}, \
171 {"d10", 83}, \
172 {"d11", 85}, \
173 {"d12", 87}, \
174 {"d13", 89}, \
175 {"d14", 91}, \
176 {"d15", 93}, \
9fb7806b
RE
177}
178#endif
179
4f448245 180/* Arm Assembler barfs on dollars. */
9fb7806b
RE
181#define DOLLARS_IN_IDENTIFIERS 0
182
be393ecf 183#ifndef NO_DOLLAR_IN_LABEL
6cfc7210 184#define NO_DOLLAR_IN_LABEL 1
be393ecf 185#endif
9fb7806b 186
9fb7806b 187/* Generate DBX debugging information. riscix.h will undefine this because
4f448245 188 the native assembler does not support stabs. */
23532de9 189#define DBX_DEBUGGING_INFO 1
9fb7806b
RE
190
191/* Acorn dbx moans about continuation chars, so don't use any. */
192#ifndef DBX_CONTIN_LENGTH
193#define DBX_CONTIN_LENGTH 0
194#endif
195
9fb7806b 196/* Output a function label definition. */
b355a481 197#ifndef ASM_DECLARE_FUNCTION_NAME
6cfc7210
NC
198#define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \
199 do \
200 { \
201 ARM_DECLARE_FUNCTION_NAME (STREAM, NAME, DECL); \
202 ASM_OUTPUT_LABEL (STREAM, NAME); \
203 } \
204 while (0)
b355a481 205#endif
9fb7806b 206
506a61b1
KG
207/* Globalizing directive for a label. */
208#define GLOBAL_ASM_OP "\t.global\t"
9fb7806b 209
9fb7806b 210/* Make an internal label into a string. */
b355a481 211#ifndef ASM_GENERATE_INTERNAL_LABEL
9fb7806b 212#define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
aec3cfba 213 sprintf (STRING, "*%s%s%u", LOCAL_LABEL_PREFIX, PREFIX, (unsigned int)(NUM))
b355a481
NC
214#endif
215
9fb7806b 216/* Output an element of a dispatch table. */
5b3e6663
PB
217#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
218 do \
219 { \
220 gcc_assert (!TARGET_THUMB2); \
221 asm_fprintf (STREAM, "\t.word\t%LL%d\n", VALUE); \
222 } \
223 while (0)
224
9fb7806b 225
5b3e6663
PB
226/* Thumb-2 always uses addr_diff_elf so that the Table Branch instructions
227 can be used. For non-pic code where the offsets do not suitable for
228 TBB/TBH the elements are output as absolute labels. */
657d9449
RE
229#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
230 do \
231 { \
232 if (TARGET_ARM) \
233 asm_fprintf (STREAM, "\tb\t%LL%d\n", VALUE); \
5b3e6663 234 else if (TARGET_THUMB1) \
657d9449 235 asm_fprintf (STREAM, "\t.word\t%LL%d-%LL%d\n", VALUE, REL); \
5b3e6663
PB
236 else /* Thumb-2 */ \
237 { \
238 switch (GET_MODE(body)) \
239 { \
240 case QImode: /* TBB */ \
241 asm_fprintf (STREAM, "\t.byte\t(%LL%d-%LL%d)/2\n", \
242 VALUE, REL); \
243 break; \
244 case HImode: /* TBH */ \
245 asm_fprintf (STREAM, "\t.2byte\t(%LL%d-%LL%d)/2\n", \
246 VALUE, REL); \
247 break; \
248 case SImode: \
249 if (flag_pic) \
250 asm_fprintf (STREAM, "\t.word\t%LL%d+1-%LL%d\n", VALUE, REL); \
251 else \
252 asm_fprintf (STREAM, "\t.word\t%LL%d+1\n", VALUE); \
253 break; \
254 default: \
255 gcc_unreachable(); \
256 } \
257 } \
657d9449
RE
258 } \
259 while (0)
260
9fb7806b 261
be393ecf 262#undef ASM_OUTPUT_ASCII
9fb7806b 263#define ASM_OUTPUT_ASCII(STREAM, PTR, LEN) \
5a9335ef 264 output_ascii_pseudo_op (STREAM, (const unsigned char *) (PTR), LEN)
9fb7806b
RE
265
266/* Output a gap. In fact we fill it with nulls. */
be393ecf 267#undef ASM_OUTPUT_SKIP
b355a481 268#define ASM_OUTPUT_SKIP(STREAM, NBYTES) \
5a9335ef 269 fprintf (STREAM, "\t.space\t%d\n", (int) (NBYTES))
9fb7806b
RE
270
271/* Align output to a power of two. Horrible /bin/as. */
00275db1 272#ifndef ASM_OUTPUT_ALIGN
6cfc7210
NC
273#define ASM_OUTPUT_ALIGN(STREAM, POWER) \
274 do \
275 { \
276 register int amount = 1 << (POWER); \
277 \
278 if (amount == 2) \
279 fprintf (STREAM, "\t.even\n"); \
280 else if (amount != 1) \
281 fprintf (STREAM, "\t.align\t%d\n", amount - 4); \
282 } \
00275db1
PB
283 while (0)
284#endif
9fb7806b 285
4f448245 286/* Output a common block. */
b355a481 287#ifndef ASM_OUTPUT_COMMON
6cfc7210
NC
288#define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \
289 do \
290 { \
291 fprintf (STREAM, "\t.comm\t"); \
292 assemble_name (STREAM, NAME); \
d5b7b3ae 293 asm_fprintf (STREAM, ", %d\t%@ %d\n", \
58e15542 294 (int)(ROUNDED), (int)(SIZE)); \
6cfc7210
NC
295 } \
296 while (0)
b355a481
NC
297#endif
298
33f7f353 299/* Output a local common block. /bin/as can't do this, so hack a
b355a481
NC
300 `.space' into the bss segment. Note that this is *bad* practice,
301 which is guaranteed NOT to work since it doesn't define STATIC
302 COMMON space but merely STATIC BSS space. */
303#ifndef ASM_OUTPUT_ALIGNED_LOCAL
6cfc7210
NC
304#define ASM_OUTPUT_ALIGNED_LOCAL(STREAM, NAME, SIZE, ALIGN) \
305 do \
306 { \
d6b5193b 307 switch_to_section (bss_section); \
6cfc7210
NC
308 ASM_OUTPUT_ALIGN (STREAM, floor_log2 (ALIGN / BITS_PER_UNIT)); \
309 ASM_OUTPUT_LABEL (STREAM, NAME); \
58e15542 310 fprintf (STREAM, "\t.space\t%d\n", (int)(SIZE)); \
6cfc7210
NC
311 } \
312 while (0)
b355a481
NC
313#endif
314
c9d9bc85 315/* Output a zero-initialized block. */
b355a481 316#ifndef ASM_OUTPUT_ALIGNED_BSS
6cfc7210 317#define ASM_OUTPUT_ALIGNED_BSS(STREAM, DECL, NAME, SIZE, ALIGN) \
b355a481
NC
318 asm_output_aligned_bss (STREAM, DECL, NAME, SIZE, ALIGN)
319#endif
9fb7806b
RE
320
321/* Output a #ident directive. */
b355a481 322#ifndef ASM_OUTPUT_IDENT
9fb7806b 323#define ASM_OUTPUT_IDENT(STREAM,STRING) \
d5b7b3ae 324 asm_fprintf (STREAM, "%@ - - - ident %s\n", STRING)
b355a481
NC
325#endif
326
9fb7806b 327#ifndef ASM_COMMENT_START
b355a481 328#define ASM_COMMENT_START "@"
9fb7806b
RE
329#endif
330
ce29b9d0 331/* This works for GAS and some other assemblers. */
93de6f51 332#define SET_ASM_OP "\t.set\t"