PR target/16201
[official-gcc.git] / gcc / config / mcore / mcore-pe.h
blob2abe38abcfae5fdd13292ccd7a320f97ab16b533
1 /* Definitions of target machine for GNU compiler, for MCore using COFF/PE.
2 Copyright (C) 1994, 1999, 2000, 2002, 2003, 2004
3 Free Software Foundation, Inc.
4 Contributed by Michael Tiemann (tiemann@cygnus.com).
6 This file is part of GCC.
8 GCC 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)
11 any later version.
13 GCC 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 GCC; 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 /* Run-time Target Specification. */
24 #define TARGET_VERSION fputs (" (MCORE/pe)", stderr)
26 #define TARGET_OS_CPP_BUILTINS() \
27 do \
28 { \
29 builtin_define ("__pe__"); \
30 } \
31 while (0)
33 /* The MCore ABI says that bitfields are unsigned by default. */
34 /* The EPOC C++ environment does not support exceptions. */
35 #undef CC1_SPEC
36 #define CC1_SPEC "-funsigned-bitfields %{!DIN_GCC:-fno-rtti} %{!DIN_GCC:-fno-exceptions}"
38 #undef SDB_DEBUGGING_INFO
39 #define DBX_DEBUGGING_INFO 1
41 /* Computed in toplev.c. */
42 #undef PREFERRED_DEBUGGING_TYPE
44 /* Lay out additional 'sections' where we place things like code
45 and readonly data. This gets them out of default places. */
47 #define SUBTARGET_SWITCH_SECTIONS \
48 case in_drectve: drectve_section (); break;
50 #define DRECTVE_SECTION_ASM_OP "\t.section .drectve"
51 #define READONLY_DATA_SECTION_ASM_OP "\t.section .rdata"
53 #define SUBTARGET_EXTRA_SECTIONS in_drectve
55 #define SUBTARGET_EXTRA_SECTION_FUNCTIONS \
56 DRECTVE_SECTION_FUNCTION
58 #define DRECTVE_SECTION_FUNCTION \
59 void \
60 drectve_section () \
61 { \
62 if (in_section != in_drectve) \
63 { \
64 fprintf (asm_out_file, "%s\n", DRECTVE_SECTION_ASM_OP); \
65 in_section = in_drectve; \
66 } \
69 #define MCORE_EXPORT_NAME(STREAM, NAME) \
70 do \
71 { \
72 drectve_section (); \
73 fprintf (STREAM, "\t.ascii \" -export:%s\"\n", \
74 (* targetm.strip_name_encoding) (NAME)); \
75 } \
76 while (0);
78 /* Output the label for an initialized variable. */
79 #undef ASM_DECLARE_OBJECT_NAME
80 #define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
81 do \
82 { \
83 if (mcore_dllexport_name_p (NAME)) \
84 { \
85 enum in_section save_section = in_section; \
86 MCORE_EXPORT_NAME (STREAM, NAME); \
87 switch_to_section (save_section, (DECL)); \
88 } \
89 ASM_OUTPUT_LABEL ((STREAM), (NAME)); \
90 } \
91 while (0)
93 /* Output a function label definition. */
94 #define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \
95 do \
96 { \
97 if (mcore_dllexport_name_p (NAME)) \
98 { \
99 MCORE_EXPORT_NAME (STREAM, NAME); \
100 function_section (DECL); \
102 ASM_OUTPUT_LABEL ((STREAM), (NAME)); \
104 while (0);
106 #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
108 #define DBX_LINES_FUNCTION_RELATIVE 1
110 #define STARTFILE_SPEC "crt0.o%s"
111 #define ENDFILE_SPEC "%{!mno-lsim:-lsim}"
113 /* __CTOR_LIST__ and __DTOR_LIST__ must be defined by the linker script. */
114 #define CTOR_LISTS_DEFINED_EXTERNALLY
116 #undef DO_GLOBAL_CTORS_BODY
117 #undef DO_GLOBAL_DTORS_BODY
118 #undef INIT_SECTION_ASM_OP
119 #undef DTORS_SECTION_ASM_OP
121 #define SUPPORTS_ONE_ONLY 1
123 /* Switch into a generic section. */
124 #undef TARGET_ASM_NAMED_SECTION
125 #define TARGET_ASM_NAMED_SECTION default_pe_asm_named_section