]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/alpha/elf.h
elf.h (ASM_OUTPUT_DEF): Tidy.
[thirdparty/gcc.git] / gcc / config / alpha / elf.h
1 /* Definitions of target machine for GNU compiler, for DEC Alpha w/ELF.
2 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
3 Free Software Foundation, Inc.
4 Contributed by Richard Henderson (rth@tamu.edu).
5
6 This file is part of GNU CC.
7
8 GNU CC 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.
12
13 GNU CC 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 GNU CC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
22
23 #undef OBJECT_FORMAT_COFF
24 #undef EXTENDED_COFF
25 #define OBJECT_FORMAT_ELF
26
27 /* ??? Move all SDB stuff from alpha.h to osf.h. */
28 #undef SDB_DEBUGGING_INFO
29
30 #define DBX_DEBUGGING_INFO
31 #define DWARF2_DEBUGGING_INFO
32
33 #undef PREFERRED_DEBUGGING_TYPE
34 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
35
36 #undef ASM_FINAL_SPEC
37
38 #undef CC1_SPEC
39 #define CC1_SPEC "%{G*}"
40
41 #undef ASM_SPEC
42 #define ASM_SPEC "%{G*} %{relax:-relax} %{!gstabs*:-no-mdebug}%{gstabs*:-mdebug}"
43
44 #undef LINK_SPEC
45 #define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
46 %{O*:-O3} %{!O*:-O1} \
47 %{shared:-shared} \
48 %{!shared: \
49 %{!static: \
50 %{rdynamic:-export-dynamic} \
51 %{!dynamic-linker:-dynamic-linker %(elf_dynamic_linker)}} \
52 %{static:-static}}"
53
54 /* Output at beginning of assembler file. */
55 #undef ASM_FILE_START
56 #define ASM_FILE_START(FILE) \
57 do { \
58 if (write_symbols == DBX_DEBUG) \
59 { \
60 alpha_write_verstamp (FILE); \
61 output_file_directive (FILE, main_input_filename); \
62 } \
63 fprintf (FILE, "\t.set noat\n"); \
64 fprintf (FILE, "\t.set noreorder\n"); \
65 if (TARGET_EXPLICIT_RELOCS) \
66 fprintf (FILE, "\t.set nomacro\n"); \
67 if (TARGET_BWX | TARGET_MAX | TARGET_FIX | TARGET_CIX) \
68 { \
69 fprintf (FILE, "\t.arch %s\n", \
70 (TARGET_CPU_EV6 ? "ev6" \
71 : TARGET_MAX ? "pca56" : "ev56")); \
72 } \
73 } while (0)
74
75 #undef IDENT_ASM_OP
76 #define IDENT_ASM_OP "\t.ident\t"
77
78 /* Allow #sccs in preprocessor. */
79 #define SCCS_DIRECTIVE
80
81 /* Output #ident as a .ident. */
82 #undef ASM_OUTPUT_IDENT
83 #define ASM_OUTPUT_IDENT(FILE, NAME) \
84 fprintf (FILE, "%s\"%s\"\n", IDENT_ASM_OP, NAME);
85
86 /* This is how to allocate empty space in some section. The .zero
87 pseudo-op is used for this on most svr4 assemblers. */
88
89 #undef SKIP_ASM_OP
90 #define SKIP_ASM_OP "\t.zero\t"
91
92 #undef ASM_OUTPUT_SKIP
93 #define ASM_OUTPUT_SKIP(FILE, SIZE) \
94 fprintf (FILE, "%s%u\n", SKIP_ASM_OP, (SIZE))
95
96 /* Output the label which precedes a jumptable. Note that for all svr4
97 systems where we actually generate jumptables (which is to say every
98 svr4 target except i386, where we use casesi instead) we put the jump-
99 tables into the .rodata section and since other stuff could have been
100 put into the .rodata section prior to any given jumptable, we have to
101 make sure that the location counter for the .rodata section gets pro-
102 perly re-aligned prior to the actual beginning of the jump table. */
103
104 #undef ALIGN_ASM_OP
105 #define ALIGN_ASM_OP "\t.align\t"
106
107 #ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
108 #define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE, PREFIX, NUM, TABLE) \
109 ASM_OUTPUT_ALIGN ((FILE), 2);
110 #endif
111
112 #undef ASM_OUTPUT_CASE_LABEL
113 #define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE) \
114 do { \
115 ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
116 ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
117 } while (0)
118
119 /* The standard SVR4 assembler seems to require that certain builtin
120 library routines (e.g. .udiv) be explicitly declared as .globl
121 in each assembly file where they are referenced. */
122
123 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
124 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
125 ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
126
127 /* This says how to output assembler code to declare an
128 uninitialized external linkage data object. Under SVR4,
129 the linker seems to want the alignment of data objects
130 to depend on their types. We do exactly that here. */
131
132 #undef COMMON_ASM_OP
133 #define COMMON_ASM_OP "\t.comm\t"
134
135 #undef ASM_OUTPUT_ALIGNED_COMMON
136 #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
137 do { \
138 fprintf ((FILE), "%s", COMMON_ASM_OP); \
139 assemble_name ((FILE), (NAME)); \
140 fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
141 } while (0)
142
143 /* This says how to output assembler code to declare an
144 uninitialized internal linkage data object. Under SVR4,
145 the linker seems to want the alignment of data objects
146 to depend on their types. We do exactly that here. */
147
148 #undef ASM_OUTPUT_ALIGNED_LOCAL
149 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
150 do { \
151 if ((SIZE) <= g_switch_value) \
152 sbss_section(); \
153 else \
154 bss_section(); \
155 fprintf (FILE, "%s", TYPE_ASM_OP); \
156 assemble_name (FILE, NAME); \
157 putc (',', FILE); \
158 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
159 putc ('\n', FILE); \
160 if (!flag_inhibit_size_directive) \
161 { \
162 fprintf (FILE, "%s", SIZE_ASM_OP); \
163 assemble_name (FILE, NAME); \
164 fprintf (FILE, ",%d\n", (SIZE)); \
165 } \
166 ASM_OUTPUT_ALIGN ((FILE), exact_log2((ALIGN) / BITS_PER_UNIT)); \
167 ASM_OUTPUT_LABEL(FILE, NAME); \
168 ASM_OUTPUT_SKIP((FILE), (SIZE)); \
169 } while (0)
170
171 /* This says how to output assembler code to declare an
172 uninitialized external linkage data object. */
173
174 #undef ASM_OUTPUT_ALIGNED_BSS
175 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
176 do { \
177 ASM_GLOBALIZE_LABEL (FILE, NAME); \
178 ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \
179 } while (0)
180
181 /* Biggest alignment supported by the object file format of this
182 machine. Use this macro to limit the alignment which can be
183 specified using the `__attribute__ ((aligned (N)))' construct. If
184 not defined, the default value is `BIGGEST_ALIGNMENT'.
185
186 This value is really 2^63. Since gcc figures the alignment in bits,
187 we could only potentially get to 2^60 on suitible hosts. Due to other
188 considerations in varasm, we must restrict this to what fits in an int. */
189
190 #undef MAX_OFILE_ALIGNMENT
191 #define MAX_OFILE_ALIGNMENT \
192 (1 << (HOST_BITS_PER_INT < 64 ? HOST_BITS_PER_INT - 2 : 62))
193
194 /* This is the pseudo-op used to generate a contiguous sequence of byte
195 values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
196 AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
197
198 #undef ASCII_DATA_ASM_OP
199 #define ASCII_DATA_ASM_OP "\t.ascii\t"
200
201 /* Support const sections and the ctors and dtors sections for g++.
202 Note that there appears to be two different ways to support const
203 sections at the moment. You can either #define the symbol
204 READONLY_DATA_SECTION (giving it some code which switches to the
205 readonly data section) or else you can #define the symbols
206 EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
207 SELECT_RTX_SECTION. We do both here just to be on the safe side. */
208
209 #undef USE_CONST_SECTION
210 #define USE_CONST_SECTION 1
211
212 #undef CONST_SECTION_ASM_OP
213 #define CONST_SECTION_ASM_OP "\t.section\t.rodata"
214
215 #undef BSS_SECTION_ASM_OP
216 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
217 #undef SBSS_SECTION_ASM_OP
218 #define SBSS_SECTION_ASM_OP "\t.section\t.sbss,\"aw\""
219 #undef SDATA_SECTION_ASM_OP
220 #define SDATA_SECTION_ASM_OP "\t.section\t.sdata,\"aw\""
221
222 /* On svr4, we *do* have support for the .init and .fini sections, and we
223 can put stuff in there to be executed before and after `main'. We let
224 crtstuff.c and other files know this by defining the following symbols.
225 The definitions say how to change sections to the .init and .fini
226 sections. This is the same for all known svr4 assemblers. */
227
228 #undef INIT_SECTION_ASM_OP
229 #define INIT_SECTION_ASM_OP "\t.section\t.init"
230 #undef FINI_SECTION_ASM_OP
231 #define FINI_SECTION_ASM_OP "\t.section\t.fini"
232
233 #ifdef HAVE_GAS_SUBSECTION_ORDERING
234
235 #define ASM_SECTION_START_OP "\t.subsection\t-1"
236
237 /* Output assembly directive to move to the beginning of current section. */
238 #define ASM_OUTPUT_SECTION_START(FILE) \
239 fprintf ((FILE), "%s\n", ASM_SECTION_START_OP)
240
241 #endif
242
243 /* A default list of other sections which we might be "in" at any given
244 time. For targets that use additional sections (e.g. .tdesc) you
245 should override this definition in the target-specific file which
246 includes this file. */
247
248 #undef EXTRA_SECTIONS
249 #define EXTRA_SECTIONS in_const, in_sbss, in_sdata
250
251 /* A default list of extra section function definitions. For targets
252 that use additional sections (e.g. .tdesc) you should override this
253 definition in the target-specific file which includes this file. */
254
255 #undef EXTRA_SECTION_FUNCTIONS
256 #define EXTRA_SECTION_FUNCTIONS \
257 CONST_SECTION_FUNCTION \
258 SECTION_FUNCTION_TEMPLATE(sbss_section, in_sbss, SBSS_SECTION_ASM_OP) \
259 SECTION_FUNCTION_TEMPLATE(sdata_section, in_sdata, SDATA_SECTION_ASM_OP)
260
261 extern void sbss_section PARAMS ((void));
262 extern void sdata_section PARAMS ((void));
263
264 #undef READONLY_DATA_SECTION
265 #define READONLY_DATA_SECTION() const_section ()
266
267 #undef CONST_SECTION_FUNCTION
268 #define CONST_SECTION_FUNCTION \
269 void \
270 const_section () \
271 { \
272 if (!USE_CONST_SECTION) \
273 text_section(); \
274 else if (in_section != in_const) \
275 { \
276 fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
277 in_section = in_const; \
278 } \
279 }
280
281 #undef SECTION_FUNCTION_TEMPLATE
282 #define SECTION_FUNCTION_TEMPLATE(FN, ENUM, OP) \
283 void FN () \
284 { \
285 if (in_section != ENUM) \
286 { \
287 fprintf (asm_out_file, "%s\n", OP); \
288 in_section = ENUM; \
289 } \
290 }
291
292 /* Switch into a generic section. */
293 #define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
294
295 /* A C statement or statements to switch to the appropriate
296 section for output of DECL. DECL is either a `VAR_DECL' node
297 or a constant of some sort. RELOC indicates whether forming
298 the initial value of DECL requires link-time relocations.
299
300 Set SECNUM to:
301 0 .text
302 1 .rodata
303 2 .data
304 3 .sdata
305 4 .bss
306 5 .sbss
307 */
308
309 #define DO_SELECT_SECTION(SECNUM, DECL, RELOC) \
310 do \
311 { \
312 HOST_WIDE_INT size; \
313 SECNUM = 1; \
314 if (TREE_CODE (DECL) == FUNCTION_DECL) \
315 { \
316 SECNUM = 0; \
317 break; \
318 } \
319 else if (TREE_CODE (DECL) == STRING_CST) \
320 { \
321 if (flag_writable_strings) \
322 SECNUM = 2; \
323 else \
324 SECNUM = 0x101; \
325 break; \
326 } \
327 else if (TREE_CODE (DECL) == VAR_DECL) \
328 { \
329 if (DECL_INITIAL (DECL) == NULL \
330 || DECL_INITIAL (DECL) == error_mark_node) \
331 SECNUM = 4; \
332 else if ((flag_pic && RELOC) \
333 || ! TREE_READONLY (DECL) \
334 || TREE_SIDE_EFFECTS (DECL) \
335 || ! TREE_CONSTANT (DECL_INITIAL (DECL))) \
336 SECNUM = 2; \
337 else if (flag_merge_constants >= 2) \
338 { \
339 /* C and C++ don't allow different variables to \
340 share the same location. -fmerge-all-constants\
341 allows even that (at the expense of not \
342 conforming). */ \
343 if (TREE_CODE (DECL_INITIAL (DECL)) == STRING_CST)\
344 SECNUM = 0x201; \
345 else \
346 SECNUM = 0x301; \
347 } \
348 } \
349 else if (TREE_CODE (DECL) == CONSTRUCTOR) \
350 { \
351 if ((flag_pic && RELOC) \
352 || TREE_SIDE_EFFECTS (DECL) \
353 || ! TREE_CONSTANT (DECL)) \
354 SECNUM = 2; \
355 } \
356 \
357 /* Select small data sections based on size. */ \
358 size = int_size_in_bytes (TREE_TYPE (DECL)); \
359 if (size >= 0 && size <= g_switch_value) \
360 { \
361 if ((SECNUM & 0xff) >= 2) \
362 SECNUM += 1; \
363 /* Move readonly data to .sdata only if -msmall-data. */ \
364 /* ??? Consider .sdata.{lit4,lit8} as \
365 SHF_MERGE|SHF_ALPHA_GPREL. */ \
366 else if (TARGET_SMALL_DATA) \
367 SECNUM = 3; \
368 } \
369 } \
370 while (0)
371
372 #undef SELECT_SECTION
373 #define SELECT_SECTION(DECL, RELOC, ALIGN) \
374 do \
375 { \
376 typedef void (*sec_fn) PARAMS ((void)); \
377 static sec_fn const sec_functions[6] = \
378 { \
379 text_section, \
380 const_section, \
381 data_section, \
382 sdata_section, \
383 bss_section, \
384 sbss_section \
385 }; \
386 \
387 int sec; \
388 \
389 DO_SELECT_SECTION (sec, DECL, RELOC); \
390 \
391 switch (sec) \
392 { \
393 case 0x101: \
394 mergeable_string_section (DECL, ALIGN, 0); \
395 break; \
396 case 0x201: \
397 mergeable_string_section (DECL_INITIAL (DECL),\
398 ALIGN, 0); \
399 break; \
400 case 0x301: \
401 mergeable_constant_section (DECL_MODE (DECL), \
402 ALIGN, 0); \
403 break; \
404 default: \
405 (*sec_functions[sec]) (); \
406 break; \
407 } \
408 } \
409 while (0)
410
411 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
412
413 #undef UNIQUE_SECTION
414 #define UNIQUE_SECTION(DECL, RELOC) \
415 do \
416 { \
417 static const char * const prefixes[6][2] = \
418 { \
419 { ".text.", ".gnu.linkonce.t." }, \
420 { ".rodata.", ".gnu.linkonce.r." }, \
421 { ".data.", ".gnu.linkonce.d." }, \
422 { ".sdata.", ".gnu.linkonce.s." }, \
423 { ".bss.", ".gnu.linkonce.b." }, \
424 { ".sbss.", ".gnu.linkonce.sb." } \
425 }; \
426 \
427 int nlen, plen, sec; \
428 const char *name, *prefix; \
429 char *string; \
430 \
431 DO_SELECT_SECTION (sec, DECL, RELOC); \
432 \
433 name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
434 STRIP_NAME_ENCODING (name, name); \
435 nlen = strlen (name); \
436 \
437 prefix = prefixes[sec & 0xff][DECL_ONE_ONLY(DECL)]; \
438 plen = strlen (prefix); \
439 \
440 string = alloca (nlen + plen + 1); \
441 \
442 memcpy (string, prefix, plen); \
443 memcpy (string + plen, name, nlen + 1); \
444 \
445 DECL_SECTION_NAME (DECL) = build_string (nlen + plen, string); \
446 } \
447 while (0)
448
449 /* A C statement or statements to switch to the appropriate
450 section for output of RTX in mode MODE. RTX is some kind
451 of constant in RTL. The argument MODE is redundant except
452 in the case of a `const_int' rtx. Currently, these always
453 go into the const section. */
454
455 #undef SELECT_RTX_SECTION
456 #define SELECT_RTX_SECTION(MODE, RTX, ALIGN) \
457 do { \
458 if (TARGET_SMALL_DATA && GET_MODE_SIZE (MODE) <= g_switch_value) \
459 /* ??? Consider .sdata.{lit4,lit8} as SHF_MERGE|SHF_ALPHA_GPREL. */ \
460 sdata_section (); \
461 else \
462 mergeable_constant_section((MODE), (ALIGN), 0); \
463 } while (0)
464
465 /* Define the strings used for the special svr4 .type and .size directives.
466 These strings generally do not vary from one system running svr4 to
467 another, but if a given system (e.g. m88k running svr) needs to use
468 different pseudo-op names for these, they may be overridden in the
469 file which includes this one. */
470
471 #undef TYPE_ASM_OP
472 #define TYPE_ASM_OP "\t.type\t"
473 #undef SIZE_ASM_OP
474 #define SIZE_ASM_OP "\t.size\t"
475
476 /* This is how we tell the assembler that a symbol is weak. */
477
478 #undef ASM_WEAKEN_LABEL
479 #define ASM_WEAKEN_LABEL(FILE, NAME) \
480 do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
481 fputc ('\n', FILE); } while (0)
482
483 /* This is how we tell the assembler that two symbols have the same value. */
484
485 #undef ASM_OUTPUT_DEF
486 #define ASM_OUTPUT_DEF(FILE, ALIAS, NAME) \
487 do { \
488 assemble_name(FILE, ALIAS); \
489 fputs(" = ", FILE); \
490 assemble_name(FILE, NAME); \
491 fputc('\n', FILE); \
492 } while (0)
493
494 #undef ASM_OUTPUT_DEF_FROM_DECLS
495 #define ASM_OUTPUT_DEF_FROM_DECLS(FILE, DECL, TARGET) \
496 do { \
497 const char *alias = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
498 const char *name = IDENTIFIER_POINTER (TARGET); \
499 if (TREE_CODE (DECL) == FUNCTION_DECL) \
500 { \
501 fputc ('$', FILE); \
502 assemble_name (FILE, alias); \
503 fputs ("..ng = $", FILE); \
504 assemble_name (FILE, name); \
505 fputs ("..ng\n", FILE); \
506 } \
507 assemble_name(FILE, alias); \
508 fputs(" = ", FILE); \
509 assemble_name(FILE, name); \
510 fputc('\n', FILE); \
511 } while (0)
512
513 /* The following macro defines the format used to output the second
514 operand of the .type assembler directive. Different svr4 assemblers
515 expect various different forms for this operand. The one given here
516 is just a default. You may need to override it in your machine-
517 specific tm.h file (depending upon the particulars of your assembler). */
518
519 #undef TYPE_OPERAND_FMT
520 #define TYPE_OPERAND_FMT "@%s"
521
522 /* Write the extra assembler code needed to declare a function's result.
523 Most svr4 assemblers don't require any special declaration of the
524 result value, but there are exceptions. */
525
526 #ifndef ASM_DECLARE_RESULT
527 #define ASM_DECLARE_RESULT(FILE, RESULT)
528 #endif
529
530 /* These macros generate the special .type and .size directives which
531 are used to set the corresponding fields of the linker symbol table
532 entries in an ELF object file under SVR4. These macros also output
533 the starting labels for the relevant functions/objects. */
534
535 /* Write the extra assembler code needed to declare an object properly. */
536
537 #undef ASM_DECLARE_OBJECT_NAME
538 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
539 do { \
540 HOST_WIDE_INT size; \
541 fprintf (FILE, "%s", TYPE_ASM_OP); \
542 assemble_name (FILE, NAME); \
543 putc (',', FILE); \
544 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
545 putc ('\n', FILE); \
546 size_directive_output = 0; \
547 if (!flag_inhibit_size_directive \
548 && DECL_SIZE (DECL) \
549 && (size = int_size_in_bytes (TREE_TYPE (DECL))) > 0) \
550 { \
551 size_directive_output = 1; \
552 fprintf (FILE, "%s", SIZE_ASM_OP); \
553 assemble_name (FILE, NAME); \
554 fputc (',', FILE); \
555 fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, size); \
556 fputc ('\n', FILE); \
557 } \
558 ASM_OUTPUT_LABEL(FILE, NAME); \
559 } while (0)
560
561 /* Output the size directive for a decl in rest_of_decl_compilation
562 in the case where we did not do so before the initializer.
563 Once we find the error_mark_node, we know that the value of
564 size_directive_output was set
565 by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
566
567 #undef ASM_FINISH_DECLARE_OBJECT
568 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
569 do { \
570 const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
571 HOST_WIDE_INT size; \
572 if (!flag_inhibit_size_directive \
573 && DECL_SIZE (DECL) \
574 && ! AT_END && TOP_LEVEL \
575 && DECL_INITIAL (DECL) == error_mark_node \
576 && !size_directive_output \
577 && (size = int_size_in_bytes (TREE_TYPE (DECL))) > 0) \
578 { \
579 size_directive_output = 1; \
580 fprintf (FILE, "%s", SIZE_ASM_OP); \
581 assemble_name (FILE, name); \
582 fputc (',', FILE); \
583 fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, size); \
584 fputc ('\n', FILE); \
585 } \
586 } while (0)
587
588 /* A table of bytes codes used by the ASM_OUTPUT_ASCII and
589 ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
590 corresponds to a particular byte value [0..255]. For any
591 given byte value, if the value in the corresponding table
592 position is zero, the given character can be output directly.
593 If the table value is 1, the byte must be output as a \ooo
594 octal escape. If the tables value is anything else, then the
595 byte value should be output as a \ followed by the value
596 in the table. Note that we can use standard UN*X escape
597 sequences for many control characters, but we don't use
598 \a to represent BEL because some svr4 assemblers (e.g. on
599 the i386) don't know about that. Also, we don't use \v
600 since some versions of gas, such as 2.2 did not accept it. */
601
602 #undef ESCAPES
603 #define ESCAPES \
604 "\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
605 \0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
606 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
607 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
608 \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
609 \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
610 \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
611 \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
612
613 /* Some svr4 assemblers have a limit on the number of characters which
614 can appear in the operand of a .string directive. If your assembler
615 has such a limitation, you should define STRING_LIMIT to reflect that
616 limit. Note that at least some svr4 assemblers have a limit on the
617 actual number of bytes in the double-quoted string, and that they
618 count each character in an escape sequence as one byte. Thus, an
619 escape sequence like \377 would count as four bytes.
620
621 If your target assembler doesn't support the .string directive, you
622 should define this to zero. */
623
624 #undef STRING_LIMIT
625 #define STRING_LIMIT ((unsigned) 256)
626 #undef STRING_ASM_OP
627 #define STRING_ASM_OP "\t.string\t"
628
629 /* GAS is the only Alpha/ELF assembler. */
630 #undef TARGET_GAS
631 #define TARGET_GAS (1)
632
633 /* Provide a STARTFILE_SPEC appropriate for ELF. Here we add the
634 (even more) magical crtbegin.o file which provides part of the
635 support for getting C++ file-scope static object constructed
636 before entering `main'. */
637
638 #undef STARTFILE_SPEC
639 #define STARTFILE_SPEC \
640 "%{!shared: \
641 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\
642 crti.o%s %{static:crtbeginT.o%s}\
643 %{!static:%{shared:crtbeginS.o%s}%{!shared:crtbegin.o%s}}"
644
645 /* Provide a ENDFILE_SPEC appropriate for ELF. Here we tack on the
646 magical crtend.o file which provides part of the support for
647 getting C++ file-scope static object constructed before entering
648 `main', followed by a normal ELF "finalizer" file, `crtn.o'. */
649
650 #undef ENDFILE_SPEC
651 #define ENDFILE_SPEC \
652 "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
653 %{shared:crtendS.o%s}%{!shared:crtend.o%s} crtn.o%s"
654
655 /* We support #pragma. */
656 #define HANDLE_SYSV_PRAGMA
657
658 /* Select a format to encode pointers in exception handling data. CODE
659 is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
660 true if the symbol may be affected by dynamic relocations.
661
662 Since application size is already constrained to <2GB by the form of
663 the ldgp relocation, we can use a 32-bit pc-relative relocation to
664 static data. Dynamic data is accessed indirectly to allow for read
665 only EH sections. */
666 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
667 (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4)
668
669 /* If defined, a C statement to be executed just prior to the output of
670 assembler code for INSN. */
671 #define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS) \
672 (alpha_this_literal_sequence_number = 0, \
673 alpha_this_gpdisp_sequence_number = 0)
674 extern int alpha_this_literal_sequence_number;
675 extern int alpha_this_gpdisp_sequence_number;
676
677 /* Since the bits of the _init and _fini function is spread across
678 many object files, each potentially with its own GP, we must assume
679 we need to load our GP. Further, the .init/.fini section can
680 easily be more than 4MB away from the function to call so we can't
681 use bsr. */
682 #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
683 asm (SECTION_OP "\n" \
684 " br $29,1f\n" \
685 "1: ldgp $29,0($29)\n" \
686 " unop\n" \
687 " jsr $26," USER_LABEL_PREFIX #FUNC "\n" \
688 " .align 3\n" \
689 " .previous");
690
691 /* If we have the capability create headers for efficient EH lookup.
692 As of Jan 2002, only glibc 2.2.4 can actually make use of this, but
693 I imagine that other systems will catch up. In the meantime, it
694 doesn't harm to make sure that the data exists to be used later. */
695 #if defined(HAVE_LD_EH_FRAME_HDR)
696 #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
697 #endif