00001 /* Definitions of target machine for GNU compiler, for DEC Alpha 00002 running Windows/NT. 00003 Copyright (C) 1995, 1996, 1999, 2000 Free Software Foundation, Inc. 00004 00005 Donn Terry, Softway Systems, Inc. 00006 From code 00007 Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) 00008 00009 This file is part of GNU CC. 00010 00011 GNU CC is free software; you can redistribute it and/or modify 00012 it under the terms of the GNU General Public License as published by 00013 the Free Software Foundation; either version 2, or (at your option) 00014 any later version. 00015 00016 GNU CC is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 GNU General Public License for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with GNU CC; see the file COPYING. If not, write to 00023 the Free Software Foundation, 59 Temple Place - Suite 330, 00024 Boston, MA 02111-1307, USA. */ 00025 00026 /* cpp handles __STDC__ */ 00027 /* The three "Alpha" defines on the first such line are from the CLAXP spec */ 00028 #undef CPP_PREDEFINES 00029 #define CPP_PREDEFINES " \ 00030 -D__INTERIX \ 00031 -D__OPENNT \ 00032 -D__Alpha_AXP -D_M_ALPHA -D_ALPHA_ \ 00033 -D__alpha -D__alpha__\ 00034 -D__stdcall= \ 00035 -D__cdecl= \ 00036 -Asystem=unix -Asystem=interix -Acpu=alpha -Amachine=alpha" 00037 00038 #undef CPP_SUBTARGET_SPEC 00039 #define CPP_SUBTARGET_SPEC "\ 00040 -remap \ 00041 %{posix:-D_POSIX_SOURCE} \ 00042 -isystem %$INTERIX_ROOT/usr/include" 00043 00044 #undef TARGET_VERSION 00045 #define TARGET_VERSION fprintf (stderr, " (alpha Interix)"); 00046 00047 /* alpha.h sets this, but it doesn't apply to us */ 00048 #undef OBJECT_FORMAT_ECOFF 00049 #undef OBJECT_FORMAT_COFF 00050 00051 /* LINK_SPEC */ 00052 00053 /* MD_STARTFILE_PREFIX */ 00054 00055 /* ASM_OUTPUT_LOOP_ALIGN; ASM_OUTPUT_ALIGN_CODE */ 00056 00057 /* Codegen macro overrides for NT internal conventions */ 00058 00059 /* the below are ecoff specific... we don't need them, so 00060 undef them (they'll get a default later) */ 00061 00062 #undef PUT_SDB_BLOCK_START 00063 #undef PUT_SDB_BLOCK_END 00064 00065 /* The following are needed for C++, but also needed for profiling */ 00066 00067 /* Support const sections and the ctors and dtors sections for g++. 00068 Note that there appears to be two different ways to support const 00069 sections at the moment. You can either #define the symbol 00070 READONLY_DATA_SECTION (giving it some code which switches to the 00071 readonly data section) or else you can #define the symbols 00072 EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and 00073 SELECT_RTX_SECTION. We do both here just to be on the safe side. */ 00074 00075 #define USE_CONST_SECTION 1 00076 00077 #define CONST_SECTION_ASM_OP "\t.rdata" 00078 00079 /* Define the pseudo-ops used to switch to the .ctors and .dtors sections. 00080 00081 Note that we want to give these sections the SHF_WRITE attribute 00082 because these sections will actually contain data (i.e. tables of 00083 addresses of functions in the current root executable or shared library 00084 file) and, in the case of a shared library, the relocatable addresses 00085 will have to be properly resolved/relocated (and then written into) by 00086 the dynamic linker when it actually attaches the given shared library 00087 to the executing process. (Note that on SVR4, you may wish to use the 00088 `-z text' option to the ELF linker, when building a shared library, as 00089 an additional check that you are doing everything right. But if you do 00090 use the `-z text' option when building a shared library, you will get 00091 errors unless the .ctors and .dtors sections are marked as writable 00092 via the SHF_WRITE attribute.) */ 00093 00094 #define CTORS_SECTION_ASM_OP "\t.ctors" 00095 #define DTORS_SECTION_ASM_OP "\t.dtors" 00096 00097 /* A default list of other sections which we might be "in" at any given 00098 time. For targets that use additional sections (e.g. .tdesc) you 00099 should override this definition in the target-specific file which 00100 includes this file. */ 00101 00102 #undef EXTRA_SECTIONS 00103 #define EXTRA_SECTIONS in_const 00104 00105 /* A default list of extra section function definitions. For targets 00106 that use additional sections (e.g. .tdesc) you should override this 00107 definition in the target-specific file which includes this file. */ 00108 00109 #undef EXTRA_SECTION_FUNCTIONS 00110 #define EXTRA_SECTION_FUNCTIONS \ 00111 CONST_SECTION_FUNCTION 00112 00113 #undef READONLY_DATA_SECTION 00114 #define READONLY_DATA_SECTION() const_section () 00115 00116 #define CONST_SECTION_FUNCTION \ 00117 void \ 00118 const_section () \ 00119 { \ 00120 if (!USE_CONST_SECTION) \ 00121 text_section(); \ 00122 else if (in_section != in_const) \ 00123 { \ 00124 fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \ 00125 in_section = in_const; \ 00126 } \ 00127 } 00128 00129 /* The linker will take care of this, and having them causes problems with 00130 ld -r (specifically -rU). */ 00131 #define CTOR_LISTS_DEFINED_EXTERNALLY 1 00132 00133 #define SET_ASM_OP "\t.set\t" 00134 /* Output a definition (implements alias) */ 00135 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \ 00136 do \ 00137 { \ 00138 fprintf ((FILE), "\t"); \ 00139 assemble_name (FILE, LABEL1); \ 00140 fprintf (FILE, "="); \ 00141 assemble_name (FILE, LABEL2); \ 00142 fprintf (FILE, "\n"); \ 00143 } \ 00144 while (0) 00145 00146 /* We use the defaults, so undef the null definitions */ 00147 #undef PUT_SDB_FUNCTION_START 00148 #undef PUT_SDB_FUNCTION_END 00149 #undef PUT_SDB_EPILOGUE_END 00150 00151 #define HOST_PTR_PRINTF "%p" 00152 #define HOST_PTR_AS_INT unsigned long 00153 00154 #define PCC_BITFIELD_TYPE_MATTERS 1 00155 #define PCC_BITFIELD_TYPE_TEST TYPE_NATIVE(rec) 00156 #define GROUP_BITFIELDS_BY_ALIGN TYPE_NATIVE(rec) 00157 00158 /* DWARF2 Unwinding doesn't work with exception handling yet. */ 00159 #undef DWARF2_UNWIND_INFO 00160 #define DWARF2_UNWIND_INFO 0 00161 00162 /* Don't assume anything about the header files. */ 00163 #define NO_IMPLICIT_EXTERN_C 00164 00165 /* The definition of this macro implies that there are cases where 00166 a scalar value cannot be returned in registers. 00167 00168 On NT (according to the spec) anything except strings/array that fits 00169 in 64 bits is returned in the registers (this appears to differ from 00170 the rest of the Alpha family). */ 00171 00172 #undef RETURN_IN_MEMORY 00173 #define RETURN_IN_MEMORY(TYPE) \ 00174 (TREE_CODE (TYPE) == ARRAY_TYPE || int_size_in_bytes(TYPE) > 8) 00175 00176 #define ASM_LOAD_ADDR(loc, reg) " lda " #reg "," #loc "\n" 00177 00178 #undef ASM_FILE_START 00179 #define ASM_FILE_START(FILE) \ 00180 { \ 00181 alpha_write_verstamp (FILE); \ 00182 fprintf (FILE, "\t.set noreorder\n"); \ 00183 fprintf (FILE, "\t.set volatile\n"); \ 00184 fprintf (FILE, "\t.set noat\n"); \ 00185 fprintf (FILE, "\t.globl\t__fltused\n"); \ 00186 ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename); \ 00187 } 00188 00189 /* The current Interix assembler (consistent with the DEC documentation) 00190 uses a=b NOT .set a,b; .set is for assembler options. */ 00191 #undef ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL 00192 #define ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL(FILE, SY, HI, LO) \ 00193 do { \ 00194 assemble_name (FILE, SY); \ 00195 fputc ('=', FILE); \ 00196 assemble_name (FILE, HI); \ 00197 fputc ('-', FILE); \ 00198 assemble_name (FILE, LO); \ 00199 } while (0)
1.5.6