]>
Commit | Line | Data |
---|---|---|
eff01bb6 | 1 | /* Definitions of various defaults for tm.h macros. |
ea4f1fce | 2 | Copyright (C) 1992, 1996, 1997, 1998, 1999, 2000, 2001 |
d8ea8f28 | 3 | Free Software Foundation, Inc. |
b33c316c | 4 | Contributed by Ron Guilmette (rfg@monkeys.com) |
c53a8ab6 | 5 | |
1322177d | 6 | This file is part of GCC. |
c53a8ab6 | 7 | |
1322177d LB |
8 | GCC is free software; you can redistribute it and/or modify it under |
9 | the terms of the GNU General Public License as published by the Free | |
10 | Software Foundation; either version 2, or (at your option) any later | |
11 | version. | |
c53a8ab6 | 12 | |
1322177d LB |
13 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
14 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 | for more details. | |
c53a8ab6 RS |
17 | |
18 | You should have received a copy of the GNU General Public License | |
1322177d LB |
19 | along with GCC; see the file COPYING. If not, write to the Free |
20 | Software Foundation, 59 Temple Place - Suite 330, Boston, MA | |
21 | 02111-1307, USA. */ | |
c53a8ab6 | 22 | |
d8ea8f28 ZW |
23 | #ifndef GCC_DEFAULTS_H |
24 | #define GCC_DEFAULTS_H | |
25 | ||
b2b263e1 NB |
26 | /* Define default standard character escape sequences. */ |
27 | #ifndef TARGET_BELL | |
28 | # define TARGET_BELL 007 | |
29 | # define TARGET_BS 010 | |
30 | # define TARGET_TAB 011 | |
31 | # define TARGET_NEWLINE 012 | |
32 | # define TARGET_VT 013 | |
33 | # define TARGET_FF 014 | |
34 | # define TARGET_CR 015 | |
501990bb | 35 | # define TARGET_ESC 033 |
b2b263e1 NB |
36 | #endif |
37 | ||
7b73db04 CH |
38 | /* Store in OUTPUT a string (made with alloca) containing |
39 | an assembler-name for a local static variable or function named NAME. | |
40 | LABELNO is an integer which is different for each call. */ | |
41 | ||
42 | #ifndef ASM_FORMAT_PRIVATE_NAME | |
43 | #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \ | |
44 | do { \ | |
45 | int len = strlen (NAME); \ | |
46 | char *temp = (char *) alloca (len + 3); \ | |
47 | temp[0] = 'L'; \ | |
48 | strcpy (&temp[1], (NAME)); \ | |
49 | temp[len + 1] = '.'; \ | |
50 | temp[len + 2] = 0; \ | |
51 | (OUTPUT) = (char *) alloca (strlen (NAME) + 11); \ | |
52 | ASM_GENERATE_INTERNAL_LABEL (OUTPUT, temp, LABELNO); \ | |
53 | } while (0) | |
54 | #endif | |
55 | ||
56 | #ifndef ASM_STABD_OP | |
0a3e1f45 | 57 | #define ASM_STABD_OP "\t.stabd\t" |
7b73db04 CH |
58 | #endif |
59 | ||
60 | /* This is how to output an element of a case-vector that is absolute. | |
61 | Some targets don't use this, but we have to define it anyway. */ | |
62 | ||
63 | #ifndef ASM_OUTPUT_ADDR_VEC_ELT | |
64 | #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ | |
65 | do { fprintf (FILE, "\t%s\t", ASM_LONG); \ | |
66 | ASM_OUTPUT_INTERNAL_LABEL (FILE, "L", (VALUE)); \ | |
67 | fputc ('\n', FILE); \ | |
68 | } while (0) | |
69 | #endif | |
70 | ||
8cd0faaf CM |
71 | /* Provide default for ASM_OUTPUT_ALTERNATE_LABEL_NAME. */ |
72 | #ifndef ASM_OUTPUT_ALTERNATE_LABEL_NAME | |
73 | #define ASM_OUTPUT_ALTERNATE_LABEL_NAME(FILE,INSN) \ | |
a991240f | 74 | do { ASM_OUTPUT_LABEL(FILE,LABEL_ALTERNATE_NAME (INSN)); } while (0) |
8cd0faaf CM |
75 | #endif |
76 | ||
c53a8ab6 RS |
77 | /* choose a reasonable default for ASM_OUTPUT_ASCII. */ |
78 | ||
79 | #ifndef ASM_OUTPUT_ASCII | |
80 | #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \ | |
81 | do { \ | |
82 | FILE *_hide_asm_out_file = (MYFILE); \ | |
47ee9bcb | 83 | const unsigned char *_hide_p = (const unsigned char *) (MYSTRING); \ |
c53a8ab6 RS |
84 | int _hide_thissize = (MYLENGTH); \ |
85 | { \ | |
86 | FILE *asm_out_file = _hide_asm_out_file; \ | |
47ee9bcb | 87 | const unsigned char *p = _hide_p; \ |
c53a8ab6 RS |
88 | int thissize = _hide_thissize; \ |
89 | int i; \ | |
90 | fprintf (asm_out_file, "\t.ascii \""); \ | |
91 | \ | |
92 | for (i = 0; i < thissize; i++) \ | |
93 | { \ | |
b3694847 | 94 | int c = p[i]; \ |
c53a8ab6 RS |
95 | if (c == '\"' || c == '\\') \ |
96 | putc ('\\', asm_out_file); \ | |
5f6d3823 | 97 | if (ISPRINT(c)) \ |
c53a8ab6 RS |
98 | putc (c, asm_out_file); \ |
99 | else \ | |
100 | { \ | |
101 | fprintf (asm_out_file, "\\%o", c); \ | |
102 | /* After an octal-escape, if a digit follows, \ | |
103 | terminate one string constant and start another. \ | |
8aeea6e6 | 104 | The VAX assembler fails to stop reading the escape \ |
c53a8ab6 RS |
105 | after three digits, so this is the only way we \ |
106 | can get it to parse the data properly. */ \ | |
d07ecc3b | 107 | if (i < thissize - 1 && ISDIGIT(p[i + 1])) \ |
c53a8ab6 RS |
108 | fprintf (asm_out_file, "\"\n\t.ascii \""); \ |
109 | } \ | |
110 | } \ | |
111 | fprintf (asm_out_file, "\"\n"); \ | |
112 | } \ | |
113 | } \ | |
114 | while (0) | |
115 | #endif | |
d0d4af87 | 116 | |
650f773a JW |
117 | /* This is how we tell the assembler to equate two values. */ |
118 | #ifdef SET_ASM_OP | |
119 | #ifndef ASM_OUTPUT_DEF | |
120 | #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \ | |
e8638df0 | 121 | do { fprintf ((FILE), "%s", SET_ASM_OP); \ |
650f773a JW |
122 | assemble_name (FILE, LABEL1); \ |
123 | fprintf (FILE, ","); \ | |
124 | assemble_name (FILE, LABEL2); \ | |
125 | fprintf (FILE, "\n"); \ | |
126 | } while (0) | |
127 | #endif | |
128 | #endif | |
daefd78b | 129 | |
81d77cda RK |
130 | /* This is how to output a reference to a user-level label named NAME. */ |
131 | ||
132 | #ifndef ASM_OUTPUT_LABELREF | |
19283265 | 133 | #define ASM_OUTPUT_LABELREF(FILE,NAME) asm_fprintf ((FILE), "%U%s", (NAME)) |
81d77cda RK |
134 | #endif |
135 | ||
8215347e JW |
136 | /* Allow target to print debug info labels specially. This is useful for |
137 | VLIW targets, since debug info labels should go into the middle of | |
138 | instruction bundles instead of breaking them. */ | |
139 | ||
140 | #ifndef ASM_OUTPUT_DEBUG_LABEL | |
141 | #define ASM_OUTPUT_DEBUG_LABEL(FILE, PREFIX, NUM) \ | |
142 | ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM) | |
143 | #endif | |
144 | ||
3aa8ab7b | 145 | /* This is how we tell the assembler that a symbol is weak. */ |
20c93f7c RO |
146 | #ifndef ASM_OUTPUT_WEAK_ALIAS |
147 | #if defined (ASM_WEAKEN_LABEL) && defined (ASM_OUTPUT_DEF) | |
3aa8ab7b L |
148 | #define ASM_OUTPUT_WEAK_ALIAS(STREAM, NAME, VALUE) \ |
149 | do \ | |
150 | { \ | |
151 | ASM_WEAKEN_LABEL (STREAM, NAME); \ | |
152 | if (VALUE) \ | |
153 | ASM_OUTPUT_DEF (STREAM, NAME, VALUE); \ | |
154 | } \ | |
155 | while (0) | |
156 | #endif | |
20c93f7c | 157 | #endif |
3aa8ab7b | 158 | |
daefd78b JM |
159 | /* This determines whether or not we support weak symbols. */ |
160 | #ifndef SUPPORTS_WEAK | |
161 | #ifdef ASM_WEAKEN_LABEL | |
162 | #define SUPPORTS_WEAK 1 | |
163 | #else | |
164 | #define SUPPORTS_WEAK 0 | |
165 | #endif | |
166 | #endif | |
a6ab3aad | 167 | |
1ca894a0 MM |
168 | /* This determines whether or not we support link-once semantics. */ |
169 | #ifndef SUPPORTS_ONE_ONLY | |
170 | #ifdef MAKE_DECL_ONE_ONLY | |
171 | #define SUPPORTS_ONE_ONLY 1 | |
172 | #else | |
173 | #define SUPPORTS_ONE_ONLY 0 | |
174 | #endif | |
175 | #endif | |
176 | ||
8f08ea1e L |
177 | /* If the target supports weak symbols, define TARGET_ATTRIBUTE_WEAK to |
178 | provide a weak attribute. Else define it to nothing. | |
179 | ||
d02af173 | 180 | This would normally belong in ansidecl.h, but SUPPORTS_WEAK is |
8f08ea1e L |
181 | not available at that time. |
182 | ||
183 | Note, this is only for use by target files which we know are to be | |
184 | compiled by GCC. */ | |
185 | #ifndef TARGET_ATTRIBUTE_WEAK | |
186 | # if SUPPORTS_WEAK | |
187 | # define TARGET_ATTRIBUTE_WEAK __attribute__ ((weak)) | |
188 | # else | |
189 | # define TARGET_ATTRIBUTE_WEAK | |
190 | # endif | |
191 | #endif | |
192 | ||
ea4f1fce JO |
193 | /* If the target supports init_priority C++ attribute, give |
194 | SUPPORTS_INIT_PRIORITY a nonzero value. */ | |
195 | #ifndef SUPPORTS_INIT_PRIORITY | |
196 | #define SUPPORTS_INIT_PRIORITY 1 | |
197 | #endif /* SUPPORTS_INIT_PRIORITY */ | |
198 | ||
5897739e JO |
199 | /* If duplicate library search directories can be removed from a |
200 | linker command without changing the linker's semantics, give this | |
201 | symbol a nonzero. */ | |
202 | #ifndef LINK_ELIMINATE_DUPLICATE_LDIRECTORIES | |
203 | #define LINK_ELIMINATE_DUPLICATE_LDIRECTORIES 0 | |
204 | #endif /* LINK_ELIMINATE_DUPLICATE_LDIRECTORIES */ | |
205 | ||
a6ab3aad JM |
206 | /* If we have a definition of INCOMING_RETURN_ADDR_RTX, assume that |
207 | the rest of the DWARF 2 frame unwind support is also provided. */ | |
0021b564 JM |
208 | #if !defined (DWARF2_UNWIND_INFO) && defined (INCOMING_RETURN_ADDR_RTX) |
209 | #define DWARF2_UNWIND_INFO 1 | |
a6ab3aad | 210 | #endif |
b366352b | 211 | |
2cc07db4 RH |
212 | /* If we have named sections, and we're using crtstuff to run ctors, |
213 | use them for registering eh frame information. */ | |
02c9b1ca | 214 | #if defined (TARGET_ASM_NAMED_SECTION) && !defined(EH_FRAME_IN_DATA_SECTION) |
7c262518 RH |
215 | #ifndef EH_FRAME_SECTION_NAME |
216 | #define EH_FRAME_SECTION_NAME ".eh_frame" | |
217 | #endif | |
31cf0144 JM |
218 | #endif |
219 | ||
6351543d AG |
220 | /* If we have named section and we support weak symbols, then use the |
221 | .jcr section for recording java classes which need to be registered | |
222 | at program start-up time. */ | |
223 | #if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK | |
224 | #ifndef JCR_SECTION_NAME | |
225 | #define JCR_SECTION_NAME ".jcr" | |
226 | #endif | |
227 | #endif | |
228 | ||
eff01bb6 RH |
229 | /* If we have no definition for UNIQUE_SECTION, but do have the |
230 | ability to generate arbitrary sections, construct something | |
231 | reasonable. */ | |
eff01bb6 RH |
232 | #ifndef UNIQUE_SECTION |
233 | #define UNIQUE_SECTION(DECL,RELOC) \ | |
234 | do { \ | |
235 | int len; \ | |
236 | const char *name; \ | |
237 | char *string; \ | |
238 | \ | |
239 | name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \ | |
240 | /* Strip off any encoding in name. */ \ | |
241 | STRIP_NAME_ENCODING (name, name); \ | |
242 | \ | |
243 | len = strlen (name) + 1; \ | |
244 | string = alloca (len + 1); \ | |
245 | sprintf (string, ".%s", name); \ | |
246 | \ | |
247 | DECL_SECTION_NAME (DECL) = build_string (len, string); \ | |
248 | } while (0) | |
249 | #endif | |
eff01bb6 | 250 | |
b366352b MM |
251 | /* By default, we generate a label at the beginning and end of the |
252 | text section, and compute the size of the text section by | |
253 | subtracting the two. However, on some platforms that doesn't | |
254 | work, and we use the section itself, rather than a label at the | |
255 | beginning of it, to indicate the start of the section. On such | |
256 | platforms, define this to zero. */ | |
257 | #ifndef DWARF2_GENERATE_TEXT_SECTION_LABEL | |
258 | #define DWARF2_GENERATE_TEXT_SECTION_LABEL 1 | |
259 | #endif | |
246833ac RH |
260 | |
261 | /* Supply a default definition for PROMOTE_PROTOTYPES. */ | |
262 | #ifndef PROMOTE_PROTOTYPES | |
263 | #define PROMOTE_PROTOTYPES 0 | |
264 | #endif | |
c478efd1 GDR |
265 | |
266 | /* Number of hardware registers that go into the DWARF-2 unwind info. | |
267 | If not defined, equals FIRST_PSEUDO_REGISTER */ | |
268 | ||
269 | #ifndef DWARF_FRAME_REGISTERS | |
270 | #define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER | |
271 | #endif | |
d8ea8f28 ZW |
272 | |
273 | /* Default sizes for base C types. If the sizes are different for | |
274 | your target, you should override these values by defining the | |
275 | appropriate symbols in your tm.h file. */ | |
276 | ||
277 | #ifndef CHAR_TYPE_SIZE | |
278 | #define CHAR_TYPE_SIZE BITS_PER_UNIT | |
279 | #endif | |
280 | ||
281 | #ifndef SHORT_TYPE_SIZE | |
282 | #define SHORT_TYPE_SIZE (BITS_PER_UNIT * MIN ((UNITS_PER_WORD + 1) / 2, 2)) | |
283 | #endif | |
284 | ||
285 | #ifndef INT_TYPE_SIZE | |
286 | #define INT_TYPE_SIZE BITS_PER_WORD | |
287 | #endif | |
288 | ||
289 | #ifndef LONG_TYPE_SIZE | |
290 | #define LONG_TYPE_SIZE BITS_PER_WORD | |
291 | #endif | |
292 | ||
293 | #ifndef LONG_LONG_TYPE_SIZE | |
294 | #define LONG_LONG_TYPE_SIZE (BITS_PER_WORD * 2) | |
295 | #endif | |
296 | ||
297 | #ifndef WCHAR_TYPE_SIZE | |
298 | #define WCHAR_TYPE_SIZE INT_TYPE_SIZE | |
299 | #endif | |
300 | ||
301 | #ifndef WCHAR_UNSIGNED | |
302 | #define WCHAR_UNSIGNED 0 | |
303 | #endif | |
304 | ||
305 | #ifndef FLOAT_TYPE_SIZE | |
306 | #define FLOAT_TYPE_SIZE BITS_PER_WORD | |
307 | #endif | |
308 | ||
309 | #ifndef DOUBLE_TYPE_SIZE | |
310 | #define DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2) | |
311 | #endif | |
312 | ||
313 | #ifndef LONG_DOUBLE_TYPE_SIZE | |
314 | #define LONG_DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2) | |
315 | #endif | |
316 | ||
2df88e9f JO |
317 | #ifndef BUILD_VA_LIST_TYPE |
318 | #define BUILD_VA_LIST_TYPE(X) ((X) = ptr_type_node) | |
319 | #endif | |
320 | ||
848e0190 JH |
321 | #ifndef PIC_OFFSET_TABLE_REGNUM |
322 | #define PIC_OFFSET_TABLE_REGNUM INVALID_REGNUM | |
323 | #endif | |
324 | ||
b2aec5c0 JH |
325 | /* Type used by GCOV counters. Use 64bit data type if target supports |
326 | it. */ | |
327 | #if LONG_TYPE_SIZE >= 64 | |
328 | #define GCOV_TYPE_SIZE LONG_TYPE_SIZE | |
329 | #else | |
330 | #define GCOV_TYPE_SIZE LONG_LONG_TYPE_SIZE | |
331 | #endif | |
332 | ||
333 | ||
a9374841 MM |
334 | /* By default, the preprocessor should be invoked the same way in C++ |
335 | as in C. */ | |
336 | #ifndef CPLUSPLUS_CPP_SPEC | |
337 | #ifdef CPP_SPEC | |
338 | #define CPLUSPLUS_CPP_SPEC CPP_SPEC | |
339 | #endif | |
340 | #endif | |
341 | ||
bf501a65 RH |
342 | #ifndef ACCUMULATE_OUTGOING_ARGS |
343 | #define ACCUMULATE_OUTGOING_ARGS 0 | |
344 | #endif | |
345 | ||
346 | /* Supply a default definition for PUSH_ARGS. */ | |
347 | #ifndef PUSH_ARGS | |
348 | #ifdef PUSH_ROUNDING | |
349 | #define PUSH_ARGS !ACCUMULATE_OUTGOING_ARGS | |
350 | #else | |
351 | #define PUSH_ARGS 0 | |
352 | #endif | |
353 | #endif | |
354 | ||
31cdd499 ZW |
355 | /* If PREFERRED_STACK_BOUNDARY is not defined, set it to STACK_BOUNDARY. |
356 | STACK_BOUNDARY is required. */ | |
357 | #ifndef PREFERRED_STACK_BOUNDARY | |
358 | #define PREFERRED_STACK_BOUNDARY STACK_BOUNDARY | |
359 | #endif | |
360 | ||
67231816 RH |
361 | /* By default, the C++ compiler will use function addresses in the |
362 | vtable entries. Setting this non-zero tells the compiler to use | |
363 | function descriptors instead. The value of this macro says how | |
364 | many words wide the descriptor is (normally 2). It is assumed | |
365 | that the address of a function descriptor may be treated as a | |
366 | pointer to a function. */ | |
367 | #ifndef TARGET_VTABLE_USES_DESCRIPTORS | |
368 | #define TARGET_VTABLE_USES_DESCRIPTORS 0 | |
369 | #endif | |
370 | ||
2a1ee410 RH |
371 | /* Select a format to encode pointers in exception handling data. We |
372 | prefer those that result in fewer dynamic relocations. Assume no | |
373 | special support here and encode direct references. */ | |
374 | #ifndef ASM_PREFERRED_EH_DATA_FORMAT | |
375 | #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) DW_EH_PE_absptr | |
376 | #endif | |
377 | ||
f3c55c97 AO |
378 | /* By default, the C++ compiler will use the lowest bit of the pointer |
379 | to function to indicate a pointer-to-member-function points to a | |
380 | virtual member function. However, if FUNCTION_BOUNDARY indicates | |
381 | function addresses aren't always even, the lowest bit of the delta | |
382 | field will be used. */ | |
383 | #ifndef TARGET_PTRMEMFUNC_VBIT_LOCATION | |
384 | #define TARGET_PTRMEMFUNC_VBIT_LOCATION \ | |
385 | (FUNCTION_BOUNDARY >= 2 * BITS_PER_UNIT \ | |
386 | ? ptrmemfunc_vbit_in_pfn : ptrmemfunc_vbit_in_delta) | |
387 | #endif | |
388 | ||
4da5f005 MM |
389 | /* True if it is possible to profile code that does not have a frame |
390 | pointer. */ | |
391 | ||
392 | #ifndef TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER | |
393 | #define TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER true | |
394 | #endif | |
395 | ||
c8af3574 RH |
396 | /* GAS and SYSV4 assemblers accept these. */ |
397 | #ifdef OBJECT_FORMAT_ELF | |
398 | #ifndef UNALIGNED_SHORT_ASM_OP | |
399 | #define UNALIGNED_SHORT_ASM_OP "\t.2byte\t" | |
400 | #endif | |
401 | #ifndef UNALIGNED_INT_ASM_OP | |
402 | #define UNALIGNED_INT_ASM_OP "\t.4byte\t" | |
403 | #endif | |
404 | #ifndef UNALIGNED_DOUBLE_INT_ASM_OP | |
405 | #define UNALIGNED_DOUBLE_INT_ASM_OP "\t.8byte\t" | |
406 | #endif | |
407 | #endif /* OBJECT_FORMAT_ELF */ | |
408 | ||
409 | #ifndef ASM_BYTE_OP | |
410 | #define ASM_BYTE_OP "\t.byte\t" | |
411 | #endif | |
412 | ||
88657302 | 413 | #endif /* ! GCC_DEFAULTS_H */ |