Daily bump.
[official-gcc.git] / gcc / config / arm / tcoff.h
blob37870022d1e5a3cc14921e68f77e5687561a2c6f
1 /* Definitions of target machine for GNU compiler,
2 for Thumb with COFF obj format.
3 Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc.
4 Derived from arm/coff.h originally 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/thumb.h"
25 /* Run-time Target Specification. */
26 #undef TARGET_VERSION
27 #define TARGET_VERSION fputs (" (Thumb/coff)", stderr)
29 #define MULTILIB_DEFAULTS { "mlittle-endian" }
31 /* Setting this to 32 produces more efficient code, but the value set in previous
32 versions of this toolchain was 8, which produces more compact structures. The
33 command line option -mstructure_size_boundary=<n> can be used to change this
34 value. */
35 #undef STRUCTURE_SIZE_BOUNDARY
36 #define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary
38 extern int arm_structure_size_boundary;
40 /* This is COFF, but prefer stabs. */
41 #define SDB_DEBUGGING_INFO
43 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
45 #include "dbxcoff.h"
47 #undef LOCAL_LABEL_PREFIX
48 #define LOCAL_LABEL_PREFIX "."
50 /* Note - it is important that this definition matches the one in coff.h */
51 #undef USER_LABEL_PREFIX
52 #define USER_LABEL_PREFIX "_"
54 /* A C statement to output assembler commands which will identify the
55 object file as having been compiled with GNU CC (or another GNU
56 compiler). */
57 #define ASM_IDENTIFY_GCC(STREAM) \
58 fprintf (STREAM, "%sgcc2_compiled.:\n", LOCAL_LABEL_PREFIX )
60 #undef ASM_FILE_START
61 #define ASM_FILE_START(STREAM) \
62 do { \
63 fprintf ((STREAM), "%s Generated by gcc %s for Thumb/coff\n", \
64 ASM_COMMENT_START, version_string); \
65 fprintf ((STREAM), ASM_APP_OFF); \
66 } while (0)
68 /* A C statement to output something to the assembler file to switch to section
69 NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or
70 NULL_TREE. Some target formats do not support arbitrary sections. Do not
71 define this macro in such cases. */
72 #define ASM_OUTPUT_SECTION_NAME(STREAM, DECL, NAME, RELOC) \
73 do { \
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)); \
78 else \
79 fprintf (STREAM, "\t.section %s,\"w\"\n", (NAME)); \
80 } while (0)
82 /* Support the ctors/dtors and other sections. */
84 #undef INIT_SECTION_ASM_OP
86 /* Define this macro if jump tables (for `tablejump' insns) should be
87 output in the text section, along with the assembler instructions.
88 Otherwise, the readonly data section is used. */
89 #define JUMP_TABLES_IN_TEXT_SECTION 1
91 #undef READONLY_DATA_SECTION
92 #define READONLY_DATA_SECTION rdata_section
93 #undef RDATA_SECTION_ASM_OP
94 #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
102 given time. */
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 \
121 void \
122 rdata_section () \
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 \
132 void \
133 ctors_section () \
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 \
143 void \
144 dtors_section () \
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 ".word"
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) \
161 do { \
162 ctors_section (); \
163 fprintf (STREAM, "\t%s\t ", INT_ASM_OP); \
164 assemble_name (STREAM, NAME); \
165 fprintf (STREAM, "\n"); \
166 } while (0)
168 /* A C statement (sans semicolon) to output an element in the table of
169 global destructors. */
170 #undef ASM_OUTPUT_DESTRUCTOR
171 #define ASM_OUTPUT_DESTRUCTOR(STREAM,NAME) \
172 do { \
173 dtors_section (); \
174 fprintf (STREAM, "\t%s\t ", INT_ASM_OP); \
175 assemble_name (STREAM, NAME); \
176 fprintf (STREAM, "\n"); \
177 } while (0)
179 /* __CTOR_LIST__ and __DTOR_LIST__ must be defined by the linker script. */
180 #define CTOR_LISTS_DEFINED_EXTERNALLY
182 #undef DO_GLOBAL_CTORS_BODY
183 #undef DO_GLOBAL_DTORS_BODY
185 /* The ARM development system defines __main. */
186 #define NAME__MAIN "__gccmain"
187 #define SYMBOL__MAIN __gccmain