1 /* Definitions of target machine for GNU compiler, for DEC Alpha w/ELF.
2 Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
3 Contributed by Richard Henderson (rth@tamu.edu).
5 This file is part of GNU CC.
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 #undef OBJECT_FORMAT_COFF
24 #define OBJECT_FORMAT_ELF
26 #define DBX_DEBUGGING_INFO
27 #define DWARF2_DEBUGGING_INFO
29 #undef PREFERRED_DEBUGGING_TYPE
30 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
35 #define CC1_SPEC "%{G*}"
38 #define ASM_SPEC "%{G*} %{relax:-relax} %{!gstabs*:-no-mdebug}%{gstabs*:-mdebug}"
41 #define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
42 %{O*:-O3} %{!O*:-O1} \
46 %{rdynamic:-export-dynamic} \
47 %{!dynamic-linker:-dynamic-linker %(elf_dynamic_linker)}} \
50 /* Output at beginning of assembler file. */
52 #define ASM_FILE_START(FILE) \
54 if (write_symbols == DBX_DEBUG) \
56 alpha_write_verstamp (FILE); \
57 output_file_directive (FILE, main_input_filename); \
59 fprintf (FILE, "\t.set noat\n"); \
60 fprintf (FILE, "\t.set noreorder\n"); \
61 if (TARGET_BWX | TARGET_MAX | TARGET_FIX | TARGET_CIX) \
63 fprintf (FILE, "\t.arch %s\n", \
64 (TARGET_CPU_EV6 ? "ev6" \
65 : TARGET_MAX ? "pca56" : "ev56")); \
70 #define IDENT_ASM_OP "\t.ident\t"
72 /* Allow #sccs in preprocessor. */
73 #define SCCS_DIRECTIVE
75 /* Output #ident as a .ident. */
76 #undef ASM_OUTPUT_IDENT
77 #define ASM_OUTPUT_IDENT(FILE, NAME) \
78 fprintf (FILE, "%s\"%s\"\n", IDENT_ASM_OP, NAME);
80 /* This is how to allocate empty space in some section. The .zero
81 pseudo-op is used for this on most svr4 assemblers. */
84 #define SKIP_ASM_OP "\t.zero\t"
86 #undef ASM_OUTPUT_SKIP
87 #define ASM_OUTPUT_SKIP(FILE, SIZE) \
88 fprintf (FILE, "%s%u\n", SKIP_ASM_OP, (SIZE))
90 /* Output the label which precedes a jumptable. Note that for all svr4
91 systems where we actually generate jumptables (which is to say every
92 svr4 target except i386, where we use casesi instead) we put the jump-
93 tables into the .rodata section and since other stuff could have been
94 put into the .rodata section prior to any given jumptable, we have to
95 make sure that the location counter for the .rodata section gets pro-
96 perly re-aligned prior to the actual beginning of the jump table. */
99 #define ALIGN_ASM_OP "\t.align\t"
101 #ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
102 #define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE, PREFIX, NUM, TABLE) \
103 ASM_OUTPUT_ALIGN ((FILE), 2);
106 #undef ASM_OUTPUT_CASE_LABEL
107 #define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE) \
109 ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
110 ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
113 /* The standard SVR4 assembler seems to require that certain builtin
114 library routines (e.g. .udiv) be explicitly declared as .globl
115 in each assembly file where they are referenced. */
117 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
118 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
119 ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
121 /* This says how to output assembler code to declare an
122 uninitialized external linkage data object. Under SVR4,
123 the linker seems to want the alignment of data objects
124 to depend on their types. We do exactly that here. */
127 #define COMMON_ASM_OP "\t.comm\t"
129 #undef ASM_OUTPUT_ALIGNED_COMMON
130 #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
132 fprintf ((FILE), "%s", COMMON_ASM_OP); \
133 assemble_name ((FILE), (NAME)); \
134 fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
137 /* This says how to output assembler code to declare an
138 uninitialized internal linkage data object. Under SVR4,
139 the linker seems to want the alignment of data objects
140 to depend on their types. We do exactly that here. */
142 #undef ASM_OUTPUT_ALIGNED_LOCAL
143 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
145 if ((SIZE) <= g_switch_value) \
149 fprintf (FILE, "%s", TYPE_ASM_OP); \
150 assemble_name (FILE, NAME); \
152 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
154 if (!flag_inhibit_size_directive) \
156 fprintf (FILE, "%s", SIZE_ASM_OP); \
157 assemble_name (FILE, NAME); \
158 fprintf (FILE, ",%d\n", (SIZE)); \
160 ASM_OUTPUT_ALIGN ((FILE), exact_log2((ALIGN) / BITS_PER_UNIT)); \
161 ASM_OUTPUT_LABEL(FILE, NAME); \
162 ASM_OUTPUT_SKIP((FILE), (SIZE)); \
165 /* This is the pseudo-op used to generate a 64-bit word of data with a
166 specific value in some section. */
169 #define INT_ASM_OP "\t.quad\t"
171 /* Biggest alignment supported by the object file format of this
172 machine. Use this macro to limit the alignment which can be
173 specified using the `__attribute__ ((aligned (N)))' construct. If
174 not defined, the default value is `BIGGEST_ALIGNMENT'.
176 This value is really 2^63. Since gcc figures the alignment in bits,
177 we could only potentially get to 2^60 on suitible hosts. Due to other
178 considerations in varasm, we must restrict this to what fits in an int. */
180 #undef MAX_OFILE_ALIGNMENT
181 #define MAX_OFILE_ALIGNMENT \
182 (1 << (HOST_BITS_PER_INT < 64 ? HOST_BITS_PER_INT - 2 : 62))
184 /* This is the pseudo-op used to generate a contiguous sequence of byte
185 values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
186 AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
188 #undef ASCII_DATA_ASM_OP
189 #define ASCII_DATA_ASM_OP "\t.ascii\t"
191 /* Support const sections and the ctors and dtors sections for g++.
192 Note that there appears to be two different ways to support const
193 sections at the moment. You can either #define the symbol
194 READONLY_DATA_SECTION (giving it some code which switches to the
195 readonly data section) or else you can #define the symbols
196 EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
197 SELECT_RTX_SECTION. We do both here just to be on the safe side. */
199 #undef USE_CONST_SECTION
200 #define USE_CONST_SECTION 1
202 #undef CONST_SECTION_ASM_OP
203 #define CONST_SECTION_ASM_OP "\t.section\t.rodata"
205 /* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
207 Note that we want to give these sections the SHF_WRITE attribute
208 because these sections will actually contain data (i.e. tables of
209 addresses of functions in the current root executable or shared library
210 file) and, in the case of a shared library, the relocatable addresses
211 will have to be properly resolved/relocated (and then written into) by
212 the dynamic linker when it actually attaches the given shared library
213 to the executing process. (Note that on SVR4, you may wish to use the
214 `-z text' option to the ELF linker, when building a shared library, as
215 an additional check that you are doing everything right. But if you do
216 use the `-z text' option when building a shared library, you will get
217 errors unless the .ctors and .dtors sections are marked as writable
218 via the SHF_WRITE attribute.) */
220 #undef CTORS_SECTION_ASM_OP
221 #define CTORS_SECTION_ASM_OP "\t.section\t.ctors,\"aw\""
222 #undef DTORS_SECTION_ASM_OP
223 #define DTORS_SECTION_ASM_OP "\t.section\t.dtors,\"aw\""
225 /* Handle the small data sections. */
226 #undef BSS_SECTION_ASM_OP
227 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
228 #undef SBSS_SECTION_ASM_OP
229 #define SBSS_SECTION_ASM_OP "\t.section\t.sbss,\"aw\""
230 #undef SDATA_SECTION_ASM_OP
231 #define SDATA_SECTION_ASM_OP "\t.section\t.sdata,\"aw\""
233 /* On svr4, we *do* have support for the .init and .fini sections, and we
234 can put stuff in there to be executed before and after `main'. We let
235 crtstuff.c and other files know this by defining the following symbols.
236 The definitions say how to change sections to the .init and .fini
237 sections. This is the same for all known svr4 assemblers. */
239 #undef INIT_SECTION_ASM_OP
240 #define INIT_SECTION_ASM_OP "\t.section\t.init"
241 #undef FINI_SECTION_ASM_OP
242 #define FINI_SECTION_ASM_OP "\t.section\t.fini"
244 /* A default list of other sections which we might be "in" at any given
245 time. For targets that use additional sections (e.g. .tdesc) you
246 should override this definition in the target-specific file which
247 includes this file. */
249 #undef EXTRA_SECTIONS
250 #define EXTRA_SECTIONS in_const, in_ctors, in_dtors, in_sbss, in_sdata
252 /* A default list of extra section function definitions. For targets
253 that use additional sections (e.g. .tdesc) you should override this
254 definition in the target-specific file which includes this file. */
256 #undef EXTRA_SECTION_FUNCTIONS
257 #define EXTRA_SECTION_FUNCTIONS \
258 CONST_SECTION_FUNCTION \
259 SECTION_FUNCTION_TEMPLATE(ctors_section, in_ctors, CTORS_SECTION_ASM_OP) \
260 SECTION_FUNCTION_TEMPLATE(dtors_section, in_dtors, DTORS_SECTION_ASM_OP) \
261 SECTION_FUNCTION_TEMPLATE(sbss_section, in_sbss, SBSS_SECTION_ASM_OP) \
262 SECTION_FUNCTION_TEMPLATE(sdata_section, in_sdata, SDATA_SECTION_ASM_OP)
264 extern void ctors_section PARAMS ((void));
265 extern void dtors_section PARAMS ((void));
266 extern void sbss_section PARAMS ((void));
267 extern void sdata_section PARAMS ((void));
269 #undef READONLY_DATA_SECTION
270 #define READONLY_DATA_SECTION() const_section ()
272 #undef CONST_SECTION_FUNCTION
273 #define CONST_SECTION_FUNCTION \
277 if (!USE_CONST_SECTION) \
279 else if (in_section != in_const) \
281 fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
282 in_section = in_const; \
286 #undef SECTION_FUNCTION_TEMPLATE
287 #define SECTION_FUNCTION_TEMPLATE(FN, ENUM, OP) \
290 if (in_section != ENUM) \
292 fprintf (asm_out_file, "%s\n", OP); \
298 /* Switch into a generic section.
300 We make the section read-only and executable for a function decl,
301 read-only for a const data decl, and writable for a non-const data decl.
303 If the section has already been defined, we must not emit the
304 attributes here. The SVR4 assembler does not recognize section
305 redefinitions. If DECL is NULL, no attributes are emitted. */
307 #undef ASM_OUTPUT_SECTION_NAME
308 #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
311 static htab_t htab; \
313 struct section_info \
315 enum sect_enum {SECT_RW, SECT_RO, SECT_EXEC} type; \
318 struct section_info *s; \
320 enum sect_enum type; \
323 /* The names we put in the hashtable will always be the unique \
324 versions gived to us by the stringtable, so we can just use \
325 their addresses as the keys. */ \
327 htab = htab_create (31, \
332 if (DECL && TREE_CODE (DECL) == FUNCTION_DECL) \
333 type = SECT_EXEC, mode = "ax"; \
334 else if (DECL && DECL_READONLY_SECTION (DECL, RELOC)) \
335 type = SECT_RO, mode = "a"; \
337 type = SECT_RW, mode = "aw"; \
339 /* See if we already have an entry for this section. */ \
340 slot = htab_find_slot (htab, NAME, INSERT); \
343 s = (struct section_info *) xmalloc (sizeof (* s)); \
346 fprintf (FILE, "\t.section\t%s,\"%s\",@progbits\n", \
351 s = (struct section_info *) *slot; \
352 if (DECL && s->type != type) \
353 error_with_decl (DECL, \
354 "%s causes a section type conflict"); \
356 fprintf (FILE, "\t.section\t%s\n", NAME); \
361 /* A C statement (sans semicolon) to output an element in the table of
362 global constructors. */
363 #undef ASM_OUTPUT_CONSTRUCTOR
364 #define ASM_OUTPUT_CONSTRUCTOR(FILE, NAME) \
367 fprintf (FILE, "%s", INT_ASM_OP); \
368 assemble_name (FILE, NAME); \
369 fprintf (FILE, "\n"); \
372 /* A C statement (sans semicolon) to output an element in the table of
373 global destructors. */
374 #undef ASM_OUTPUT_DESTRUCTOR
375 #define ASM_OUTPUT_DESTRUCTOR(FILE, NAME) \
378 fprintf (FILE, "%s", INT_ASM_OP); \
379 assemble_name (FILE, NAME); \
380 fprintf (FILE, "\n"); \
383 /* A C statement or statements to switch to the appropriate
384 section for output of DECL. DECL is either a `VAR_DECL' node
385 or a constant of some sort. RELOC indicates whether forming
386 the initial value of DECL requires link-time relocations.
397 #define DO_SELECT_SECTION(SECNUM, DECL, RELOC) \
401 if (TREE_CODE (DECL) == FUNCTION_DECL) \
403 else if (TREE_CODE (DECL) == STRING_CST) \
405 if (flag_writable_strings) \
408 else if (TREE_CODE (DECL) == VAR_DECL) \
410 if (DECL_INITIAL (DECL) == NULL \
411 || DECL_INITIAL (DECL) == error_mark_node) \
413 else if ((flag_pic && RELOC) \
414 || ! TREE_READONLY (DECL) \
415 || TREE_SIDE_EFFECTS (DECL) \
416 || ! TREE_CONSTANT (DECL_INITIAL (DECL))) \
419 else if (TREE_CODE (DECL) == CONSTRUCTOR) \
421 if ((flag_pic && RELOC) \
422 || ! TREE_READONLY (DECL) \
423 || TREE_SIDE_EFFECTS (DECL) \
424 || ! TREE_CONSTANT (DECL)) \
428 /* Select small data sections based on size. */ \
431 int size = int_size_in_bytes (TREE_TYPE (DECL)); \
432 if (size >= 0 && size <= g_switch_value) \
438 #undef SELECT_SECTION
439 #define SELECT_SECTION(DECL, RELOC) \
442 typedef void (*sec_fn) PARAMS ((void)); \
443 static sec_fn const sec_functions[6] = \
455 DO_SELECT_SECTION (sec, DECL, RELOC); \
457 (*sec_functions[sec]) (); \
461 #define UNIQUE_SECTION_P(DECL) (DECL_ONE_ONLY (DECL))
463 #undef UNIQUE_SECTION
464 #define UNIQUE_SECTION(DECL, RELOC) \
467 static const char * const prefixes[6][2] = \
469 { ".text.", ".gnu.linkonce.t." }, \
470 { ".rodata.", ".gnu.linkonce.r." }, \
471 { ".data.", ".gnu.linkonce.d." }, \
472 { ".sdata.", ".gnu.linkonce.s." }, \
473 { ".bss.", ".gnu.linkonce.b." }, \
474 { ".sbss.", ".gnu.linkonce.sb." } \
477 int nlen, plen, sec; \
478 const char *name, *prefix; \
481 DO_SELECT_SECTION (sec, DECL, RELOC); \
483 name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
484 STRIP_NAME_ENCODING (name, name); \
485 nlen = strlen (name); \
487 prefix = prefixes[sec][DECL_ONE_ONLY(DECL)]; \
488 plen = strlen (prefix); \
490 string = alloca (nlen + plen + 1); \
492 memcpy (string, prefix, plen); \
493 memcpy (string + plen, name, nlen + 1); \
495 DECL_SECTION_NAME (DECL) = build_string (nlen + plen, string); \
499 /* A C statement or statements to switch to the appropriate
500 section for output of RTX in mode MODE. RTX is some kind
501 of constant in RTL. The argument MODE is redundant except
502 in the case of a `const_int' rtx. Currently, these always
503 go into the const section. */
505 #undef SELECT_RTX_SECTION
506 #define SELECT_RTX_SECTION(MODE, RTX) \
509 /* Define the strings used for the special svr4 .type and .size directives.
510 These strings generally do not vary from one system running svr4 to
511 another, but if a given system (e.g. m88k running svr) needs to use
512 different pseudo-op names for these, they may be overridden in the
513 file which includes this one. */
516 #define TYPE_ASM_OP "\t.type\t"
518 #define SIZE_ASM_OP "\t.size\t"
520 /* This is how we tell the assembler that a symbol is weak. */
522 #undef ASM_WEAKEN_LABEL
523 #define ASM_WEAKEN_LABEL(FILE, NAME) \
524 do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
525 fputc ('\n', FILE); } while (0)
527 /* This is how we tell the assembler that two symbols have the same value. */
529 #undef ASM_OUTPUT_DEF
530 #define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \
531 do { assemble_name(FILE, NAME1); \
532 fputs(" = ", FILE); \
533 assemble_name(FILE, NAME2); \
534 fputc('\n', FILE); } while (0)
536 /* The following macro defines the format used to output the second
537 operand of the .type assembler directive. Different svr4 assemblers
538 expect various different forms for this operand. The one given here
539 is just a default. You may need to override it in your machine-
540 specific tm.h file (depending upon the particulars of your assembler). */
542 #undef TYPE_OPERAND_FMT
543 #define TYPE_OPERAND_FMT "@%s"
545 /* Write the extra assembler code needed to declare a function's result.
546 Most svr4 assemblers don't require any special declaration of the
547 result value, but there are exceptions. */
549 #ifndef ASM_DECLARE_RESULT
550 #define ASM_DECLARE_RESULT(FILE, RESULT)
553 /* These macros generate the special .type and .size directives which
554 are used to set the corresponding fields of the linker symbol table
555 entries in an ELF object file under SVR4. These macros also output
556 the starting labels for the relevant functions/objects. */
558 /* Write the extra assembler code needed to declare an object properly. */
560 #undef ASM_DECLARE_OBJECT_NAME
561 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
563 HOST_WIDE_INT size; \
564 fprintf (FILE, "%s", TYPE_ASM_OP); \
565 assemble_name (FILE, NAME); \
567 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
569 size_directive_output = 0; \
570 if (!flag_inhibit_size_directive \
571 && DECL_SIZE (DECL) \
572 && (size = int_size_in_bytes (TREE_TYPE (DECL))) > 0) \
574 size_directive_output = 1; \
575 fprintf (FILE, "%s", SIZE_ASM_OP); \
576 assemble_name (FILE, NAME); \
578 fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, size); \
579 fputc ('\n', FILE); \
581 ASM_OUTPUT_LABEL(FILE, NAME); \
584 /* Output the size directive for a decl in rest_of_decl_compilation
585 in the case where we did not do so before the initializer.
586 Once we find the error_mark_node, we know that the value of
587 size_directive_output was set
588 by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
590 #undef ASM_FINISH_DECLARE_OBJECT
591 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
593 const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
594 HOST_WIDE_INT size; \
595 if (!flag_inhibit_size_directive \
596 && DECL_SIZE (DECL) \
597 && ! AT_END && TOP_LEVEL \
598 && DECL_INITIAL (DECL) == error_mark_node \
599 && !size_directive_output \
600 && (size = int_size_in_bytes (TREE_TYPE (DECL))) > 0) \
602 size_directive_output = 1; \
603 fprintf (FILE, "%s", SIZE_ASM_OP); \
604 assemble_name (FILE, name); \
606 fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, size); \
607 fputc ('\n', FILE); \
611 /* A table of bytes codes used by the ASM_OUTPUT_ASCII and
612 ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
613 corresponds to a particular byte value [0..255]. For any
614 given byte value, if the value in the corresponding table
615 position is zero, the given character can be output directly.
616 If the table value is 1, the byte must be output as a \ooo
617 octal escape. If the tables value is anything else, then the
618 byte value should be output as a \ followed by the value
619 in the table. Note that we can use standard UN*X escape
620 sequences for many control characters, but we don't use
621 \a to represent BEL because some svr4 assemblers (e.g. on
622 the i386) don't know about that. Also, we don't use \v
623 since some versions of gas, such as 2.2 did not accept it. */
627 "\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\
628 \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\
629 \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\
630 \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\
631 \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\
632 \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\
633 \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\
634 \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"
636 /* Some svr4 assemblers have a limit on the number of characters which
637 can appear in the operand of a .string directive. If your assembler
638 has such a limitation, you should define STRING_LIMIT to reflect that
639 limit. Note that at least some svr4 assemblers have a limit on the
640 actual number of bytes in the double-quoted string, and that they
641 count each character in an escape sequence as one byte. Thus, an
642 escape sequence like \377 would count as four bytes.
644 If your target assembler doesn't support the .string directive, you
645 should define this to zero. */
648 #define STRING_LIMIT ((unsigned) 256)
650 #define STRING_ASM_OP "\t.string\t"
652 /* GAS is the only Alpha/ELF assembler. */
654 #define TARGET_GAS (1)
656 /* Provide a STARTFILE_SPEC appropriate for ELF. Here we add the
657 (even more) magical crtbegin.o file which provides part of the
658 support for getting C++ file-scope static object constructed
659 before entering `main'.
661 Don't bother seeing crtstuff.c -- there is absolutely no hope
662 of getting that file to understand multiple GPs. We provide a
663 hand-coded assembly version. */
665 #undef STARTFILE_SPEC
666 #define STARTFILE_SPEC \
668 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\
669 crti.o%s %{shared:crtbeginS.o%s}%{!shared:crtbegin.o%s}"
671 /* Provide a ENDFILE_SPEC appropriate for ELF. Here we tack on the
672 magical crtend.o file which provides part of the support for
673 getting C++ file-scope static object constructed before entering
674 `main', followed by a normal ELF "finalizer" file, `crtn.o'. */
677 #define ENDFILE_SPEC \
678 "%{shared:crtendS.o%s}%{!shared:crtend.o%s} crtn.o%s"
680 /* We support #pragma. */
681 #define HANDLE_SYSV_PRAGMA
683 /* Undo the auto-alignment stuff from alpha.h. ELF has unaligned data
685 #undef UNALIGNED_SHORT_ASM_OP
686 #undef UNALIGNED_INT_ASM_OP
687 #undef UNALIGNED_DOUBLE_INT_ASM_OP
689 /* ??? This should be possible for ECOFF as well, since the relocations
690 exist. But the assembler doesn't seem to create them. */
691 /* Select a format to encode pointers in exception handling data. CODE
692 is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
693 true if the symbol may be affected by dynamic relocations.
695 Since application size is already constrained to <2GB by the form of
696 the ldgp relocation, we can use a 32-bit pc-relative relocation to
697 static data. Dynamic data is accessed indirectly to allow for read
699 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
700 (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4)