* tcoff.h (USER_LABEL_PREFIX): Make it empty to match coff.h.
[official-gcc.git] / gcc / config / arm / tcoff.h
blob6fa4705b5044e3aecc999465f78ca24fc0785526
1 /* Definitions of target machine for GNU compiler,
2 for Thumb with COFF obj format.
3 Copyright (C) 1995, 1996 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 /* Note - it is important that these definitions match those in semi.h for the ARM port. */
48 #undef LOCAL_LABEL_PREFIX
49 #define LOCAL_LABEL_PREFIX "."
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 extern char *version_string; \
64 fprintf ((STREAM), "%s Generated by gcc %s for Thumb/coff\n", \
65 ASM_COMMENT_START, version_string); \
66 fprintf ((STREAM), ASM_APP_OFF); \
67 } while (0)
69 /* A C statement to output something to the assembler file to switch to section
70 NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or
71 NULL_TREE. Some target formats do not support arbitrary sections. Do not
72 define this macro in such cases. */
73 #define ASM_OUTPUT_SECTION_NAME(STREAM, DECL, NAME, RELOC) \
74 do { \
75 if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL) \
76 fprintf (STREAM, "\t.section %s,\"x\"\n", (NAME)); \
77 else if ((DECL) && DECL_READONLY_SECTION (DECL, RELOC)) \
78 fprintf (STREAM, "\t.section %s,\"\"\n", (NAME)); \
79 else \
80 fprintf (STREAM, "\t.section %s,\"w\"\n", (NAME)); \
81 } while (0)
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"
97 #undef CTORS_SECTION_ASM_OP
98 #define CTORS_SECTION_ASM_OP "\t.section .ctors,\"x\""
99 #undef DTORS_SECTION_ASM_OP
100 #define DTORS_SECTION_ASM_OP "\t.section .dtors,\"x\""
102 /* A list of other sections which the compiler might be "in" at any
103 given time. */
105 #undef EXTRA_SECTIONS
106 #define EXTRA_SECTIONS SUBTARGET_EXTRA_SECTIONS in_rdata, in_ctors, in_dtors
108 #define SUBTARGET_EXTRA_SECTIONS
110 /* A list of extra section function definitions. */
112 #undef EXTRA_SECTION_FUNCTIONS
113 #define EXTRA_SECTION_FUNCTIONS \
114 RDATA_SECTION_FUNCTION \
115 CTORS_SECTION_FUNCTION \
116 DTORS_SECTION_FUNCTION \
117 SUBTARGET_EXTRA_SECTION_FUNCTIONS
119 #define SUBTARGET_EXTRA_SECTION_FUNCTIONS
121 #define RDATA_SECTION_FUNCTION \
122 void \
123 rdata_section () \
125 if (in_section != in_rdata) \
127 fprintf (asm_out_file, "%s\n", RDATA_SECTION_ASM_OP); \
128 in_section = in_rdata; \
132 #define CTORS_SECTION_FUNCTION \
133 void \
134 ctors_section () \
136 if (in_section != in_ctors) \
138 fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
139 in_section = in_ctors; \
143 #define DTORS_SECTION_FUNCTION \
144 void \
145 dtors_section () \
147 if (in_section != in_dtors) \
149 fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
150 in_section = in_dtors; \
154 /* Support the ctors/dtors sections for g++. */
156 #define INT_ASM_OP ".word"
158 /* A C statement (sans semicolon) to output an element in the table of
159 global constructors. */
160 #undef ASM_OUTPUT_CONSTRUCTOR
161 #define ASM_OUTPUT_CONSTRUCTOR(STREAM,NAME) \
162 do { \
163 ctors_section (); \
164 fprintf (STREAM, "\t%s\t ", INT_ASM_OP); \
165 assemble_name (STREAM, NAME); \
166 fprintf (STREAM, "\n"); \
167 } while (0)
169 /* A C statement (sans semicolon) to output an element in the table of
170 global destructors. */
171 #undef ASM_OUTPUT_DESTRUCTOR
172 #define ASM_OUTPUT_DESTRUCTOR(STREAM,NAME) \
173 do { \
174 dtors_section (); \
175 fprintf (STREAM, "\t%s\t ", INT_ASM_OP); \
176 assemble_name (STREAM, NAME); \
177 fprintf (STREAM, "\n"); \
178 } while (0)
180 /* __CTOR_LIST__ and __DTOR_LIST__ must be defined by the linker script. */
181 #define CTOR_LISTS_DEFINED_EXTERNALLY
183 #undef DO_GLOBAL_CTORS_BODY
184 #undef DO_GLOBAL_DTORS_BODY
186 /* The ARM development system has atexit and doesn't have _exit,
187 so define this for now. */
188 #define HAVE_ATEXIT
190 /* The ARM development system defines __main. */
191 #define NAME__MAIN "__gccmain"
192 #define SYMBOL__MAIN __gccmain