OSDN Git Service

* config/i386/freebsd.h (LINK_SPEC): Don't pass default
[pf3gnuchains/gcc-fork.git] / gcc / config / alpha / alpha-interix.h
1 /* Definitions of target machine for GNU compiler, for DEC Alpha
2    running Windows/NT.
3    Copyright (C) 1995, 1996, 1999, 2000 Free Software Foundation, Inc.
4
5    Donn Terry, Softway Systems, Inc.
6    From code
7        Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
8
9 This file is part of GNU CC.
10
11 GNU CC is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2, or (at your option)
14 any later version.
15
16 GNU CC is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with GNU CC; see the file COPYING.  If not, write to
23 the Free Software Foundation, 59 Temple Place - Suite 330,
24 Boston, MA 02111-1307, USA.  */
25
26 /* cpp handles __STDC__ */
27 /* The three "Alpha" defines on the first such line are from the CLAXP spec */
28 #undef CPP_PREDEFINES
29 #define CPP_PREDEFINES " \
30   -D__INTERIX \
31   -D__OPENNT \
32   -D__Alpha_AXP -D_M_ALPHA -D_ALPHA_  \
33   -D__alpha -D__alpha__\
34   -D__stdcall= \
35   -D__cdecl= \
36   -Asystem=unix -Asystem=interix -Acpu=alpha -Amachine=alpha"
37
38 #undef CPP_SUBTARGET_SPEC
39 #define CPP_SUBTARGET_SPEC "\
40 -remap \
41 %{posix:-D_POSIX_SOURCE} \
42 -isystem %$INTERIX_ROOT/usr/include"
43
44 #undef TARGET_VERSION
45 #define TARGET_VERSION fprintf (stderr, " (alpha Interix)");
46
47 /* alpha.h sets this, but it doesn't apply to us */
48 #undef OBJECT_FORMAT_ECOFF
49 #undef OBJECT_FORMAT_COFF
50
51 /* LINK_SPEC */
52
53 /* MD_STARTFILE_PREFIX */
54
55 /* ASM_OUTPUT_LOOP_ALIGN; ASM_OUTPUT_ALIGN_CODE */
56
57 /* Codegen macro overrides for NT internal conventions */
58
59 /* the below are ecoff specific... we don't need them, so
60    undef them (they'll get a default later) */
61
62 #undef PUT_SDB_BLOCK_START
63 #undef PUT_SDB_BLOCK_END
64
65 /* The following are needed for C++, but also needed for profiling */
66
67 /* Support const sections and the ctors and dtors sections for g++.
68    Note that there appears to be two different ways to support const
69    sections at the moment.  You can either #define the symbol
70    READONLY_DATA_SECTION (giving it some code which switches to the
71    readonly data section) or else you can #define the symbols
72    EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
73    SELECT_RTX_SECTION.  We do both here just to be on the safe side.  */
74
75 #define USE_CONST_SECTION       1
76
77 #define CONST_SECTION_ASM_OP    "\t.rdata"
78
79 /* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
80
81    Note that we want to give these sections the SHF_WRITE attribute
82    because these sections will actually contain data (i.e. tables of
83    addresses of functions in the current root executable or shared library
84    file) and, in the case of a shared library, the relocatable addresses
85    will have to be properly resolved/relocated (and then written into) by
86    the dynamic linker when it actually attaches the given shared library
87    to the executing process.  (Note that on SVR4, you may wish to use the
88    `-z text' option to the ELF linker, when building a shared library, as
89    an additional check that you are doing everything right.  But if you do
90    use the `-z text' option when building a shared library, you will get
91    errors unless the .ctors and .dtors sections are marked as writable
92    via the SHF_WRITE attribute.)  */
93
94 #define CTORS_SECTION_ASM_OP    "\t.ctors"
95 #define DTORS_SECTION_ASM_OP    "\t.dtors"
96
97 /* A default list of other sections which we might be "in" at any given
98    time.  For targets that use additional sections (e.g. .tdesc) you
99    should override this definition in the target-specific file which
100    includes this file.  */
101
102 #undef EXTRA_SECTIONS
103 #define EXTRA_SECTIONS in_const
104
105 /* A default list of extra section function definitions.  For targets
106    that use additional sections (e.g. .tdesc) you should override this
107    definition in the target-specific file which includes this file.  */
108
109 #undef EXTRA_SECTION_FUNCTIONS
110 #define EXTRA_SECTION_FUNCTIONS                                         \
111   CONST_SECTION_FUNCTION
112
113 #undef READONLY_DATA_SECTION
114 #define READONLY_DATA_SECTION() const_section ()
115
116 #define CONST_SECTION_FUNCTION                                          \
117 void                                                                    \
118 const_section ()                                                        \
119 {                                                                       \
120   if (!USE_CONST_SECTION)                                               \
121     text_section();                                                     \
122   else if (in_section != in_const)                                      \
123     {                                                                   \
124       fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP);             \
125       in_section = in_const;                                            \
126     }                                                                   \
127 }
128
129 /* The linker will take care of this, and having them causes problems with
130    ld -r (specifically -rU).  */
131 #define CTOR_LISTS_DEFINED_EXTERNALLY 1
132
133 #define SET_ASM_OP      "\t.set\t"
134 /* Output a definition (implements alias) */
135 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2)                              \
136 do                                                                      \
137 {                                                                       \
138     fprintf ((FILE), "\t");                                             \
139     assemble_name (FILE, LABEL1);                                       \
140     fprintf (FILE, "=");                                                \
141     assemble_name (FILE, LABEL2);                                       \
142     fprintf (FILE, "\n");                                               \
143     }                                                                   \
144 while (0)
145
146 /* We use the defaults, so undef the null definitions */
147 #undef PUT_SDB_FUNCTION_START
148 #undef PUT_SDB_FUNCTION_END
149 #undef PUT_SDB_EPILOGUE_END
150
151 #define HOST_PTR_PRINTF "%p"
152 #define HOST_PTR_AS_INT unsigned long
153
154 #define PCC_BITFIELD_TYPE_MATTERS 1
155 #define PCC_BITFIELD_TYPE_TEST TYPE_NATIVE(rec)
156 #define GROUP_BITFIELDS_BY_ALIGN TYPE_NATIVE(rec)
157
158 /* DWARF2 Unwinding doesn't work with exception handling yet.  */
159 #undef DWARF2_UNWIND_INFO
160 #define DWARF2_UNWIND_INFO 0
161
162 /* Don't assume anything about the header files.  */
163 #define NO_IMPLICIT_EXTERN_C
164
165 /* The definition of this macro implies that there are cases where
166    a scalar value cannot be returned in registers.
167
168    On NT (according to the spec) anything except strings/array that fits
169    in 64 bits is returned in the registers (this appears to differ from
170    the rest of the Alpha family).  */
171
172 #undef RETURN_IN_MEMORY
173 #define RETURN_IN_MEMORY(TYPE) \
174   (TREE_CODE (TYPE) == ARRAY_TYPE || int_size_in_bytes(TYPE) > 8)
175
176 #define ASM_LOAD_ADDR(loc, reg)   "     lda " #reg "," #loc "\n" 
177
178 #undef ASM_FILE_START
179 #define ASM_FILE_START(FILE)                                    \
180 {                                                               \
181   alpha_write_verstamp (FILE);                                  \
182   fprintf (FILE, "\t.set noreorder\n");                         \
183   fprintf (FILE, "\t.set volatile\n");                          \
184   fprintf (FILE, "\t.set noat\n");                              \
185   fprintf (FILE, "\t.globl\t__fltused\n");                      \
186   ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename);       \
187 }
188
189 /* The current Interix assembler (consistent with the DEC documentation)
190    uses a=b NOT .set a,b; .set is for assembler options.  */
191 #undef ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL
192 #define ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL(FILE, SY, HI, LO)     \
193  do {                                                                   \
194   assemble_name (FILE, SY);                                             \
195   fputc ('=', FILE);                                                    \
196   assemble_name (FILE, HI);                                             \
197   fputc ('-', FILE);                                                    \
198   assemble_name (FILE, LO);                                             \
199  } while (0)