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