1 /* Definitions of target machine for GNU compiler.
2 For ARM with COFF object format.
3 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000
4 Free Software Foundation, Inc.
5 Contributed by Doug Evans (devans@cygnus.com).
7 This file is part of GNU CC.
9 GNU CC 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 2, or (at your option)
14 GNU CC 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.
19 You should have received a copy of the GNU General Public License
20 along with GNU CC; see the file COPYING. If not, write to
21 the Free Software Foundation, 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. */
27 /* Note - it is important that this definition matches the one in tcoff.h */
28 #undef USER_LABEL_PREFIX
29 #define USER_LABEL_PREFIX "_"
32 /* Run-time Target Specification. */
34 #define TARGET_VERSION fputs (" (ARM/coff)", stderr)
37 #define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME)
39 #ifndef MULTILIB_DEFAULTS
40 #define MULTILIB_DEFAULTS \
41 { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" }
44 /* This is COFF, but prefer stabs. */
45 #define SDB_DEBUGGING_INFO
47 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
51 /* A C statement to output assembler commands which will identify the
52 object file as having been compiled with GNU CC (or another GNU
55 /* This outputs a lot of .req's to define alias for various registers.
56 Let's try to avoid this. */
58 #define ASM_FILE_START(STREAM) \
61 fprintf (STREAM, "%s Generated by gcc %s for ARM/coff\n", \
62 ASM_COMMENT_START, version_string); \
63 fprintf (STREAM, ASM_APP_OFF); \
67 /* A C statement to output something to the assembler file to switch to
68 section NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or
69 NULL_TREE. Some target formats do not support arbitrary sections. Do not
70 define this macro in such cases. */
71 #define ASM_OUTPUT_SECTION_NAME(STREAM, DECL, NAME, RELOC) \
74 if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL) \
75 fprintf (STREAM, "\t.section %s,\"x\"\n", (NAME)); \
76 else if ((DECL) && DECL_READONLY_SECTION (DECL, RELOC)) \
77 fprintf (STREAM, "\t.section %s,\"\"\n", (NAME)); \
79 fprintf (STREAM, "\t.section %s,\"w\"\n", (NAME)); \
83 /* Support the ctors/dtors and other sections. */
85 #undef INIT_SECTION_ASM_OP
87 /* Define this macro if jump tables (for `tablejump' insns) should be
88 output in the text section, along with the assembler instructions.
89 Otherwise, the readonly data section is used. */
90 #define JUMP_TABLES_IN_TEXT_SECTION 1
92 #undef READONLY_DATA_SECTION
93 #define READONLY_DATA_SECTION rdata_section
94 #undef RDATA_SECTION_ASM_OP
95 #define RDATA_SECTION_ASM_OP "\t.section .rdata"
96 #undef CTORS_SECTION_ASM_OP
97 #define CTORS_SECTION_ASM_OP "\t.section .ctors,\"x\""
98 #undef DTORS_SECTION_ASM_OP
99 #define DTORS_SECTION_ASM_OP "\t.section .dtors,\"x\""
101 /* A list of other sections which the compiler might be "in" at any
104 #undef EXTRA_SECTIONS
105 #define EXTRA_SECTIONS SUBTARGET_EXTRA_SECTIONS in_rdata, in_ctors, in_dtors
107 #define SUBTARGET_EXTRA_SECTIONS
109 /* A list of extra section function definitions. */
111 #undef EXTRA_SECTION_FUNCTIONS
112 #define EXTRA_SECTION_FUNCTIONS \
113 RDATA_SECTION_FUNCTION \
114 CTORS_SECTION_FUNCTION \
115 DTORS_SECTION_FUNCTION \
116 SUBTARGET_EXTRA_SECTION_FUNCTIONS
118 #define SUBTARGET_EXTRA_SECTION_FUNCTIONS
120 #define RDATA_SECTION_FUNCTION \
124 if (in_section != in_rdata) \
126 fprintf (asm_out_file, "%s\n", RDATA_SECTION_ASM_OP); \
127 in_section = in_rdata; \
131 #define CTORS_SECTION_FUNCTION \
135 if (in_section != in_ctors) \
137 fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
138 in_section = in_ctors; \
142 #define DTORS_SECTION_FUNCTION \
146 if (in_section != in_dtors) \
148 fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
149 in_section = in_dtors; \
153 /* Support the ctors/dtors sections for g++. */
155 #define INT_ASM_OP "\t.word\t"
157 /* A C statement (sans semicolon) to output an element in the table of
158 global constructors. */
159 #undef ASM_OUTPUT_CONSTRUCTOR
160 #define ASM_OUTPUT_CONSTRUCTOR(STREAM, NAME) \
164 fprintf (STREAM, "%s", INT_ASM_OP); \
165 assemble_name (STREAM, NAME); \
166 fprintf (STREAM, "\n"); \
170 /* A C statement (sans semicolon) to output an element in the table of
171 global destructors. */
172 #undef ASM_OUTPUT_DESTRUCTOR
173 #define ASM_OUTPUT_DESTRUCTOR(STREAM, NAME) \
177 fprintf (STREAM, "%s", INT_ASM_OP); \
178 assemble_name (STREAM, NAME); \
179 fprintf (STREAM, "\n"); \
183 /* __CTOR_LIST__ and __DTOR_LIST__ must be defined by the linker script. */
184 #define CTOR_LISTS_DEFINED_EXTERNALLY
186 #undef DO_GLOBAL_CTORS_BODY
187 #undef DO_GLOBAL_DTORS_BODY
189 /* The ARM development system defines __main. */
190 #define NAME__MAIN "__gccmain"
191 #define SYMBOL__MAIN __gccmain