config.gcc (*-*-linux*): Don't define HAVE_ATEXIT or BSTRING.
[gcc.git] / gcc / config / arm / conix-elf.h
1 /* Definitions of target machine for GNU compiler,
2 for ARM with ConiX OS.
3 Copyright (C) 2000 Free Software Foundation, Inc.
4 Contributed by Philip Blundell <pb@futuretv.com>
5
6 This file is part of GNU CC.
7
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.
12
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.
17
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. */
22
23 /* Run-time Target Specification. */
24 #ifndef TARGET_VERSION
25 #define TARGET_VERSION fputs (" (ARM/ELF ConiX)", stderr);
26 #endif
27
28 /* Default to using APCS-32 and software floating point. */
29 #ifndef TARGET_DEFAULT
30 #define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32)
31 #endif
32
33 /* Now we define the strings used to build the spec file. */
34 #define STARTFILE_SPEC "crtbegin%O%s crt0%O%s"
35
36 #define ENDFILE_SPEC "crtend%O%s"
37
38 #define USER_LABEL_PREFIX ""
39 #define LOCAL_LABEL_PREFIX "."
40
41 #define TEXT_SECTION "\t.text"
42
43 /* Debugging */
44 #define DWARF2_DEBUGGING_INFO
45 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
46
47 /* Support for Constructors and Destructors. */
48 #define READONLY_DATA_SECTION rdata_section
49
50 /* A list of other sections which the compiler might be "in" at any
51 given time. */
52 #define SUBTARGET_EXTRA_SECTIONS in_rdata,
53
54 /* A list of extra section function definitions. */
55 #define SUBTARGET_EXTRA_SECTION_FUNCTIONS RDATA_SECTION_FUNCTION
56
57 #define RDATA_SECTION_ASM_OP "\t.section .rodata"
58
59 #define RDATA_SECTION_FUNCTION \
60 void \
61 rdata_section () \
62 { \
63 if (in_section != in_rdata) \
64 { \
65 fprintf (asm_out_file, "%s\n", RDATA_SECTION_ASM_OP); \
66 in_section = in_rdata; \
67 } \
68 }
69
70 #define CTOR_LIST_BEGIN \
71 asm (CTORS_SECTION_ASM_OP); \
72 func_ptr __CTOR_LIST__[1] = { (func_ptr) (-1) }
73
74 #define CTOR_LIST_END \
75 asm (CTORS_SECTION_ASM_OP); \
76 func_ptr __CTOR_END__[1] = { (func_ptr) 0 };
77
78 #define DTOR_LIST_BEGIN \
79 asm (DTORS_SECTION_ASM_OP); \
80 func_ptr __DTOR_LIST__[1] = { (func_ptr) (-1) }
81
82 #define DTOR_LIST_END \
83 asm (DTORS_SECTION_ASM_OP); \
84 func_ptr __DTOR_END__[1] = { (func_ptr) 0 };
85
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 { \
93 if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL) \
94 fprintf (STREAM, "\t.section %s,\"ax\",@progbits\n", (NAME)); \
95 else if ((DECL) && DECL_READONLY_SECTION (DECL, RELOC)) \
96 fprintf (STREAM, "\t.section %s,\"a\"\n", (NAME)); \
97 else \
98 fprintf (STREAM, "\t.section %s,\"aw\"\n", (NAME)); \
99 } \
100 while (0)
101
102 /* Don't know how to order these. UNALIGNED_WORD_ASM_OP is in
103 dwarf2.out. */
104 #define UNALIGNED_WORD_ASM_OP "\t.4byte\t"
105
106 #define ASM_OUTPUT_DWARF2_ADDR_CONST(FILE,ADDR) \
107 fprintf ((FILE), "%s%s", UNALIGNED_WORD_ASM_OP, ADDR)
108
109 #define ASM_OUTPUT_DWARF_ADDR_CONST(FILE,RTX) \
110 do \
111 { \
112 fprintf ((FILE), "%s", UNALIGNED_WORD_ASM_OP); \
113 output_addr_const ((FILE), (RTX)); \
114 fputc ('\n', (FILE)); \
115 } \
116 while (0)
117
118
119 /* The ARM development system defines __main. */
120 #define NAME__MAIN "__gccmain"
121 #define SYMBOL__MAIN __gccmain
122
123 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
124 #define UNIQUE_SECTION_P(DECL) (DECL_ONE_ONLY (DECL))
125 #define UNIQUE_SECTION(DECL,RELOC) \
126 do \
127 { \
128 int len; \
129 char * name, * string, * prefix; \
130 \
131 name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
132 \
133 if (! DECL_ONE_ONLY (DECL)) \
134 { \
135 prefix = "."; \
136 if (TREE_CODE (DECL) == FUNCTION_DECL) \
137 prefix = ".text."; \
138 else if (DECL_READONLY_SECTION (DECL, RELOC)) \
139 prefix = ".rodata."; \
140 else \
141 prefix = ".data."; \
142 } \
143 else if (TREE_CODE (DECL) == FUNCTION_DECL) \
144 prefix = ".gnu.linkonce.t."; \
145 else if (DECL_READONLY_SECTION (DECL, RELOC)) \
146 prefix = ".gnu.linkonce.r."; \
147 else \
148 prefix = ".gnu.linkonce.d."; \
149 \
150 len = strlen (name) + strlen (prefix); \
151 string = alloca (len + 1); \
152 sprintf (string, "%s%s", prefix, name); \
153 \
154 DECL_SECTION_NAME (DECL) = build_string (len, string); \
155 } \
156 while (0)
157
158 #ifndef CPP_APCS_PC_DEFAULT_SPEC
159 #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
160 #endif
161
162 #ifndef SUBTARGET_CPU_DEFAULT
163 #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm7tdmi
164 #endif
165
166 #define CPP_PREDEFINES \
167 "-D__arm__ -D__CONIX__ -Acpu=arm -Amachine=arm -D__ELF__"
168
169 /* Now get the routine arm-elf definitions. */
170 #include "arm/elf.h"