Initial revision
[official-gcc.git] / gcc / config / arm / coff.h
blobabba7c6b787d520f2691392fcd54411f6dd22e6c
1 /* Definitions of target machine for GNU compiler,
2 for ARM with COFF obj format.
3 Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
4 Contributed by Doug Evans (dje@cygnus.com).
6 This file is part of GNU CC.
8 GNU CC 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 GNU CC 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 GNU CC; 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 #include "arm/semi.h"
25 /* Run-time Target Specification. */
26 #undef TARGET_VERSION
27 #define TARGET_VERSION fputs (" (ARM/coff)", stderr)
29 /* ??? Maybe use --with{enable?}-fpu or some such to make hardware floating
30 point the default. NOT --nfp! --with{enable?} is supposed to replace it
31 (right?), so let's stop using it. */
32 #undef TARGET_DEFAULT
33 #define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT /*+ TARGET_CPU_DEFAULT*/)
35 /* ??? Is a big-endian default intended to be supported? */
36 #if 0 /*TARGET_CPU_DEFAULT & ARM_FLAG_BIG_END*/
37 #define MULTILIB_DEFAULTS { "mbig-endian" }
38 #else
39 #define MULTILIB_DEFAULTS { "mlittle-endian" }
40 #endif
42 /* ??? Does arm.h really need to set this to 32? */
43 #undef STRUCTURE_SIZE_BOUNDARY
44 #define STRUCTURE_SIZE_BOUNDARY 8
46 /* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
47 is a valid machine specific attribute for DECL.
48 The attributes in ATTRIBUTES have previously been assigned to DECL. */
49 extern int arm_valid_machine_decl_attribute ();
50 #define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \
51 arm_valid_machine_decl_attribute (DECL, ATTRIBUTES, IDENTIFIER, ARGS)
53 /* This is COFF, but prefer stabs. */
54 #define SDB_DEBUGGING_INFO
56 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
58 #include "dbxcoff.h"
60 #undef LOCAL_LABEL_PREFIX
61 #define LOCAL_LABEL_PREFIX "."
63 #undef USER_LABEL_PREFIX
64 #define USER_LABEL_PREFIX ""
66 /* A C statement to output assembler commands which will identify the
67 object file as having been compiled with GNU CC (or another GNU
68 compiler). */
69 /* Define this to NULL so we don't get anything.
70 We have ASM_IDENTIFY_LANGUAGE.
71 Also, when using stabs, gcc2_compiled must be a stabs entry, not an
72 ordinary symbol, or gdb won't see it. The stabs entry must be
73 before the N_SO in order for gdb to find it. */
74 #define ASM_IDENTIFY_GCC(STREAM)
76 /* This outputs a lot of .req's to define alias for various registers.
77 Let's try to avoid this. */
78 #undef ASM_FILE_START
79 #define ASM_FILE_START(STREAM) \
80 do { \
81 extern char *version_string; \
82 fprintf (STREAM, "%s Generated by gcc %s for ARM/coff\n", \
83 ASM_COMMENT_START, version_string); \
84 } while (0)
86 /* A C statement to output something to the assembler file to switch to section
87 NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or
88 NULL_TREE. Some target formats do not support arbitrary sections. Do not
89 define this macro in such cases. */
90 #define ASM_OUTPUT_SECTION_NAME(STREAM, DECL, NAME, RELOC) \
91 do { \
92 if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL) \
93 fprintf (STREAM, "\t.section %s,\"x\"\n", (NAME)); \
94 else if ((DECL) && DECL_READONLY_SECTION (DECL, RELOC)) \
95 fprintf (STREAM, "\t.section %s,\"\"\n", (NAME)); \
96 else \
97 fprintf (STREAM, "\t.section %s,\"w\"\n", (NAME)); \
98 } while (0)
100 /* Support the ctors/dtors and other sections. */
102 #undef INIT_SECTION_ASM_OP
104 /* Define this macro if jump tables (for `tablejump' insns) should be
105 output in the text section, along with the assembler instructions.
106 Otherwise, the readonly data section is used. */
107 #define JUMP_TABLES_IN_TEXT_SECTION
109 #undef READONLY_DATA_SECTION
110 #define READONLY_DATA_SECTION rdata_section
111 #undef RDATA_SECTION_ASM_OP
112 #define RDATA_SECTION_ASM_OP "\t.section .rdata"
114 #undef CTORS_SECTION_ASM_OP
115 #define CTORS_SECTION_ASM_OP "\t.section .ctors,\"x\""
116 #undef DTORS_SECTION_ASM_OP
117 #define DTORS_SECTION_ASM_OP "\t.section .dtors,\"x\""
119 /* A list of other sections which the compiler might be "in" at any
120 given time. */
122 #undef EXTRA_SECTIONS
123 #define EXTRA_SECTIONS SUBTARGET_EXTRA_SECTIONS in_rdata, in_ctors, in_dtors
125 #define SUBTARGET_EXTRA_SECTIONS
127 /* A list of extra section function definitions. */
129 #undef EXTRA_SECTION_FUNCTIONS
130 #define EXTRA_SECTION_FUNCTIONS \
131 RDATA_SECTION_FUNCTION \
132 CTORS_SECTION_FUNCTION \
133 DTORS_SECTION_FUNCTION \
134 SUBTARGET_EXTRA_SECTION_FUNCTIONS
136 #define SUBTARGET_EXTRA_SECTION_FUNCTIONS
138 #define RDATA_SECTION_FUNCTION \
139 void \
140 rdata_section () \
142 if (in_section != in_rdata) \
144 fprintf (asm_out_file, "%s\n", RDATA_SECTION_ASM_OP); \
145 in_section = in_rdata; \
149 #define CTORS_SECTION_FUNCTION \
150 void \
151 ctors_section () \
153 if (in_section != in_ctors) \
155 fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
156 in_section = in_ctors; \
160 #define DTORS_SECTION_FUNCTION \
161 void \
162 dtors_section () \
164 if (in_section != in_dtors) \
166 fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
167 in_section = in_dtors; \
171 /* Support the ctors/dtors sections for g++. */
173 #define INT_ASM_OP ".word"
175 /* A C statement (sans semicolon) to output an element in the table of
176 global constructors. */
177 #undef ASM_OUTPUT_CONSTRUCTOR
178 #define ASM_OUTPUT_CONSTRUCTOR(STREAM,NAME) \
179 do { \
180 ctors_section (); \
181 fprintf (STREAM, "\t%s\t ", INT_ASM_OP); \
182 assemble_name (STREAM, NAME); \
183 fprintf (STREAM, "\n"); \
184 } while (0)
186 /* A C statement (sans semicolon) to output an element in the table of
187 global destructors. */
188 #undef ASM_OUTPUT_DESTRUCTOR
189 #define ASM_OUTPUT_DESTRUCTOR(STREAM,NAME) \
190 do { \
191 dtors_section (); \
192 fprintf (STREAM, "\t%s\t ", INT_ASM_OP); \
193 assemble_name (STREAM, NAME); \
194 fprintf (STREAM, "\n"); \
195 } while (0)
197 /* __CTOR_LIST__ and __DTOR_LIST__ must be defined by the linker script. */
198 #define CTOR_LISTS_DEFINED_EXTERNALLY
200 #undef DO_GLOBAL_CTORS_BODY
201 #undef DO_GLOBAL_DTORS_BODY
203 /* The ARM development system has atexit and doesn't have _exit,
204 so define this for now. */
205 #define HAVE_ATEXIT
207 /* The ARM development system defines __main. */
208 #define NAME__MAIN "__gccmain"
209 #define SYMBOL__MAIN __gccmain