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
38 #undef CPP_SUBTARGET_SPEC
39 #define CPP_SUBTARGET_SPEC "-D__ELF__"
42 #define CC1_SPEC "%{G*}"
45 #define ASM_SPEC "%{G*} %{relax:-relax} %{!gstabs*:-no-mdebug}%{gstabs*:-mdebug}"
47 /* Output at beginning of assembler file. */
49 #define ASM_FILE_START(FILE) \
51 if (write_symbols == DBX_DEBUG) \
53 alpha_write_verstamp (FILE); \
54 output_file_directive (FILE, main_input_filename); \
56 fprintf (FILE, "\t.set noat\n"); \
57 fprintf (FILE, "\t.set noreorder\n"); \
58 if (TARGET_EXPLICIT_RELOCS) \
59 fprintf (FILE, "\t.set nomacro\n"); \
60 if (TARGET_BWX | TARGET_MAX | TARGET_FIX | TARGET_CIX) \
62 fprintf (FILE, "\t.arch %s\n", \
63 (TARGET_CPU_EV6 ? "ev6" \
64 : TARGET_MAX ? "pca56" : "ev56")); \
69 #define IDENT_ASM_OP "\t.ident\t"
71 /* Allow #sccs in preprocessor. */
72 #define SCCS_DIRECTIVE
74 /* Output #ident as a .ident. */
75 #undef ASM_OUTPUT_IDENT
76 #define ASM_OUTPUT_IDENT(FILE, NAME) \
77 fprintf (FILE, "%s\"%s\"\n", IDENT_ASM_OP, NAME);
79 /* This is how to allocate empty space in some section. The .zero
80 pseudo-op is used for this on most svr4 assemblers. */
83 #define SKIP_ASM_OP "\t.zero\t"
85 #undef ASM_OUTPUT_SKIP
86 #define ASM_OUTPUT_SKIP(FILE, SIZE) \
87 fprintf (FILE, "%s%u\n", SKIP_ASM_OP, (SIZE))
89 /* Output the label which precedes a jumptable. Note that for all svr4
90 systems where we actually generate jumptables (which is to say every
91 svr4 target except i386, where we use casesi instead) we put the jump-
92 tables into the .rodata section and since other stuff could have been
93 put into the .rodata section prior to any given jumptable, we have to
94 make sure that the location counter for the .rodata section gets pro-
95 perly re-aligned prior to the actual beginning of the jump table. */
98 #define ALIGN_ASM_OP "\t.align\t"
100 #ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
101 #define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE, PREFIX, NUM, TABLE) \
102 ASM_OUTPUT_ALIGN ((FILE), 2);
105 #undef ASM_OUTPUT_CASE_LABEL
106 #define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE) \
108 ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
109 ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
112 /* The standard SVR4 assembler seems to require that certain builtin
113 library routines (e.g. .udiv) be explicitly declared as .globl
114 in each assembly file where they are referenced. */
116 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
117 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
118 ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
120 /* This says how to output assembler code to declare an
121 uninitialized external linkage data object. Under SVR4,
122 the linker seems to want the alignment of data objects
123 to depend on their types. We do exactly that here. */
126 #define COMMON_ASM_OP "\t.comm\t"
128 #undef ASM_OUTPUT_ALIGNED_COMMON
129 #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
131 fprintf ((FILE), "%s", COMMON_ASM_OP); \
132 assemble_name ((FILE), (NAME)); \
133 fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
136 /* This says how to output assembler code to declare an
137 uninitialized internal linkage data object. Under SVR4,
138 the linker seems to want the alignment of data objects
139 to depend on their types. We do exactly that here. */
141 #undef ASM_OUTPUT_ALIGNED_LOCAL
142 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
144 if ((SIZE) <= g_switch_value) \
148 fprintf (FILE, "%s", TYPE_ASM_OP); \
149 assemble_name (FILE, NAME); \
151 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
153 if (!flag_inhibit_size_directive) \
155 fprintf (FILE, "%s", SIZE_ASM_OP); \
156 assemble_name (FILE, NAME); \
157 fprintf (FILE, ",%d\n", (SIZE)); \
159 ASM_OUTPUT_ALIGN ((FILE), exact_log2((ALIGN) / BITS_PER_UNIT)); \
160 ASM_OUTPUT_LABEL(FILE, NAME); \
161 ASM_OUTPUT_SKIP((FILE), (SIZE)); \
164 /* This says how to output assembler code to declare an
165 uninitialized external linkage data object. */
167 #undef ASM_OUTPUT_ALIGNED_BSS
168 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
170 ASM_GLOBALIZE_LABEL (FILE, NAME); \
171 ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \
174 /* Biggest alignment supported by the object file format of this
175 machine. Use this macro to limit the alignment which can be
176 specified using the `__attribute__ ((aligned (N)))' construct. If
177 not defined, the default value is `BIGGEST_ALIGNMENT'.
179 This value is really 2^63. Since gcc figures the alignment in bits,
180 we could only potentially get to 2^60 on suitible hosts. Due to other
181 considerations in varasm, we must restrict this to what fits in an int. */
183 #undef MAX_OFILE_ALIGNMENT
184 #define MAX_OFILE_ALIGNMENT \
185 (1 << (HOST_BITS_PER_INT < 64 ? HOST_BITS_PER_INT - 2 : 62))
187 /* This is the pseudo-op used to generate a contiguous sequence of byte
188 values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
189 AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
191 #undef ASCII_DATA_ASM_OP
192 #define ASCII_DATA_ASM_OP "\t.ascii\t"
194 /* Support const sections and the ctors and dtors sections for g++.
195 Note that there appears to be two different ways to support const
196 sections at the moment. You can either #define the symbol
197 READONLY_DATA_SECTION (giving it some code which switches to the
198 readonly data section) or else you can #define the symbols
199 EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
200 SELECT_RTX_SECTION. We do both here just to be on the safe side. */
202 #undef USE_CONST_SECTION
203 #define USE_CONST_SECTION 1
205 #undef CONST_SECTION_ASM_OP
206 #define CONST_SECTION_ASM_OP "\t.section\t.rodata"
208 #undef BSS_SECTION_ASM_OP
209 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
210 #undef SBSS_SECTION_ASM_OP
211 #define SBSS_SECTION_ASM_OP "\t.section\t.sbss,\"aw\""
212 #undef SDATA_SECTION_ASM_OP
213 #define SDATA_SECTION_ASM_OP "\t.section\t.sdata,\"aw\""
215 /* On svr4, we *do* have support for the .init and .fini sections, and we
216 can put stuff in there to be executed before and after `main'. We let
217 crtstuff.c and other files know this by defining the following symbols.
218 The definitions say how to change sections to the .init and .fini
219 sections. This is the same for all known svr4 assemblers. */
221 #undef INIT_SECTION_ASM_OP
222 #define INIT_SECTION_ASM_OP "\t.section\t.init"
223 #undef FINI_SECTION_ASM_OP
224 #define FINI_SECTION_ASM_OP "\t.section\t.fini"
226 #ifdef HAVE_GAS_SUBSECTION_ORDERING
228 #define ASM_SECTION_START_OP "\t.subsection\t-1"
230 /* Output assembly directive to move to the beginning of current section. */
231 #define ASM_OUTPUT_SECTION_START(FILE) \
232 fprintf ((FILE), "%s\n", ASM_SECTION_START_OP)
236 /* A default list of other sections which we might be "in" at any given
237 time. For targets that use additional sections (e.g. .tdesc) you
238 should override this definition in the target-specific file which
239 includes this file. */
241 #undef EXTRA_SECTIONS
242 #define EXTRA_SECTIONS in_const, in_sbss, in_sdata
244 /* A default list of extra section function definitions. For targets
245 that use additional sections (e.g. .tdesc) you should override this
246 definition in the target-specific file which includes this file. */
248 #undef EXTRA_SECTION_FUNCTIONS
249 #define EXTRA_SECTION_FUNCTIONS \
250 CONST_SECTION_FUNCTION \
251 SECTION_FUNCTION_TEMPLATE(sbss_section, in_sbss, SBSS_SECTION_ASM_OP) \
252 SECTION_FUNCTION_TEMPLATE(sdata_section, in_sdata, SDATA_SECTION_ASM_OP)
254 extern void sbss_section PARAMS ((void));
255 extern void sdata_section PARAMS ((void));
257 #undef READONLY_DATA_SECTION
258 #define READONLY_DATA_SECTION() const_section ()
260 #undef CONST_SECTION_FUNCTION
261 #define CONST_SECTION_FUNCTION \
265 if (!USE_CONST_SECTION) \
267 else if (in_section != in_const) \
269 fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
270 in_section = in_const; \
274 #undef SECTION_FUNCTION_TEMPLATE
275 #define SECTION_FUNCTION_TEMPLATE(FN, ENUM, OP) \
278 if (in_section != ENUM) \
280 fprintf (asm_out_file, "%s\n", OP); \
285 /* Switch into a generic section. */
286 #define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
288 /* A C statement or statements to switch to the appropriate
289 section for output of DECL. DECL is either a `VAR_DECL' node
290 or a constant of some sort. RELOC indicates whether forming
291 the initial value of DECL requires link-time relocations.
302 #define DO_SELECT_SECTION(SECNUM, DECL, RELOC) \
305 HOST_WIDE_INT size; \
307 if (TREE_CODE (DECL) == FUNCTION_DECL) \
312 else if (TREE_CODE (DECL) == STRING_CST) \
314 if (flag_writable_strings) \
320 else if (TREE_CODE (DECL) == VAR_DECL) \
322 if (DECL_INITIAL (DECL) == NULL \
323 || DECL_INITIAL (DECL) == error_mark_node) \
325 else if ((flag_pic && RELOC) \
326 || ! TREE_READONLY (DECL) \
327 || TREE_SIDE_EFFECTS (DECL) \
328 || ! TREE_CONSTANT (DECL_INITIAL (DECL))) \
330 else if (flag_merge_constants >= 2) \
332 /* C and C++ don't allow different variables to \
333 share the same location. -fmerge-all-constants\
334 allows even that (at the expense of not \
336 if (TREE_CODE (DECL_INITIAL (DECL)) == STRING_CST)\
342 else if (TREE_CODE (DECL) == CONSTRUCTOR) \
344 if ((flag_pic && RELOC) \
345 || TREE_SIDE_EFFECTS (DECL) \
346 || ! TREE_CONSTANT (DECL)) \
350 /* Select small data sections based on size. */ \
351 size = int_size_in_bytes (TREE_TYPE (DECL)); \
352 if (size >= 0 && size <= g_switch_value) \
354 if ((SECNUM & 0xff) >= 2) \
356 /* Move readonly data to .sdata only if -msmall-data. */ \
357 /* ??? Consider .sdata.{lit4,lit8} as \
358 SHF_MERGE|SHF_ALPHA_GPREL. */ \
359 else if (TARGET_SMALL_DATA) \
365 #undef SELECT_SECTION
366 #define SELECT_SECTION(DECL, RELOC, ALIGN) \
369 typedef void (*sec_fn) PARAMS ((void)); \
370 static sec_fn const sec_functions[6] = \
382 DO_SELECT_SECTION (sec, DECL, RELOC); \
387 mergeable_string_section (DECL, ALIGN, 0); \
390 mergeable_string_section (DECL_INITIAL (DECL),\
394 mergeable_constant_section (DECL_MODE (DECL), \
398 (*sec_functions[sec]) (); \
404 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
406 #undef UNIQUE_SECTION
407 #define UNIQUE_SECTION(DECL, RELOC) \
410 static const char * const prefixes[6][2] = \
412 { ".text.", ".gnu.linkonce.t." }, \
413 { ".rodata.", ".gnu.linkonce.r." }, \
414 { ".data.", ".gnu.linkonce.d." }, \
415 { ".sdata.", ".gnu.linkonce.s." }, \
416 { ".bss.", ".gnu.linkonce.b." }, \
417 { ".sbss.", ".gnu.linkonce.sb." } \
420 int nlen, plen, sec; \
421 const char *name, *prefix; \
424 DO_SELECT_SECTION (sec, DECL, RELOC); \
426 name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
427 STRIP_NAME_ENCODING (name, name); \
428 nlen = strlen (name); \
430 prefix = prefixes[sec & 0xff][DECL_ONE_ONLY(DECL)]; \
431 plen = strlen (prefix); \
433 string = alloca (nlen + plen + 1); \
435 memcpy (string, prefix, plen); \
436 memcpy (string + plen, name, nlen + 1); \
438 DECL_SECTION_NAME (DECL) = build_string (nlen + plen, string); \
442 /* A C statement or statements to switch to the appropriate
443 section for output of RTX in mode MODE. RTX is some kind
444 of constant in RTL. The argument MODE is redundant except
445 in the case of a `const_int' rtx. Currently, these always
446 go into the const section. */
448 #undef SELECT_RTX_SECTION
449 #define SELECT_RTX_SECTION(MODE, RTX, ALIGN) \
451 if (TARGET_SMALL_DATA && GET_MODE_SIZE (MODE) <= g_switch_value) \
452 /* ??? Consider .sdata.{lit4,lit8} as SHF_MERGE|SHF_ALPHA_GPREL. */ \
455 mergeable_constant_section((MODE), (ALIGN), 0); \
458 /* Define the strings used for the special svr4 .type and .size directives.
459 These strings generally do not vary from one system running svr4 to
460 another, but if a given system (e.g. m88k running svr) needs to use
461 different pseudo-op names for these, they may be overridden in the
462 file which includes this one. */
465 #define TYPE_ASM_OP "\t.type\t"
467 #define SIZE_ASM_OP "\t.size\t"
469 /* This is how we tell the assembler that a symbol is weak. */
471 #undef ASM_WEAKEN_LABEL
472 #define ASM_WEAKEN_LABEL(FILE, NAME) \
473 do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
474 fputc ('\n', FILE); } while (0)
476 /* This is how we tell the assembler that two symbols have the same value. */
478 #undef ASM_OUTPUT_DEF
479 #define ASM_OUTPUT_DEF(FILE, ALIAS, NAME) \
481 assemble_name(FILE, ALIAS); \
482 fputs(" = ", FILE); \
483 assemble_name(FILE, NAME); \
487 #undef ASM_OUTPUT_DEF_FROM_DECLS
488 #define ASM_OUTPUT_DEF_FROM_DECLS(FILE, DECL, TARGET) \
490 const char *alias = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
491 const char *name = IDENTIFIER_POINTER (TARGET); \
492 if (TREE_CODE (DECL) == FUNCTION_DECL) \
495 assemble_name (FILE, alias); \
496 fputs ("..ng = $", FILE); \
497 assemble_name (FILE, name); \
498 fputs ("..ng\n", FILE); \
500 assemble_name(FILE, alias); \
501 fputs(" = ", FILE); \
502 assemble_name(FILE, name); \
506 /* The following macro defines the format used to output the second
507 operand of the .type assembler directive. Different svr4 assemblers
508 expect various different forms for this operand. The one given here
509 is just a default. You may need to override it in your machine-
510 specific tm.h file (depending upon the particulars of your assembler). */
512 #undef TYPE_OPERAND_FMT
513 #define TYPE_OPERAND_FMT "@%s"
515 /* Write the extra assembler code needed to declare a function's result.
516 Most svr4 assemblers don't require any special declaration of the
517 result value, but there are exceptions. */
519 #ifndef ASM_DECLARE_RESULT
520 #define ASM_DECLARE_RESULT(FILE, RESULT)
523 /* These macros generate the special .type and .size directives which
524 are used to set the corresponding fields of the linker symbol table
525 entries in an ELF object file under SVR4. These macros also output
526 the starting labels for the relevant functions/objects. */
528 /* Write the extra assembler code needed to declare an object properly. */
530 #undef ASM_DECLARE_OBJECT_NAME
531 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
533 HOST_WIDE_INT size; \
534 fprintf (FILE, "%s", TYPE_ASM_OP); \
535 assemble_name (FILE, NAME); \
537 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
539 size_directive_output = 0; \
540 if (!flag_inhibit_size_directive \
541 && DECL_SIZE (DECL) \
542 && (size = int_size_in_bytes (TREE_TYPE (DECL))) > 0) \
544 size_directive_output = 1; \
545 fprintf (FILE, "%s", SIZE_ASM_OP); \
546 assemble_name (FILE, NAME); \
548 fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, size); \
549 fputc ('\n', FILE); \
551 ASM_OUTPUT_LABEL(FILE, NAME); \
554 /* Output the size directive for a decl in rest_of_decl_compilation
555 in the case where we did not do so before the initializer.
556 Once we find the error_mark_node, we know that the value of
557 size_directive_output was set
558 by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
560 #undef ASM_FINISH_DECLARE_OBJECT
561 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
563 const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
564 HOST_WIDE_INT size; \
565 if (!flag_inhibit_size_directive \
566 && DECL_SIZE (DECL) \
567 && ! AT_END && TOP_LEVEL \
568 && DECL_INITIAL (DECL) == error_mark_node \
569 && !size_directive_output \
570 && (size = int_size_in_bytes (TREE_TYPE (DECL))) > 0) \
572 size_directive_output = 1; \
573 fprintf (FILE, "%s", SIZE_ASM_OP); \
574 assemble_name (FILE, name); \
576 fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, size); \
577 fputc ('\n', FILE); \
581 /* A table of bytes codes used by the ASM_OUTPUT_ASCII and
582 ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
583 corresponds to a particular byte value [0..255]. For any
584 given byte value, if the value in the corresponding table
585 position is zero, the given character can be output directly.
586 If the table value is 1, the byte must be output as a \ooo
587 octal escape. If the tables value is anything else, then the
588 byte value should be output as a \ followed by the value
589 in the table. Note that we can use standard UN*X escape
590 sequences for many control characters, but we don't use
591 \a to represent BEL because some svr4 assemblers (e.g. on
592 the i386) don't know about that. Also, we don't use \v
593 since some versions of gas, such as 2.2 did not accept it. */
597 "\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\
598 \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\
599 \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\
600 \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\
601 \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\
602 \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\
603 \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\
604 \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"
606 /* Some svr4 assemblers have a limit on the number of characters which
607 can appear in the operand of a .string directive. If your assembler
608 has such a limitation, you should define STRING_LIMIT to reflect that
609 limit. Note that at least some svr4 assemblers have a limit on the
610 actual number of bytes in the double-quoted string, and that they
611 count each character in an escape sequence as one byte. Thus, an
612 escape sequence like \377 would count as four bytes.
614 If your target assembler doesn't support the .string directive, you
615 should define this to zero. */
618 #define STRING_LIMIT ((unsigned) 256)
620 #define STRING_ASM_OP "\t.string\t"
622 /* GAS is the only Alpha/ELF assembler. */
624 #define TARGET_GAS (1)
626 /* Provide a STARTFILE_SPEC appropriate for ELF. Here we add the
627 (even more) magical crtbegin.o file which provides part of the
628 support for getting C++ file-scope static object constructed
629 before entering `main'. */
631 #undef STARTFILE_SPEC
632 #define STARTFILE_SPEC \
634 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\
635 crti.o%s %{static:crtbeginT.o%s}\
636 %{!static:%{shared:crtbeginS.o%s}%{!shared:crtbegin.o%s}}"
638 /* Provide a ENDFILE_SPEC appropriate for ELF. Here we tack on the
639 magical crtend.o file which provides part of the support for
640 getting C++ file-scope static object constructed before entering
641 `main', followed by a normal ELF "finalizer" file, `crtn.o'. */
644 #define ENDFILE_SPEC \
645 "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
646 %{shared:crtendS.o%s}%{!shared:crtend.o%s} crtn.o%s"
648 /* We support #pragma. */
649 #define HANDLE_SYSV_PRAGMA
651 /* Select a format to encode pointers in exception handling data. CODE
652 is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
653 true if the symbol may be affected by dynamic relocations.
655 Since application size is already constrained to <2GB by the form of
656 the ldgp relocation, we can use a 32-bit pc-relative relocation to
657 static data. Dynamic data is accessed indirectly to allow for read
659 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
660 (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4)
662 /* If defined, a C statement to be executed just prior to the output of
663 assembler code for INSN. */
664 #define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS) \
665 (alpha_this_literal_sequence_number = 0, \
666 alpha_this_gpdisp_sequence_number = 0)
667 extern int alpha_this_literal_sequence_number;
668 extern int alpha_this_gpdisp_sequence_number;
670 /* Since the bits of the _init and _fini function is spread across
671 many object files, each potentially with its own GP, we must assume
672 we need to load our GP. Further, the .init/.fini section can
673 easily be more than 4MB away from the function to call so we can't
675 #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
676 asm (SECTION_OP "\n" \
678 "1: ldgp $29,0($29)\n" \
680 " jsr $26," USER_LABEL_PREFIX #FUNC "\n" \
684 /* If we have the capability create headers for efficient EH lookup.
685 As of Jan 2002, only glibc 2.2.4 can actually make use of this, but
686 I imagine that other systems will catch up. In the meantime, it
687 doesn't harm to make sure that the data exists to be used later. */
688 #if defined(HAVE_LD_EH_FRAME_HDR)
689 #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "