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).
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)
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
25 #define OBJECT_FORMAT_ELF
27 /* ??? Move all SDB stuff from alpha.h to osf.h. */
28 #undef SDB_DEBUGGING_INFO
30 #define DBX_DEBUGGING_INFO
31 #define DWARF2_DEBUGGING_INFO
33 #undef PREFERRED_DEBUGGING_TYPE
34 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
39 #define CC1_SPEC "%{G*}"
42 #define ASM_SPEC "%{G*} %{relax:-relax} %{!gstabs*:-no-mdebug}%{gstabs*:-mdebug}"
45 #define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
46 %{O*:-O3} %{!O*:-O1} \
50 %{rdynamic:-export-dynamic} \
51 %{!dynamic-linker:-dynamic-linker %(elf_dynamic_linker)}} \
54 /* Output at beginning of assembler file. */
56 #define ASM_FILE_START(FILE) \
58 if (write_symbols == DBX_DEBUG) \
60 alpha_write_verstamp (FILE); \
61 output_file_directive (FILE, main_input_filename); \
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) \
69 fprintf (FILE, "\t.arch %s\n", \
70 (TARGET_CPU_EV6 ? "ev6" \
71 : TARGET_MAX ? "pca56" : "ev56")); \
76 #define IDENT_ASM_OP "\t.ident\t"
78 /* Allow #sccs in preprocessor. */
79 #define SCCS_DIRECTIVE
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);
86 /* This is how to allocate empty space in some section. The .zero
87 pseudo-op is used for this on most svr4 assemblers. */
90 #define SKIP_ASM_OP "\t.zero\t"
92 #undef ASM_OUTPUT_SKIP
93 #define ASM_OUTPUT_SKIP(FILE, SIZE) \
94 fprintf (FILE, "%s%u\n", SKIP_ASM_OP, (SIZE))
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. */
105 #define ALIGN_ASM_OP "\t.align\t"
107 #ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
108 #define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE, PREFIX, NUM, TABLE) \
109 ASM_OUTPUT_ALIGN ((FILE), 2);
112 #undef ASM_OUTPUT_CASE_LABEL
113 #define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE) \
115 ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
116 ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
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. */
123 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
124 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
125 ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
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. */
133 #define COMMON_ASM_OP "\t.comm\t"
135 #undef ASM_OUTPUT_ALIGNED_COMMON
136 #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
138 fprintf ((FILE), "%s", COMMON_ASM_OP); \
139 assemble_name ((FILE), (NAME)); \
140 fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
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. */
148 #undef ASM_OUTPUT_ALIGNED_LOCAL
149 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
151 if ((SIZE) <= g_switch_value) \
155 fprintf (FILE, "%s", TYPE_ASM_OP); \
156 assemble_name (FILE, NAME); \
158 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
160 if (!flag_inhibit_size_directive) \
162 fprintf (FILE, "%s", SIZE_ASM_OP); \
163 assemble_name (FILE, NAME); \
164 fprintf (FILE, ",%d\n", (SIZE)); \
166 ASM_OUTPUT_ALIGN ((FILE), exact_log2((ALIGN) / BITS_PER_UNIT)); \
167 ASM_OUTPUT_LABEL(FILE, NAME); \
168 ASM_OUTPUT_SKIP((FILE), (SIZE)); \
171 /* This says how to output assembler code to declare an
172 uninitialized external linkage data object. */
174 #undef ASM_OUTPUT_ALIGNED_BSS
175 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
177 ASM_GLOBALIZE_LABEL (FILE, NAME); \
178 ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \
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'.
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. */
190 #undef MAX_OFILE_ALIGNMENT
191 #define MAX_OFILE_ALIGNMENT \
192 (1 << (HOST_BITS_PER_INT < 64 ? HOST_BITS_PER_INT - 2 : 62))
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. */
198 #undef ASCII_DATA_ASM_OP
199 #define ASCII_DATA_ASM_OP "\t.ascii\t"
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. */
209 #undef USE_CONST_SECTION
210 #define USE_CONST_SECTION 1
212 #undef CONST_SECTION_ASM_OP
213 #define CONST_SECTION_ASM_OP "\t.section\t.rodata"
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\""
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. */
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"
233 #ifdef HAVE_GAS_SUBSECTION_ORDERING
235 #define ASM_SECTION_START_OP "\t.subsection\t-1"
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)
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. */
248 #undef EXTRA_SECTIONS
249 #define EXTRA_SECTIONS in_const, in_sbss, in_sdata
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. */
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)
261 extern void sbss_section
PARAMS ((void));
262 extern void sdata_section
PARAMS ((void));
264 #undef READONLY_DATA_SECTION
265 #define READONLY_DATA_SECTION() const_section ()
267 #undef CONST_SECTION_FUNCTION
268 #define CONST_SECTION_FUNCTION \
272 if (!USE_CONST_SECTION) \
274 else if (in_section != in_const) \
276 fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
277 in_section = in_const; \
281 #undef SECTION_FUNCTION_TEMPLATE
282 #define SECTION_FUNCTION_TEMPLATE(FN, ENUM, OP) \
285 if (in_section != ENUM) \
287 fprintf (asm_out_file, "%s\n", OP); \
292 /* Switch into a generic section. */
293 #define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
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.
309 #define DO_SELECT_SECTION(SECNUM, DECL, RELOC) \
312 HOST_WIDE_INT size; \
314 if (TREE_CODE (DECL) == FUNCTION_DECL) \
319 else if (TREE_CODE (DECL) == STRING_CST) \
321 if (flag_writable_strings) \
327 else if (TREE_CODE (DECL) == VAR_DECL) \
329 if (DECL_INITIAL (DECL) == NULL \
330 || DECL_INITIAL (DECL) == error_mark_node) \
332 else if ((flag_pic && RELOC) \
333 || ! TREE_READONLY (DECL) \
334 || TREE_SIDE_EFFECTS (DECL) \
335 || ! TREE_CONSTANT (DECL_INITIAL (DECL))) \
337 else if (flag_merge_constants >= 2) \
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 \
343 if (TREE_CODE (DECL_INITIAL (DECL)) == STRING_CST)\
349 else if (TREE_CODE (DECL) == CONSTRUCTOR) \
351 if ((flag_pic && RELOC) \
352 || TREE_SIDE_EFFECTS (DECL) \
353 || ! TREE_CONSTANT (DECL)) \
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) \
361 if ((SECNUM & 0xff) >= 2) \
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) \
372 #undef SELECT_SECTION
373 #define SELECT_SECTION(DECL, RELOC, ALIGN) \
376 typedef void (*sec_fn) PARAMS ((void)); \
377 static sec_fn const sec_functions[6] = \
389 DO_SELECT_SECTION (sec, DECL, RELOC); \
394 mergeable_string_section (DECL, ALIGN, 0); \
397 mergeable_string_section (DECL_INITIAL (DECL),\
401 mergeable_constant_section (DECL_MODE (DECL), \
405 (*sec_functions[sec]) (); \
411 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
413 #undef UNIQUE_SECTION
414 #define UNIQUE_SECTION(DECL, RELOC) \
417 static const char * const prefixes[6][2] = \
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." } \
427 int nlen, plen, sec; \
428 const char *name, *prefix; \
431 DO_SELECT_SECTION (sec, DECL, RELOC); \
433 name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
434 STRIP_NAME_ENCODING (name, name); \
435 nlen = strlen (name); \
437 prefix = prefixes[sec & 0xff][DECL_ONE_ONLY(DECL)]; \
438 plen = strlen (prefix); \
440 string = alloca (nlen + plen + 1); \
442 memcpy (string, prefix, plen); \
443 memcpy (string + plen, name, nlen + 1); \
445 DECL_SECTION_NAME (DECL) = build_string (nlen + plen, string); \
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. */
455 #undef SELECT_RTX_SECTION
456 #define SELECT_RTX_SECTION(MODE, RTX, ALIGN) \
458 if (TARGET_SMALL_DATA && GET_MODE_SIZE (MODE) <= g_switch_value) \
459 /* ??? Consider .sdata.{lit4,lit8} as SHF_MERGE|SHF_ALPHA_GPREL. */ \
462 mergeable_constant_section((MODE), (ALIGN), 0); \
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. */
472 #define TYPE_ASM_OP "\t.type\t"
474 #define SIZE_ASM_OP "\t.size\t"
476 /* This is how we tell the assembler that a symbol is weak. */
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)
483 /* This is how we tell the assembler that two symbols have the same value. */
485 #undef ASM_OUTPUT_DEF
486 #define ASM_OUTPUT_DEF(FILE, ALIAS, NAME) \
488 assemble_name(FILE, ALIAS); \
489 fputs(" = ", FILE); \
490 assemble_name(FILE, NAME); \
494 #undef ASM_OUTPUT_DEF_FROM_DECLS
495 #define ASM_OUTPUT_DEF_FROM_DECLS(FILE, DECL, TARGET) \
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) \
502 assemble_name (FILE, alias); \
503 fputs ("..ng = $", FILE); \
504 assemble_name (FILE, name); \
505 fputs ("..ng\n", FILE); \
507 assemble_name(FILE, alias); \
508 fputs(" = ", FILE); \
509 assemble_name(FILE, name); \
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). */
519 #undef TYPE_OPERAND_FMT
520 #define TYPE_OPERAND_FMT "@%s"
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. */
526 #ifndef ASM_DECLARE_RESULT
527 #define ASM_DECLARE_RESULT(FILE, RESULT)
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. */
535 /* Write the extra assembler code needed to declare an object properly. */
537 #undef ASM_DECLARE_OBJECT_NAME
538 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
540 HOST_WIDE_INT size; \
541 fprintf (FILE, "%s", TYPE_ASM_OP); \
542 assemble_name (FILE, NAME); \
544 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
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) \
551 size_directive_output = 1; \
552 fprintf (FILE, "%s", SIZE_ASM_OP); \
553 assemble_name (FILE, NAME); \
555 fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, size); \
556 fputc ('\n', FILE); \
558 ASM_OUTPUT_LABEL(FILE, NAME); \
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. */
567 #undef ASM_FINISH_DECLARE_OBJECT
568 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
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) \
579 size_directive_output = 1; \
580 fprintf (FILE, "%s", SIZE_ASM_OP); \
581 assemble_name (FILE, name); \
583 fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, size); \
584 fputc ('\n', FILE); \
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. */
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"
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.
621 If your target assembler doesn't support the .string directive, you
622 should define this to zero. */
625 #define STRING_LIMIT ((unsigned) 256)
627 #define STRING_ASM_OP "\t.string\t"
629 /* GAS is the only Alpha/ELF assembler. */
631 #define TARGET_GAS (1)
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'. */
638 #undef STARTFILE_SPEC
639 #define STARTFILE_SPEC \
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}}"
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'. */
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"
655 /* We support #pragma. */
656 #define HANDLE_SYSV_PRAGMA
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.
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
666 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
667 (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4)
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
;
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
682 #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
683 asm (SECTION_OP "\n" \
685 "1: ldgp $29,0($29)\n" \
687 " jsr $26," USER_LABEL_PREFIX #FUNC "\n" \
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} "