1 |
282 |
jeremybenn |
/* Operating system specific defines to be used when targeting GCC for
|
2 |
|
|
hosting on Windows32, using a Unix style C library and tools.
|
3 |
|
|
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
|
4 |
|
|
2004, 2005, 2007, 2008, 2009, 2010
|
5 |
|
|
Free Software Foundation, Inc.
|
6 |
|
|
|
7 |
|
|
This file is part of GCC.
|
8 |
|
|
|
9 |
|
|
GCC is free software; you can redistribute it and/or modify
|
10 |
|
|
it under the terms of the GNU General Public License as published by
|
11 |
|
|
the Free Software Foundation; either version 3, or (at your option)
|
12 |
|
|
any later version.
|
13 |
|
|
|
14 |
|
|
GCC is distributed in the hope that it will be useful,
|
15 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17 |
|
|
GNU General Public License for more details.
|
18 |
|
|
|
19 |
|
|
You should have received a copy of the GNU General Public License
|
20 |
|
|
along with GCC; see the file COPYING3. If not see
|
21 |
|
|
<http://www.gnu.org/licenses/>. */
|
22 |
|
|
|
23 |
|
|
#define DBX_DEBUGGING_INFO 1
|
24 |
|
|
#define SDB_DEBUGGING_INFO 1
|
25 |
|
|
#if TARGET_64BIT_DEFAULT || defined (HAVE_GAS_PE_SECREL32_RELOC)
|
26 |
|
|
#define DWARF2_DEBUGGING_INFO 1
|
27 |
|
|
#endif
|
28 |
|
|
|
29 |
|
|
#undef PREFERRED_DEBUGGING_TYPE
|
30 |
|
|
#if (DWARF2_DEBUGGING_INFO)
|
31 |
|
|
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
|
32 |
|
|
#else
|
33 |
|
|
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
|
34 |
|
|
#endif
|
35 |
|
|
|
36 |
|
|
#undef TARGET_64BIT_MS_ABI
|
37 |
|
|
#define TARGET_64BIT_MS_ABI (!cfun ? ix86_abi == MS_ABI : TARGET_64BIT && cfun->machine->call_abi == MS_ABI)
|
38 |
|
|
|
39 |
|
|
#undef DEFAULT_ABI
|
40 |
|
|
#define DEFAULT_ABI (TARGET_64BIT ? MS_ABI : SYSV_ABI)
|
41 |
|
|
|
42 |
|
|
#if ! defined (USE_MINGW64_LEADING_UNDERSCORES)
|
43 |
|
|
#undef USER_LABEL_PREFIX
|
44 |
|
|
#define USER_LABEL_PREFIX (TARGET_64BIT ? "" : "_")
|
45 |
|
|
|
46 |
|
|
#undef LOCAL_LABEL_PREFIX
|
47 |
|
|
#define LOCAL_LABEL_PREFIX (TARGET_64BIT ? "." : "")
|
48 |
|
|
|
49 |
|
|
#undef ASM_GENERATE_INTERNAL_LABEL
|
50 |
|
|
#define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \
|
51 |
|
|
sprintf ((BUF), "*%s%s%ld", LOCAL_LABEL_PREFIX, \
|
52 |
|
|
(PREFIX), (long)(NUMBER))
|
53 |
|
|
|
54 |
|
|
#undef LPREFIX
|
55 |
|
|
#define LPREFIX (TARGET_64BIT ? ".L" : "L")
|
56 |
|
|
|
57 |
|
|
#endif
|
58 |
|
|
|
59 |
|
|
#undef DBX_REGISTER_NUMBER
|
60 |
|
|
#define DBX_REGISTER_NUMBER(n) \
|
61 |
|
|
(TARGET_64BIT ? dbx64_register_map[n] \
|
62 |
|
|
: (write_symbols == DWARF2_DEBUG \
|
63 |
|
|
? svr4_dbx_register_map[n] : dbx_register_map[n]))
|
64 |
|
|
|
65 |
|
|
/* Map gcc register number to DWARF 2 CFA column number. For 32 bit
|
66 |
|
|
target, always use the svr4_dbx_register_map for DWARF .eh_frame
|
67 |
|
|
even if we don't use DWARF .debug_frame. */
|
68 |
|
|
#undef DWARF_FRAME_REGNUM
|
69 |
|
|
#define DWARF_FRAME_REGNUM(n) \
|
70 |
|
|
(TARGET_64BIT ? dbx64_register_map[(n)] \
|
71 |
|
|
: svr4_dbx_register_map[(n)])
|
72 |
|
|
|
73 |
|
|
#ifdef HAVE_GAS_PE_SECREL32_RELOC
|
74 |
|
|
/* Use section relative relocations for debugging offsets. Unlike
|
75 |
|
|
other targets that fake this by putting the section VMA at 0, PE
|
76 |
|
|
won't allow it. */
|
77 |
|
|
#define ASM_OUTPUT_DWARF_OFFSET(FILE, SIZE, LABEL, SECTION) \
|
78 |
|
|
do { \
|
79 |
|
|
if (SIZE != 4 && (!TARGET_64BIT || SIZE != 8)) \
|
80 |
|
|
abort (); \
|
81 |
|
|
\
|
82 |
|
|
fputs ("\t.secrel32\t", FILE); \
|
83 |
|
|
assemble_name (FILE, LABEL); \
|
84 |
|
|
} while (0)
|
85 |
|
|
#endif
|
86 |
|
|
|
87 |
|
|
#define TARGET_EXECUTABLE_SUFFIX ".exe"
|
88 |
|
|
|
89 |
|
|
#include <stdio.h>
|
90 |
|
|
|
91 |
|
|
#define TARGET_OS_CPP_BUILTINS() \
|
92 |
|
|
do \
|
93 |
|
|
{ \
|
94 |
|
|
if (!TARGET_64BIT) \
|
95 |
|
|
builtin_define ("_X86_=1"); \
|
96 |
|
|
builtin_assert ("system=winnt"); \
|
97 |
|
|
builtin_define ("__stdcall=__attribute__((__stdcall__))"); \
|
98 |
|
|
builtin_define ("__fastcall=__attribute__((__fastcall__))"); \
|
99 |
|
|
builtin_define ("__cdecl=__attribute__((__cdecl__))"); \
|
100 |
|
|
if (!flag_iso) \
|
101 |
|
|
{ \
|
102 |
|
|
builtin_define ("_stdcall=__attribute__((__stdcall__))"); \
|
103 |
|
|
builtin_define ("_fastcall=__attribute__((__fastcall__))"); \
|
104 |
|
|
builtin_define ("_cdecl=__attribute__((__cdecl__))"); \
|
105 |
|
|
} \
|
106 |
|
|
/* Even though linkonce works with static libs, this is needed \
|
107 |
|
|
to compare typeinfo symbols across dll boundaries. */ \
|
108 |
|
|
builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \
|
109 |
|
|
builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0"); \
|
110 |
|
|
EXTRA_OS_CPP_BUILTINS (); \
|
111 |
|
|
} \
|
112 |
|
|
while (0)
|
113 |
|
|
|
114 |
|
|
/* Get tree.c to declare a target-specific specialization of
|
115 |
|
|
merge_decl_attributes. */
|
116 |
|
|
#define TARGET_DLLIMPORT_DECL_ATTRIBUTES 1
|
117 |
|
|
|
118 |
|
|
/* This macro defines names of additional specifications to put in the specs
|
119 |
|
|
that can be used in various specifications like CC1_SPEC. Its definition
|
120 |
|
|
is an initializer with a subgrouping for each command option.
|
121 |
|
|
|
122 |
|
|
Each subgrouping contains a string constant, that defines the
|
123 |
|
|
specification name, and a string constant that used by the GCC driver
|
124 |
|
|
program.
|
125 |
|
|
|
126 |
|
|
Do not define this macro if it does not need to do anything. */
|
127 |
|
|
|
128 |
|
|
#undef SUBTARGET_EXTRA_SPECS
|
129 |
|
|
#define SUBTARGET_EXTRA_SPECS \
|
130 |
|
|
{ "mingw_include_path", DEFAULT_TARGET_MACHINE }
|
131 |
|
|
|
132 |
|
|
#undef MATH_LIBRARY
|
133 |
|
|
#define MATH_LIBRARY ""
|
134 |
|
|
|
135 |
|
|
#define SIZE_TYPE (TARGET_64BIT ? "long long unsigned int" : "unsigned int")
|
136 |
|
|
#define PTRDIFF_TYPE (TARGET_64BIT ? "long long int" : "int")
|
137 |
|
|
|
138 |
|
|
#define WCHAR_TYPE_SIZE 16
|
139 |
|
|
#define WCHAR_TYPE "short unsigned int"
|
140 |
|
|
|
141 |
|
|
/* Windows64 continues to use a 32-bit long type. */
|
142 |
|
|
#undef LONG_TYPE_SIZE
|
143 |
|
|
#define LONG_TYPE_SIZE 32
|
144 |
|
|
|
145 |
|
|
/* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop). */
|
146 |
|
|
#define HANDLE_PRAGMA_PACK_PUSH_POP 1
|
147 |
|
|
|
148 |
|
|
union tree_node;
|
149 |
|
|
#define TREE union tree_node *
|
150 |
|
|
|
151 |
|
|
#define drectve_section() \
|
152 |
|
|
(fprintf (asm_out_file, "\t.section .drectve\n"), \
|
153 |
|
|
in_section = NULL)
|
154 |
|
|
|
155 |
|
|
/* Older versions of gas don't handle 'r' as data.
|
156 |
|
|
Explicitly set data flag with 'd'. */
|
157 |
|
|
#define READONLY_DATA_SECTION_ASM_OP "\t.section .rdata,\"dr\""
|
158 |
|
|
|
159 |
|
|
/* Don't allow flag_pic to propagate since gas may produce invalid code
|
160 |
|
|
otherwise. */
|
161 |
|
|
|
162 |
|
|
#undef SUBTARGET_OVERRIDE_OPTIONS
|
163 |
|
|
#define SUBTARGET_OVERRIDE_OPTIONS \
|
164 |
|
|
do { \
|
165 |
|
|
if (TARGET_64BIT && flag_pic != 1) \
|
166 |
|
|
{ \
|
167 |
|
|
if (flag_pic > 1) \
|
168 |
|
|
warning (0, \
|
169 |
|
|
"-fPIC ignored for target (all code is position independent)"\
|
170 |
|
|
); \
|
171 |
|
|
flag_pic = 1; \
|
172 |
|
|
} \
|
173 |
|
|
else if (!TARGET_64BIT && flag_pic) \
|
174 |
|
|
{ \
|
175 |
|
|
warning (0, "-f%s ignored for target (all code is position independent)",\
|
176 |
|
|
(flag_pic > 1) ? "PIC" : "pic"); \
|
177 |
|
|
flag_pic = 0; \
|
178 |
|
|
} \
|
179 |
|
|
} while (0) \
|
180 |
|
|
|
181 |
|
|
/* Define this macro if references to a symbol must be treated
|
182 |
|
|
differently depending on something about the variable or
|
183 |
|
|
function named by the symbol (such as what section it is in).
|
184 |
|
|
|
185 |
|
|
On i386 running Windows NT, modify the assembler name with a suffix
|
186 |
|
|
consisting of an atsign (@) followed by string of digits that represents
|
187 |
|
|
the number of bytes of arguments passed to the function, if it has the
|
188 |
|
|
attribute STDCALL.
|
189 |
|
|
|
190 |
|
|
In addition, we must mark dll symbols specially. Definitions of
|
191 |
|
|
dllexport'd objects install some info in the .drectve section.
|
192 |
|
|
References to dllimport'd objects are fetched indirectly via
|
193 |
|
|
_imp__. If both are declared, dllexport overrides. This is also
|
194 |
|
|
needed to implement one-only vtables: they go into their own
|
195 |
|
|
section and we need to set DECL_SECTION_NAME so we do that here.
|
196 |
|
|
Note that we can be called twice on the same decl. */
|
197 |
|
|
|
198 |
|
|
#define SUBTARGET_ENCODE_SECTION_INFO i386_pe_encode_section_info
|
199 |
|
|
|
200 |
|
|
/* Output a common block. */
|
201 |
|
|
#undef ASM_OUTPUT_ALIGNED_DECL_COMMON
|
202 |
|
|
#define ASM_OUTPUT_ALIGNED_DECL_COMMON \
|
203 |
|
|
i386_pe_asm_output_aligned_decl_common
|
204 |
|
|
|
205 |
|
|
/* Output the label for an initialized variable. */
|
206 |
|
|
#undef ASM_DECLARE_OBJECT_NAME
|
207 |
|
|
#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
|
208 |
|
|
do { \
|
209 |
|
|
i386_pe_maybe_record_exported_symbol (DECL, NAME, 1); \
|
210 |
|
|
ASM_OUTPUT_LABEL ((STREAM), (NAME)); \
|
211 |
|
|
} while (0)
|
212 |
|
|
|
213 |
|
|
/* Output a reference to a label. Fastcall function symbols
|
214 |
|
|
keep their '@' prefix, while other symbols are prefixed
|
215 |
|
|
with user_label_prefix. */
|
216 |
|
|
#undef ASM_OUTPUT_LABELREF
|
217 |
|
|
#define ASM_OUTPUT_LABELREF(STREAM, NAME) \
|
218 |
|
|
do { \
|
219 |
|
|
if ((NAME)[0] != FASTCALL_PREFIX) \
|
220 |
|
|
fputs (user_label_prefix, (STREAM)); \
|
221 |
|
|
fputs ((NAME), (STREAM)); \
|
222 |
|
|
} while (0)
|
223 |
|
|
|
224 |
|
|
|
225 |
|
|
/* Emit code to check the stack when allocating more than 4000
|
226 |
|
|
bytes in one go. */
|
227 |
|
|
#define CHECK_STACK_LIMIT 4000
|
228 |
|
|
|
229 |
|
|
#undef STACK_BOUNDARY
|
230 |
|
|
#define STACK_BOUNDARY (ix86_abi == MS_ABI ? 128 : BITS_PER_WORD)
|
231 |
|
|
|
232 |
|
|
/* By default, target has a 80387, uses IEEE compatible arithmetic,
|
233 |
|
|
returns float values in the 387 and needs stack probes.
|
234 |
|
|
We also align doubles to 64-bits for MSVC default compatibility. */
|
235 |
|
|
|
236 |
|
|
#undef TARGET_SUBTARGET_DEFAULT
|
237 |
|
|
#define TARGET_SUBTARGET_DEFAULT \
|
238 |
|
|
(MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS \
|
239 |
|
|
| MASK_STACK_PROBE | MASK_ALIGN_DOUBLE)
|
240 |
|
|
|
241 |
|
|
#undef TARGET_SUBTARGET64_DEFAULT
|
242 |
|
|
#define TARGET_SUBTARGET64_DEFAULT \
|
243 |
|
|
MASK_128BIT_LONG_DOUBLE
|
244 |
|
|
|
245 |
|
|
/* This is how to output an assembler line
|
246 |
|
|
that says to advance the location counter
|
247 |
|
|
to a multiple of 2**LOG bytes. */
|
248 |
|
|
|
249 |
|
|
#undef ASM_OUTPUT_ALIGN
|
250 |
|
|
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
|
251 |
|
|
if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG))
|
252 |
|
|
|
253 |
|
|
/* Windows uses explicit import from shared libraries. */
|
254 |
|
|
#define MULTIPLE_SYMBOL_SPACES 1
|
255 |
|
|
|
256 |
|
|
#define TARGET_ASM_UNIQUE_SECTION i386_pe_unique_section
|
257 |
|
|
#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section
|
258 |
|
|
|
259 |
|
|
#define SUPPORTS_ONE_ONLY 1
|
260 |
|
|
|
261 |
|
|
/* Switch into a generic section. */
|
262 |
|
|
#define TARGET_ASM_NAMED_SECTION i386_pe_asm_named_section
|
263 |
|
|
|
264 |
|
|
/* Select attributes for named sections. */
|
265 |
|
|
#define TARGET_SECTION_TYPE_FLAGS i386_pe_section_type_flags
|
266 |
|
|
|
267 |
|
|
/* Write the extra assembler code needed to declare a function
|
268 |
|
|
properly. If we are generating SDB debugging information, this
|
269 |
|
|
will happen automatically, so we only need to handle other cases. */
|
270 |
|
|
#undef ASM_DECLARE_FUNCTION_NAME
|
271 |
|
|
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
|
272 |
|
|
do \
|
273 |
|
|
{ \
|
274 |
|
|
i386_pe_maybe_record_exported_symbol (DECL, NAME, 0); \
|
275 |
|
|
if (write_symbols != SDB_DEBUG) \
|
276 |
|
|
i386_pe_declare_function_type (FILE, NAME, TREE_PUBLIC (DECL)); \
|
277 |
|
|
ASM_OUTPUT_LABEL (FILE, NAME); \
|
278 |
|
|
} \
|
279 |
|
|
while (0)
|
280 |
|
|
|
281 |
|
|
/* Add an external function to the list of functions to be declared at
|
282 |
|
|
the end of the file. */
|
283 |
|
|
#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
|
284 |
|
|
do \
|
285 |
|
|
{ \
|
286 |
|
|
if (TREE_CODE (DECL) == FUNCTION_DECL) \
|
287 |
|
|
i386_pe_record_external_function ((DECL), (NAME)); \
|
288 |
|
|
} \
|
289 |
|
|
while (0)
|
290 |
|
|
|
291 |
|
|
/* Declare the type properly for any external libcall. */
|
292 |
|
|
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
|
293 |
|
|
i386_pe_declare_function_type (FILE, XSTR (FUN, 0), 1)
|
294 |
|
|
|
295 |
|
|
/* This says out to put a global symbol in the BSS section. */
|
296 |
|
|
#undef ASM_OUTPUT_ALIGNED_BSS
|
297 |
|
|
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
|
298 |
|
|
asm_output_aligned_bss ((FILE), (DECL), (NAME), (SIZE), (ALIGN))
|
299 |
|
|
|
300 |
|
|
/* Output function declarations at the end of the file. */
|
301 |
|
|
#undef TARGET_ASM_FILE_END
|
302 |
|
|
#define TARGET_ASM_FILE_END i386_pe_file_end
|
303 |
|
|
|
304 |
|
|
#undef ASM_COMMENT_START
|
305 |
|
|
#define ASM_COMMENT_START " #"
|
306 |
|
|
|
307 |
|
|
#ifndef DWARF2_UNWIND_INFO
|
308 |
|
|
/* If configured with --disable-sjlj-exceptions, use DWARF2, else
|
309 |
|
|
default to SJLJ. */
|
310 |
|
|
#if (defined (CONFIG_SJLJ_EXCEPTIONS) && !CONFIG_SJLJ_EXCEPTIONS)
|
311 |
|
|
/* The logic of this #if must be kept synchronised with the logic
|
312 |
|
|
for selecting the tmake_eh_file fragment in config.gcc. */
|
313 |
|
|
#define DWARF2_UNWIND_INFO 1
|
314 |
|
|
/* If multilib is selected break build as sjlj is required. */
|
315 |
|
|
#if defined (TARGET_BI_ARCH)
|
316 |
|
|
#error For 64-bit windows and 32-bit based multilib version of gcc just SJLJ exceptions are supported.
|
317 |
|
|
#endif
|
318 |
|
|
#else
|
319 |
|
|
#define DWARF2_UNWIND_INFO 0
|
320 |
|
|
#endif
|
321 |
|
|
#endif
|
322 |
|
|
|
323 |
|
|
/* Don't assume anything about the header files. */
|
324 |
|
|
#define NO_IMPLICIT_EXTERN_C
|
325 |
|
|
|
326 |
|
|
#undef PROFILE_HOOK
|
327 |
|
|
#define PROFILE_HOOK(LABEL) \
|
328 |
|
|
if (MAIN_NAME_P (DECL_NAME (current_function_decl))) \
|
329 |
|
|
{ \
|
330 |
|
|
emit_call_insn (gen_rtx_CALL (VOIDmode, \
|
331 |
|
|
gen_rtx_MEM (FUNCTION_MODE, \
|
332 |
|
|
gen_rtx_SYMBOL_REF (Pmode, "_monstartup")), \
|
333 |
|
|
const0_rtx)); \
|
334 |
|
|
}
|
335 |
|
|
|
336 |
|
|
/* Java Native Interface (JNI) methods on Win32 are invoked using the
|
337 |
|
|
stdcall calling convention. */
|
338 |
|
|
#undef MODIFY_JNI_METHOD_CALL
|
339 |
|
|
#define MODIFY_JNI_METHOD_CALL(MDECL) \
|
340 |
|
|
build_type_attribute_variant ((MDECL), \
|
341 |
|
|
build_tree_list (get_identifier ("stdcall"), \
|
342 |
|
|
NULL))
|
343 |
|
|
|
344 |
|
|
/* For Win32 ABI compatibility */
|
345 |
|
|
#undef DEFAULT_PCC_STRUCT_RETURN
|
346 |
|
|
#define DEFAULT_PCC_STRUCT_RETURN 0
|
347 |
|
|
|
348 |
|
|
/* MSVC returns aggregate types of up to 8 bytes via registers.
|
349 |
|
|
See i386.c:ix86_return_in_memory. */
|
350 |
|
|
#undef MS_AGGREGATE_RETURN
|
351 |
|
|
#define MS_AGGREGATE_RETURN 1
|
352 |
|
|
|
353 |
|
|
/* Biggest alignment supported by the object file format of this
|
354 |
|
|
machine. Use this macro to limit the alignment which can be
|
355 |
|
|
specified using the `__attribute__ ((aligned (N)))' construct. If
|
356 |
|
|
not defined, the default value is `BIGGEST_ALIGNMENT'. */
|
357 |
|
|
/* IMAGE_SCN_ALIGN_8192BYTES is the largest section alignment flag
|
358 |
|
|
specified in the PECOFF60 spec. Native MS compiler also limits
|
359 |
|
|
user-specified alignment to 8192 bytes. */
|
360 |
|
|
#undef MAX_OFILE_ALIGNMENT
|
361 |
|
|
#define MAX_OFILE_ALIGNMENT (8192 * 8)
|
362 |
|
|
|
363 |
|
|
/* BIGGEST_FIELD_ALIGNMENT macro is used directly by libobjc, There, we
|
364 |
|
|
align internal doubles in structures on dword boundaries. Otherwise,
|
365 |
|
|
support vector modes using ADJUST_FIELD_ALIGN, defined in i386.h. */
|
366 |
|
|
#ifdef IN_TARGET_LIBS
|
367 |
|
|
#undef BIGGEST_FIELD_ALIGNMENT
|
368 |
|
|
#define BIGGEST_FIELD_ALIGNMENT 64
|
369 |
|
|
#endif
|
370 |
|
|
|
371 |
|
|
/* A bit-field declared as `int' forces `int' alignment for the struct. */
|
372 |
|
|
#undef PCC_BITFIELD_TYPE_MATTERS
|
373 |
|
|
#define PCC_BITFIELD_TYPE_MATTERS 1
|
374 |
|
|
#define GROUP_BITFIELDS_BY_ALIGN TYPE_NATIVE(rec)
|
375 |
|
|
|
376 |
|
|
/* Enable alias attribute support. */
|
377 |
|
|
#ifndef SET_ASM_OP
|
378 |
|
|
#define SET_ASM_OP "\t.set\t"
|
379 |
|
|
#endif
|
380 |
|
|
|
381 |
|
|
/* This implements the `alias' attribute, keeping any stdcall or
|
382 |
|
|
fastcall decoration. */
|
383 |
|
|
#undef ASM_OUTPUT_DEF_FROM_DECLS
|
384 |
|
|
#define ASM_OUTPUT_DEF_FROM_DECLS(STREAM, DECL, TARGET) \
|
385 |
|
|
do \
|
386 |
|
|
{ \
|
387 |
|
|
const char *alias \
|
388 |
|
|
= IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
|
389 |
|
|
i386_pe_maybe_record_exported_symbol (DECL, alias, 0); \
|
390 |
|
|
if (TREE_CODE (DECL) == FUNCTION_DECL) \
|
391 |
|
|
i386_pe_declare_function_type (STREAM, alias, \
|
392 |
|
|
TREE_PUBLIC (DECL)); \
|
393 |
|
|
ASM_OUTPUT_DEF (STREAM, alias, IDENTIFIER_POINTER (TARGET)); \
|
394 |
|
|
} while (0)
|
395 |
|
|
|
396 |
|
|
/* GNU as supports weak symbols on PECOFF. */
|
397 |
|
|
#ifdef HAVE_GAS_WEAK
|
398 |
|
|
#define ASM_WEAKEN_LABEL(FILE, NAME) \
|
399 |
|
|
do \
|
400 |
|
|
{ \
|
401 |
|
|
fputs ("\t.weak\t", (FILE)); \
|
402 |
|
|
assemble_name ((FILE), (NAME)); \
|
403 |
|
|
fputc ('\n', (FILE)); \
|
404 |
|
|
} \
|
405 |
|
|
while (0)
|
406 |
|
|
#endif /* HAVE_GAS_WEAK */
|
407 |
|
|
|
408 |
|
|
/* FIXME: SUPPORTS_WEAK && TARGET_HAVE_NAMED_SECTIONS is true,
|
409 |
|
|
but for .jcr section to work we also need crtbegin and crtend
|
410 |
|
|
objects. */
|
411 |
|
|
#define TARGET_USE_JCR_SECTION 1
|
412 |
|
|
|
413 |
|
|
/* Decide whether it is safe to use a local alias for a virtual function
|
414 |
|
|
when constructing thunks. */
|
415 |
|
|
#undef TARGET_USE_LOCAL_THUNK_ALIAS_P
|
416 |
|
|
#define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) (!DECL_ONE_ONLY (DECL))
|
417 |
|
|
|
418 |
|
|
#define SUBTARGET_ATTRIBUTE_TABLE \
|
419 |
|
|
{ "selectany", 0, 0, true, false, false, ix86_handle_selectany_attribute }
|
420 |
|
|
/* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
|
421 |
|
|
|
422 |
|
|
/* mcount() does not need a counter variable. */
|
423 |
|
|
#undef NO_PROFILE_COUNTERS
|
424 |
|
|
#define NO_PROFILE_COUNTERS 1
|
425 |
|
|
|
426 |
|
|
#define TARGET_VALID_DLLIMPORT_ATTRIBUTE_P i386_pe_valid_dllimport_attribute_p
|
427 |
|
|
#define TARGET_CXX_ADJUST_CLASS_AT_DEFINITION i386_pe_adjust_class_at_definition
|
428 |
|
|
#define TARGET_MANGLE_DECL_ASSEMBLER_NAME i386_pe_mangle_decl_assembler_name
|
429 |
|
|
|
430 |
|
|
#undef TREE
|
431 |
|
|
|
432 |
|
|
#ifndef BUFSIZ
|
433 |
|
|
# undef FILE
|
434 |
|
|
#endif
|