1*404b540aSrobert /* Definitions of target machine for GNU compiler, for DEC Alpha w/ELF. 2*404b540aSrobert Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 3*404b540aSrobert Free Software Foundation, Inc. 4*404b540aSrobert Contributed by Richard Henderson (rth@tamu.edu). 5*404b540aSrobert 6*404b540aSrobert This file is part of GCC. 7*404b540aSrobert 8*404b540aSrobert GCC is free software; you can redistribute it and/or modify 9*404b540aSrobert it under the terms of the GNU General Public License as published by 10*404b540aSrobert the Free Software Foundation; either version 2, or (at your option) 11*404b540aSrobert any later version. 12*404b540aSrobert 13*404b540aSrobert GCC is distributed in the hope that it will be useful, 14*404b540aSrobert but WITHOUT ANY WARRANTY; without even the implied warranty of 15*404b540aSrobert MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16*404b540aSrobert GNU General Public License for more details. 17*404b540aSrobert 18*404b540aSrobert You should have received a copy of the GNU General Public License 19*404b540aSrobert along with GCC; see the file COPYING. If not, write to 20*404b540aSrobert the Free Software Foundation, 51 Franklin Street, Fifth Floor, 21*404b540aSrobert Boston, MA 02110-1301, USA. */ 22*404b540aSrobert 23*404b540aSrobert #undef OBJECT_FORMAT_COFF 24*404b540aSrobert #undef EXTENDED_COFF 25*404b540aSrobert #define OBJECT_FORMAT_ELF 26*404b540aSrobert 27*404b540aSrobert /* ??? Move all SDB stuff from alpha.h to osf.h. */ 28*404b540aSrobert #undef SDB_DEBUGGING_INFO 29*404b540aSrobert 30*404b540aSrobert #define DBX_DEBUGGING_INFO 1 31*404b540aSrobert #define DWARF2_DEBUGGING_INFO 1 32*404b540aSrobert 33*404b540aSrobert #undef PREFERRED_DEBUGGING_TYPE 34*404b540aSrobert #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG 35*404b540aSrobert 36*404b540aSrobert #undef ASM_FINAL_SPEC 37*404b540aSrobert 38*404b540aSrobert /* alpha/ doesn't use elfos.h for some reason. */ 39*404b540aSrobert #define TARGET_OBJFMT_CPP_BUILTINS() \ 40*404b540aSrobert do \ 41*404b540aSrobert { \ 42*404b540aSrobert builtin_define ("__ELF__"); \ 43*404b540aSrobert } \ 44*404b540aSrobert while (0) 45*404b540aSrobert 46*404b540aSrobert #undef CC1_SPEC 47*404b540aSrobert #define CC1_SPEC "%{G*}" 48*404b540aSrobert 49*404b540aSrobert #undef ASM_SPEC 50*404b540aSrobert #define ASM_SPEC "%{G*} %{relax:-relax} %{!gstabs*:-no-mdebug}%{gstabs*:-mdebug}" 51*404b540aSrobert 52*404b540aSrobert #undef IDENT_ASM_OP 53*404b540aSrobert #define IDENT_ASM_OP "\t.ident\t" 54*404b540aSrobert 55*404b540aSrobert /* Output #ident as a .ident. */ 56*404b540aSrobert #undef ASM_OUTPUT_IDENT 57*404b540aSrobert #define ASM_OUTPUT_IDENT(FILE, NAME) \ 58*404b540aSrobert fprintf (FILE, "%s\"%s\"\n", IDENT_ASM_OP, NAME); 59*404b540aSrobert 60*404b540aSrobert /* This is how to allocate empty space in some section. The .zero 61*404b540aSrobert pseudo-op is used for this on most svr4 assemblers. */ 62*404b540aSrobert 63*404b540aSrobert #undef SKIP_ASM_OP 64*404b540aSrobert #define SKIP_ASM_OP "\t.zero\t" 65*404b540aSrobert 66*404b540aSrobert #undef ASM_OUTPUT_SKIP 67*404b540aSrobert #define ASM_OUTPUT_SKIP(FILE, SIZE) \ 68*404b540aSrobert fprintf (FILE, "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n", SKIP_ASM_OP, (SIZE)) 69*404b540aSrobert 70*404b540aSrobert /* Output the label which precedes a jumptable. Note that for all svr4 71*404b540aSrobert systems where we actually generate jumptables (which is to say every 72*404b540aSrobert svr4 target except i386, where we use casesi instead) we put the jump- 73*404b540aSrobert tables into the .rodata section and since other stuff could have been 74*404b540aSrobert put into the .rodata section prior to any given jumptable, we have to 75*404b540aSrobert make sure that the location counter for the .rodata section gets pro- 76*404b540aSrobert perly re-aligned prior to the actual beginning of the jump table. */ 77*404b540aSrobert 78*404b540aSrobert #undef ALIGN_ASM_OP 79*404b540aSrobert #define ALIGN_ASM_OP "\t.align\t" 80*404b540aSrobert 81*404b540aSrobert #ifndef ASM_OUTPUT_BEFORE_CASE_LABEL 82*404b540aSrobert #define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE, PREFIX, NUM, TABLE) \ 83*404b540aSrobert ASM_OUTPUT_ALIGN ((FILE), 2); 84*404b540aSrobert #endif 85*404b540aSrobert 86*404b540aSrobert #undef ASM_OUTPUT_CASE_LABEL 87*404b540aSrobert #define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE) \ 88*404b540aSrobert do { \ 89*404b540aSrobert ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \ 90*404b540aSrobert (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM); \ 91*404b540aSrobert } while (0) 92*404b540aSrobert 93*404b540aSrobert /* The standard SVR4 assembler seems to require that certain builtin 94*404b540aSrobert library routines (e.g. .udiv) be explicitly declared as .globl 95*404b540aSrobert in each assembly file where they are referenced. */ 96*404b540aSrobert 97*404b540aSrobert #undef ASM_OUTPUT_EXTERNAL_LIBCALL 98*404b540aSrobert #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \ 99*404b540aSrobert (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0)) 100*404b540aSrobert 101*404b540aSrobert /* This says how to output assembler code to declare an 102*404b540aSrobert uninitialized external linkage data object. Under SVR4, 103*404b540aSrobert the linker seems to want the alignment of data objects 104*404b540aSrobert to depend on their types. We do exactly that here. */ 105*404b540aSrobert 106*404b540aSrobert #undef COMMON_ASM_OP 107*404b540aSrobert #define COMMON_ASM_OP "\t.comm\t" 108*404b540aSrobert 109*404b540aSrobert #undef ASM_OUTPUT_ALIGNED_COMMON 110*404b540aSrobert #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ 111*404b540aSrobert do { \ 112*404b540aSrobert fprintf ((FILE), "%s", COMMON_ASM_OP); \ 113*404b540aSrobert assemble_name ((FILE), (NAME)); \ 114*404b540aSrobert fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED ",%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \ 115*404b540aSrobert } while (0) 116*404b540aSrobert 117*404b540aSrobert /* This says how to output assembler code to declare an 118*404b540aSrobert uninitialized internal linkage data object. Under SVR4, 119*404b540aSrobert the linker seems to want the alignment of data objects 120*404b540aSrobert to depend on their types. We do exactly that here. */ 121*404b540aSrobert 122*404b540aSrobert #undef ASM_OUTPUT_ALIGNED_LOCAL 123*404b540aSrobert #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ 124*404b540aSrobert do { \ 125*404b540aSrobert if ((SIZE) <= g_switch_value) \ 126*404b540aSrobert switch_to_section (sbss_section); \ 127*404b540aSrobert else \ 128*404b540aSrobert switch_to_section (bss_section); \ 129*404b540aSrobert ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \ 130*404b540aSrobert if (!flag_inhibit_size_directive) \ 131*404b540aSrobert ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, SIZE); \ 132*404b540aSrobert ASM_OUTPUT_ALIGN ((FILE), exact_log2((ALIGN) / BITS_PER_UNIT)); \ 133*404b540aSrobert ASM_OUTPUT_LABEL(FILE, NAME); \ 134*404b540aSrobert ASM_OUTPUT_SKIP((FILE), (SIZE) ? (SIZE) : 1); \ 135*404b540aSrobert } while (0) 136*404b540aSrobert 137*404b540aSrobert /* This says how to output assembler code to declare an 138*404b540aSrobert uninitialized external linkage data object. */ 139*404b540aSrobert 140*404b540aSrobert #undef ASM_OUTPUT_ALIGNED_BSS 141*404b540aSrobert #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ 142*404b540aSrobert do { \ 143*404b540aSrobert ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \ 144*404b540aSrobert } while (0) 145*404b540aSrobert 146*404b540aSrobert /* Biggest alignment supported by the object file format of this 147*404b540aSrobert machine. Use this macro to limit the alignment which can be 148*404b540aSrobert specified using the `__attribute__ ((aligned (N)))' construct. If 149*404b540aSrobert not defined, the default value is `BIGGEST_ALIGNMENT'. 150*404b540aSrobert 151*404b540aSrobert This value is really 2^63. Since gcc figures the alignment in bits, 152*404b540aSrobert we could only potentially get to 2^60 on suitable hosts. Due to other 153*404b540aSrobert considerations in varasm, we must restrict this to what fits in an int. */ 154*404b540aSrobert 155*404b540aSrobert #undef MAX_OFILE_ALIGNMENT 156*404b540aSrobert #define MAX_OFILE_ALIGNMENT \ 157*404b540aSrobert (1 << (HOST_BITS_PER_INT < 64 ? HOST_BITS_PER_INT - 2 : 62)) 158*404b540aSrobert 159*404b540aSrobert /* This is the pseudo-op used to generate a contiguous sequence of byte 160*404b540aSrobert values from a double-quoted string WITHOUT HAVING A TERMINATING NUL 161*404b540aSrobert AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */ 162*404b540aSrobert 163*404b540aSrobert #undef ASCII_DATA_ASM_OP 164*404b540aSrobert #define ASCII_DATA_ASM_OP "\t.ascii\t" 165*404b540aSrobert 166*404b540aSrobert #undef READONLY_DATA_SECTION_ASM_OP 167*404b540aSrobert #define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata" 168*404b540aSrobert #undef BSS_SECTION_ASM_OP 169*404b540aSrobert #define BSS_SECTION_ASM_OP "\t.section\t.bss" 170*404b540aSrobert #undef SBSS_SECTION_ASM_OP 171*404b540aSrobert #define SBSS_SECTION_ASM_OP "\t.section\t.sbss,\"aw\"" 172*404b540aSrobert #undef SDATA_SECTION_ASM_OP 173*404b540aSrobert #define SDATA_SECTION_ASM_OP "\t.section\t.sdata,\"aw\"" 174*404b540aSrobert 175*404b540aSrobert /* On svr4, we *do* have support for the .init and .fini sections, and we 176*404b540aSrobert can put stuff in there to be executed before and after `main'. We let 177*404b540aSrobert crtstuff.c and other files know this by defining the following symbols. 178*404b540aSrobert The definitions say how to change sections to the .init and .fini 179*404b540aSrobert sections. This is the same for all known svr4 assemblers. */ 180*404b540aSrobert 181*404b540aSrobert #undef INIT_SECTION_ASM_OP 182*404b540aSrobert #define INIT_SECTION_ASM_OP "\t.section\t.init" 183*404b540aSrobert #undef FINI_SECTION_ASM_OP 184*404b540aSrobert #define FINI_SECTION_ASM_OP "\t.section\t.fini" 185*404b540aSrobert 186*404b540aSrobert #ifdef HAVE_GAS_SUBSECTION_ORDERING 187*404b540aSrobert 188*404b540aSrobert #define ASM_SECTION_START_OP "\t.subsection\t-1" 189*404b540aSrobert 190*404b540aSrobert /* Output assembly directive to move to the beginning of current section. */ 191*404b540aSrobert #define ASM_OUTPUT_SECTION_START(FILE) \ 192*404b540aSrobert fprintf ((FILE), "%s\n", ASM_SECTION_START_OP) 193*404b540aSrobert 194*404b540aSrobert #endif 195*404b540aSrobert 196*404b540aSrobert /* Switch into a generic section. */ 197*404b540aSrobert #define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section 198*404b540aSrobert #define TARGET_ASM_SELECT_SECTION default_elf_select_section 199*404b540aSrobert 200*404b540aSrobert #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1) 201*404b540aSrobert 202*404b540aSrobert /* Define the strings used for the special svr4 .type and .size directives. 203*404b540aSrobert These strings generally do not vary from one system running svr4 to 204*404b540aSrobert another, but if a given system (e.g. m88k running svr) needs to use 205*404b540aSrobert different pseudo-op names for these, they may be overridden in the 206*404b540aSrobert file which includes this one. */ 207*404b540aSrobert 208*404b540aSrobert #undef TYPE_ASM_OP 209*404b540aSrobert #define TYPE_ASM_OP "\t.type\t" 210*404b540aSrobert #undef SIZE_ASM_OP 211*404b540aSrobert #define SIZE_ASM_OP "\t.size\t" 212*404b540aSrobert 213*404b540aSrobert /* This is how we tell the assembler that a symbol is weak. */ 214*404b540aSrobert 215*404b540aSrobert #undef ASM_WEAKEN_LABEL 216*404b540aSrobert #define ASM_WEAKEN_LABEL(FILE, NAME) \ 217*404b540aSrobert do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \ 218*404b540aSrobert fputc ('\n', FILE); } while (0) 219*404b540aSrobert 220*404b540aSrobert /* This is how we tell the assembler that two symbols have the same value. */ 221*404b540aSrobert 222*404b540aSrobert #undef ASM_OUTPUT_DEF 223*404b540aSrobert #define ASM_OUTPUT_DEF(FILE, ALIAS, NAME) \ 224*404b540aSrobert do { \ 225*404b540aSrobert assemble_name(FILE, ALIAS); \ 226*404b540aSrobert fputs(" = ", FILE); \ 227*404b540aSrobert assemble_name(FILE, NAME); \ 228*404b540aSrobert fputc('\n', FILE); \ 229*404b540aSrobert } while (0) 230*404b540aSrobert 231*404b540aSrobert #undef ASM_OUTPUT_DEF_FROM_DECLS 232*404b540aSrobert #define ASM_OUTPUT_DEF_FROM_DECLS(FILE, DECL, TARGET) \ 233*404b540aSrobert do { \ 234*404b540aSrobert const char *alias = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \ 235*404b540aSrobert const char *name = IDENTIFIER_POINTER (TARGET); \ 236*404b540aSrobert if (TREE_CODE (DECL) == FUNCTION_DECL) \ 237*404b540aSrobert { \ 238*404b540aSrobert fputc ('$', FILE); \ 239*404b540aSrobert assemble_name (FILE, alias); \ 240*404b540aSrobert fputs ("..ng = $", FILE); \ 241*404b540aSrobert assemble_name (FILE, name); \ 242*404b540aSrobert fputs ("..ng\n", FILE); \ 243*404b540aSrobert } \ 244*404b540aSrobert assemble_name(FILE, alias); \ 245*404b540aSrobert fputs(" = ", FILE); \ 246*404b540aSrobert assemble_name(FILE, name); \ 247*404b540aSrobert fputc('\n', FILE); \ 248*404b540aSrobert } while (0) 249*404b540aSrobert 250*404b540aSrobert /* The following macro defines the format used to output the second 251*404b540aSrobert operand of the .type assembler directive. Different svr4 assemblers 252*404b540aSrobert expect various different forms for this operand. The one given here 253*404b540aSrobert is just a default. You may need to override it in your machine- 254*404b540aSrobert specific tm.h file (depending upon the particulars of your assembler). */ 255*404b540aSrobert 256*404b540aSrobert #undef TYPE_OPERAND_FMT 257*404b540aSrobert #define TYPE_OPERAND_FMT "@%s" 258*404b540aSrobert 259*404b540aSrobert /* Write the extra assembler code needed to declare a function's result. 260*404b540aSrobert Most svr4 assemblers don't require any special declaration of the 261*404b540aSrobert result value, but there are exceptions. */ 262*404b540aSrobert 263*404b540aSrobert #ifndef ASM_DECLARE_RESULT 264*404b540aSrobert #define ASM_DECLARE_RESULT(FILE, RESULT) 265*404b540aSrobert #endif 266*404b540aSrobert 267*404b540aSrobert /* These macros generate the special .type and .size directives which 268*404b540aSrobert are used to set the corresponding fields of the linker symbol table 269*404b540aSrobert entries in an ELF object file under SVR4. These macros also output 270*404b540aSrobert the starting labels for the relevant functions/objects. */ 271*404b540aSrobert 272*404b540aSrobert /* Write the extra assembler code needed to declare an object properly. */ 273*404b540aSrobert 274*404b540aSrobert #undef ASM_DECLARE_OBJECT_NAME 275*404b540aSrobert #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \ 276*404b540aSrobert do { \ 277*404b540aSrobert HOST_WIDE_INT size; \ 278*404b540aSrobert ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \ 279*404b540aSrobert size_directive_output = 0; \ 280*404b540aSrobert if (!flag_inhibit_size_directive \ 281*404b540aSrobert && DECL_SIZE (DECL) \ 282*404b540aSrobert && (size = int_size_in_bytes (TREE_TYPE (DECL))) > 0) \ 283*404b540aSrobert { \ 284*404b540aSrobert size_directive_output = 1; \ 285*404b540aSrobert ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \ 286*404b540aSrobert } \ 287*404b540aSrobert ASM_OUTPUT_LABEL(FILE, NAME); \ 288*404b540aSrobert } while (0) 289*404b540aSrobert 290*404b540aSrobert /* Output the size directive for a decl in rest_of_decl_compilation 291*404b540aSrobert in the case where we did not do so before the initializer. 292*404b540aSrobert Once we find the error_mark_node, we know that the value of 293*404b540aSrobert size_directive_output was set 294*404b540aSrobert by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */ 295*404b540aSrobert 296*404b540aSrobert #undef ASM_FINISH_DECLARE_OBJECT 297*404b540aSrobert #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \ 298*404b540aSrobert do { \ 299*404b540aSrobert const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \ 300*404b540aSrobert HOST_WIDE_INT size; \ 301*404b540aSrobert if (!flag_inhibit_size_directive \ 302*404b540aSrobert && DECL_SIZE (DECL) \ 303*404b540aSrobert && ! AT_END && TOP_LEVEL \ 304*404b540aSrobert && DECL_INITIAL (DECL) == error_mark_node \ 305*404b540aSrobert && !size_directive_output \ 306*404b540aSrobert && (size = int_size_in_bytes (TREE_TYPE (DECL))) > 0) \ 307*404b540aSrobert { \ 308*404b540aSrobert size_directive_output = 1; \ 309*404b540aSrobert ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size); \ 310*404b540aSrobert } \ 311*404b540aSrobert } while (0) 312*404b540aSrobert 313*404b540aSrobert /* A table of bytes codes used by the ASM_OUTPUT_ASCII and 314*404b540aSrobert ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table 315*404b540aSrobert corresponds to a particular byte value [0..255]. For any 316*404b540aSrobert given byte value, if the value in the corresponding table 317*404b540aSrobert position is zero, the given character can be output directly. 318*404b540aSrobert If the table value is 1, the byte must be output as a \ooo 319*404b540aSrobert octal escape. If the tables value is anything else, then the 320*404b540aSrobert byte value should be output as a \ followed by the value 321*404b540aSrobert in the table. Note that we can use standard UN*X escape 322*404b540aSrobert sequences for many control characters, but we don't use 323*404b540aSrobert \a to represent BEL because some svr4 assemblers (e.g. on 324*404b540aSrobert the i386) don't know about that. Also, we don't use \v 325*404b540aSrobert since some versions of gas, such as 2.2 did not accept it. */ 326*404b540aSrobert 327*404b540aSrobert #undef ESCAPES 328*404b540aSrobert #define ESCAPES \ 329*404b540aSrobert "\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\ 330*404b540aSrobert \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\ 331*404b540aSrobert \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\ 332*404b540aSrobert \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\ 333*404b540aSrobert \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\ 334*404b540aSrobert \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\ 335*404b540aSrobert \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\ 336*404b540aSrobert \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" 337*404b540aSrobert 338*404b540aSrobert /* Some svr4 assemblers have a limit on the number of characters which 339*404b540aSrobert can appear in the operand of a .string directive. If your assembler 340*404b540aSrobert has such a limitation, you should define STRING_LIMIT to reflect that 341*404b540aSrobert limit. Note that at least some svr4 assemblers have a limit on the 342*404b540aSrobert actual number of bytes in the double-quoted string, and that they 343*404b540aSrobert count each character in an escape sequence as one byte. Thus, an 344*404b540aSrobert escape sequence like \377 would count as four bytes. 345*404b540aSrobert 346*404b540aSrobert If your target assembler doesn't support the .string directive, you 347*404b540aSrobert should define this to zero. */ 348*404b540aSrobert 349*404b540aSrobert #undef STRING_LIMIT 350*404b540aSrobert #define STRING_LIMIT ((unsigned) 256) 351*404b540aSrobert #undef STRING_ASM_OP 352*404b540aSrobert #define STRING_ASM_OP "\t.string\t" 353*404b540aSrobert 354*404b540aSrobert /* GAS is the only Alpha/ELF assembler. */ 355*404b540aSrobert #undef TARGET_GAS 356*404b540aSrobert #define TARGET_GAS (1) 357*404b540aSrobert 358*404b540aSrobert /* Provide a STARTFILE_SPEC appropriate for ELF. Here we add the 359*404b540aSrobert (even more) magical crtbegin.o file which provides part of the 360*404b540aSrobert support for getting C++ file-scope static object constructed 361*404b540aSrobert before entering `main'. */ 362*404b540aSrobert 363*404b540aSrobert #undef STARTFILE_SPEC 364*404b540aSrobert #ifdef HAVE_LD_PIE 365*404b540aSrobert #define STARTFILE_SPEC \ 366*404b540aSrobert "%{!shared: %{pg|p:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}\ 367*404b540aSrobert crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" 368*404b540aSrobert #else 369*404b540aSrobert #define STARTFILE_SPEC \ 370*404b540aSrobert "%{!shared: %{pg|p:gcrt1.o%s;:crt1.o%s}}\ 371*404b540aSrobert crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" 372*404b540aSrobert #endif 373*404b540aSrobert 374*404b540aSrobert /* Provide a ENDFILE_SPEC appropriate for ELF. Here we tack on the 375*404b540aSrobert magical crtend.o file which provides part of the support for 376*404b540aSrobert getting C++ file-scope static object constructed before entering 377*404b540aSrobert `main', followed by a normal ELF "finalizer" file, `crtn.o'. */ 378*404b540aSrobert 379*404b540aSrobert #undef ENDFILE_SPEC 380*404b540aSrobert #define ENDFILE_SPEC \ 381*404b540aSrobert "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \ 382*404b540aSrobert %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" 383*404b540aSrobert 384*404b540aSrobert /* We support #pragma. */ 385*404b540aSrobert #define HANDLE_SYSV_PRAGMA 1 386*404b540aSrobert 387*404b540aSrobert /* Select a format to encode pointers in exception handling data. CODE 388*404b540aSrobert is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is 389*404b540aSrobert true if the symbol may be affected by dynamic relocations. 390*404b540aSrobert 391*404b540aSrobert Since application size is already constrained to <2GB by the form of 392*404b540aSrobert the ldgp relocation, we can use a 32-bit pc-relative relocation to 393*404b540aSrobert static data. Dynamic data is accessed indirectly to allow for read 394*404b540aSrobert only EH sections. */ 395*404b540aSrobert #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \ 396*404b540aSrobert (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) 397*404b540aSrobert 398*404b540aSrobert /* If defined, a C statement to be executed just prior to the output of 399*404b540aSrobert assembler code for INSN. */ 400*404b540aSrobert #define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS) \ 401*404b540aSrobert (alpha_this_literal_sequence_number = 0, \ 402*404b540aSrobert alpha_this_gpdisp_sequence_number = 0) 403*404b540aSrobert extern int alpha_this_literal_sequence_number; 404*404b540aSrobert extern int alpha_this_gpdisp_sequence_number; 405*404b540aSrobert 406*404b540aSrobert /* Since the bits of the _init and _fini function is spread across 407*404b540aSrobert many object files, each potentially with its own GP, we must assume 408*404b540aSrobert we need to load our GP. Further, the .init/.fini section can 409*404b540aSrobert easily be more than 4MB away from the function to call so we can't 410*404b540aSrobert use bsr. */ 411*404b540aSrobert #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ 412*404b540aSrobert asm (SECTION_OP "\n" \ 413*404b540aSrobert " br $29,1f\n" \ 414*404b540aSrobert "1: ldgp $29,0($29)\n" \ 415*404b540aSrobert " unop\n" \ 416*404b540aSrobert " jsr $26," USER_LABEL_PREFIX #FUNC "\n" \ 417*404b540aSrobert " .align 3\n" \ 418*404b540aSrobert " .previous"); 419*404b540aSrobert 420*404b540aSrobert /* If we have the capability create headers for efficient EH lookup. 421*404b540aSrobert As of Jan 2002, only glibc 2.2.4 can actually make use of this, but 422*404b540aSrobert I imagine that other systems will catch up. In the meantime, it 423*404b540aSrobert doesn't harm to make sure that the data exists to be used later. */ 424*404b540aSrobert #if defined(HAVE_LD_EH_FRAME_HDR) 425*404b540aSrobert #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " 426*404b540aSrobert #endif 427