* target.h (asm_out.file_start, file_start_app_off,
[official-gcc.git] / gcc / config / mcore / mcore-pe.h
blob35055e5762f60223ab6784192a3a9a4f7d4a4871
1 /* Definitions of target machine for GNU compiler, for MCore using COFF/PE.
2 Copyright (C) 1994, 1999, 2000, 2002 Free Software Foundation, Inc.
3 Contributed by Michael Tiemann (tiemann@cygnus.com).
5 This file is part of GNU CC.
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 /* Run-time Target Specification. */
23 #define TARGET_VERSION fputs (" (MCORE/pe)", stderr)
25 #define TARGET_OS_CPP_BUILTINS() \
26 do \
27 { \
28 builtin_define ("__pe__"); \
29 } \
30 while (0)
32 /* The MCore ABI says that bitfields are unsigned by default. */
33 /* The EPOC C++ environment does not support exceptions. */
34 #define CC1_SPEC "-funsigned-bitfields %{!DIN_GCC:-fno-rtti} %{!DIN_GCC:-fno-exceptions}"
36 #include "svr3.h"
37 #include "mcore/mcore.h"
38 #include "dbxcoff.h"
40 #undef SDB_DEBUGGING_INFO
41 #define DBX_DEBUGGING_INFO 1
43 /* Computed in toplev.c. */
44 #undef PREFERRED_DEBUGGING_TYPE
46 /* Lay out additional 'sections' where we place things like code
47 and readonly data. This gets them out of default places. */
49 #define SUBTARGET_SWITCH_SECTIONS \
50 case in_drectve: drectve_section (); break;
52 #define DRECTVE_SECTION_ASM_OP "\t.section .drectve"
53 #define READONLY_DATA_SECTION_ASM_OP "\t.section .rdata"
55 #define SUBTARGET_EXTRA_SECTIONS in_drectve
57 #define SUBTARGET_EXTRA_SECTION_FUNCTIONS \
58 DRECTVE_SECTION_FUNCTION
60 #define DRECTVE_SECTION_FUNCTION \
61 void \
62 drectve_section () \
63 { \
64 if (in_section != in_drectve) \
65 { \
66 fprintf (asm_out_file, "%s\n", DRECTVE_SECTION_ASM_OP); \
67 in_section = in_drectve; \
68 } \
71 #define MCORE_EXPORT_NAME(STREAM, NAME) \
72 do \
73 { \
74 drectve_section (); \
75 fprintf (STREAM, "\t.ascii \" -export:%s\"\n", \
76 (* targetm.strip_name_encoding) (NAME)); \
77 } \
78 while (0);
80 /* Output the label for an initialized variable. */
81 #undef ASM_DECLARE_OBJECT_NAME
82 #define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
83 do \
84 { \
85 if (mcore_dllexport_name_p (NAME)) \
86 { \
87 enum in_section save_section = in_section; \
88 MCORE_EXPORT_NAME (STREAM, NAME); \
89 switch_to_section (save_section, (DECL)); \
90 } \
91 ASM_OUTPUT_LABEL ((STREAM), (NAME)); \
92 } \
93 while (0)
95 /* Output a function label definition. */
96 #define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \
97 do \
98 { \
99 if (mcore_dllexport_name_p (NAME)) \
101 MCORE_EXPORT_NAME (STREAM, NAME); \
102 function_section (DECL); \
104 ASM_OUTPUT_LABEL ((STREAM), (NAME)); \
106 while (0);
108 #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
110 #undef ASM_OUTPUT_SOURCE_LINE
111 #define ASM_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \
113 if (write_symbols == DBX_DEBUG) \
115 char buffer[256]; \
117 ASM_GENERATE_INTERNAL_LABEL (buffer, "LM", COUNTER); \
118 fprintf (FILE, ".stabn 68,0,%d,", LINE); \
119 assemble_name (FILE, buffer); \
120 putc ('-', FILE); \
121 assemble_name (FILE, \
122 XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
123 putc ('\n', FILE); \
124 (*targetm.asm_out.internal_label) (FILE, "LM", COUNTER); \
128 #define STARTFILE_SPEC "crt0.o%s"
129 #define ENDFILE_SPEC "%{!mno-lsim:-lsim}"
131 /* __CTOR_LIST__ and __DTOR_LIST__ must be defined by the linker script. */
132 #define CTOR_LISTS_DEFINED_EXTERNALLY
134 #undef DO_GLOBAL_CTORS_BODY
135 #undef DO_GLOBAL_DTORS_BODY
136 #undef INIT_SECTION_ASM_OP
137 #undef DTORS_SECTION_ASM_OP
139 #define SUPPORTS_ONE_ONLY 1
141 /* Switch into a generic section. */
142 #undef TARGET_ASM_NAMED_SECTION
143 #define TARGET_ASM_NAMED_SECTION default_pe_asm_named_section