]>
Commit | Line | Data |
---|---|---|
81910840 TW |
1 | /* Definitions of target machine for GNU compiler. |
2 | Motorola m88100 running DG/UX. | |
44ae13fb | 3 | Copyright (C) 1988, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. |
81910840 | 4 | Contributed by Michael Tiemann (tiemann@mcc.com) |
1f29c913 | 5 | Currently maintained by (gcc@dg-rtp.dg.com) |
81910840 TW |
6 | |
7 | This file is part of GNU CC. | |
8 | ||
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) | |
12 | any later version. | |
13 | ||
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. | |
18 | ||
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 | |
0e29e3c9 RK |
21 | the Free Software Foundation, 59 Temple Place - Suite 330, |
22 | Boston, MA 02111-1307, USA. */ | |
81910840 TW |
23 | |
24 | /* You're not seeing double! To transition to dwarf debugging, both are | |
50eb31b2 SC |
25 | supported. The option -msvr4 specifies elf. With these combinations, |
26 | -g means dwarf. */ | |
81910840 TW |
27 | /* DWARF_DEBUGGING_INFO defined in svr4.h. */ |
28 | #define SDB_DEBUGGING_INFO | |
29 | #define PREFERRED_DEBUGGING_TYPE \ | |
50eb31b2 | 30 | (TARGET_SVR4 ? DWARF_DEBUG : SDB_DEBUG) |
81910840 | 31 | |
50eb31b2 | 32 | #ifndef VERSION_INFO2 |
861bb6c1 | 33 | #define VERSION_INFO2 "$Revision: 1.24 $" |
50eb31b2 | 34 | #endif |
81910840 TW |
35 | #ifndef NO_BUGS |
36 | #define AS_BUG_IMMEDIATE_LABEL | |
29f10484 TW |
37 | /* The DG/UX 4.30 assembler doesn't accept the symbol `fcr63'. */ |
38 | #define AS_BUG_FLDCR | |
81910840 TW |
39 | #endif |
40 | ||
41 | #include "svr4.h" | |
16a2f60e | 42 | #include "m88k/m88k.h" |
81910840 TW |
43 | |
44 | /* Augment TARGET_SWITCHES with the MXDB options. */ | |
45 | #define MASK_STANDARD 0x40000000 /* Retain standard information */ | |
cbbb4649 | 46 | #define MASK_NOLEGEND 0x20000000 /* Discard legend information */ |
81910840 TW |
47 | #define MASK_EXTERNAL_LEGEND 0x10000000 /* Make external legends */ |
48 | ||
49 | #define TARGET_STANDARD (target_flags & MASK_STANDARD) | |
cbbb4649 | 50 | #define TARGET_NOLEGEND (target_flags & MASK_NOLEGEND) |
81910840 TW |
51 | #define TARGET_EXTERNAL_LEGEND (target_flags & MASK_EXTERNAL_LEGEND) |
52 | ||
53 | #undef SUBTARGET_SWITCHES | |
54 | #define SUBTARGET_SWITCHES \ | |
55 | { "standard", MASK_STANDARD }, \ | |
cbbb4649 SC |
56 | { "legend", -MASK_NOLEGEND }, \ |
57 | { "no-legend", MASK_NOLEGEND }, \ | |
81910840 TW |
58 | { "external-legend", MASK_EXTERNAL_LEGEND }, \ |
59 | /* the following is used only in the *_SPEC's */ \ | |
60 | { "keep-coff", 0 }, | |
61 | ||
62 | /* Default switches */ | |
63 | #undef TARGET_DEFAULT | |
64 | #define TARGET_DEFAULT (MASK_CHECK_ZERO_DIV | \ | |
65 | MASK_OCS_DEBUG_INFO | \ | |
1f29c913 | 66 | MASK_OCS_FRAME_POSITION | \ |
4be40f36 | 67 | MASK_STANDARD | \ |
1f29c913 | 68 | MASK_SVR4) |
454e0348 TW |
69 | #undef CPU_DEFAULT |
70 | #define CPU_DEFAULT MASK_88000 | |
81910840 TW |
71 | |
72 | /* Macros to be automatically defined. __svr4__ is our extension. | |
73 | __CLASSIFY_TYPE__ is used in the <varargs.h> and <stdarg.h> header | |
74 | files with DG/UX revision 5.40 and later. This allows GNU CC to | |
75 | operate without installing the header files. */ | |
76 | ||
77 | #undef CPP_PREDEFINES | |
78 | #define CPP_PREDEFINES "-Dm88000 -Dm88k -Dunix -DDGUX -D__CLASSIFY_TYPE__=2\ | |
50eb31b2 | 79 | -D__svr4__ -Asystem(unix) -Acpu(m88k) -Amachine(m88k)" |
81910840 | 80 | |
76d41788 TW |
81 | /* If -m88100 is in effect, add -Dm88100; similarly for -m88110. |
82 | Here, the CPU_DEFAULT is assumed to be -m88000. If not -ansi, | |
83 | -traditional, or restricting include files to one specific source | |
84 | target, specify full DG/UX features. */ | |
81910840 | 85 | #undef CPP_SPEC |
79c900b1 | 86 | #define CPP_SPEC "%(cpp_cpu) %{msvr3:-D_M88KBCS_TARGET} %{!msvr3:-D_DGUX_TARGET}" |
81910840 TW |
87 | |
88 | /* Assembler support (-V, silicon filter, legends for mxdb). */ | |
89 | #undef ASM_SPEC | |
cea60f06 SC |
90 | #define ASM_SPEC "%{pipe:%{!.s: - }\ |
91 | %{!msvr3:%{!m88110:-KV3 }%{m88110:-KV04.00 }}}\ | |
92 | %(asm_cpu)" | |
81910840 TW |
93 | |
94 | /* Override svr4.h. */ | |
95 | #undef ASM_FINAL_SPEC | |
96 | #undef STARTFILE_SPEC | |
97 | ||
98 | /* Linker and library spec's. | |
1f29c913 | 99 | -msvr4 is the default if -msvr3 is not specified. |
81910840 | 100 | -static, -shared, -symbolic, -h* and -z* access AT&T V.4 link options. |
1f29c913 SC |
101 | -svr4 instructs gcc to place /usr/lib/values-X[cat].o on the link line. |
102 | -msvr3 indicates linking done in a COFF environment and the link | |
103 | script is added to the link line. In all environments, the first | |
104 | and last objects are crtbegin.o (or bcscrtbegin.o) and crtend.o. | |
105 | When the -G link option is used (-shared and -symbolic) a final | |
106 | link is not being done. */ | |
6e4e5f1b SC |
107 | #undef ENDFILE_SPEC |
108 | #define ENDFILE_SPEC "crtend.o%s" | |
81910840 | 109 | #undef LIB_SPEC |
6e4e5f1b | 110 | #define LIB_SPEC "%{!msvr3:%{!shared:-lstaticdgc}} %{!shared:%{!symbolic:-lc}}" |
81910840 | 111 | #undef LINK_SPEC |
2e383aa6 | 112 | #define LINK_SPEC "%{z*} %{h*} %{v:-V} \ |
81910840 | 113 | %{static:-dn -Bstatic} \ |
cbbb4649 SC |
114 | %{shared:-G -dy} \ |
115 | %{symbolic:-Bsymbolic -G -dy} \ | |
81910840 TW |
116 | %{pg:-L/usr/lib/libp}%{p:-L/usr/lib/libp}" |
117 | #undef STARTFILE_SPEC | |
44ae13fb SC |
118 | #define STARTFILE_SPEC "%(startfile_default)" |
119 | ||
120 | ||
121 | /* This macro defines names of additional specifications to put in the specs | |
122 | that can be used in various specifications like CC1_SPEC. Its definition | |
123 | is an initializer with a subgrouping for each command option. | |
124 | ||
125 | Each subgrouping contains a string constant, that defines the | |
126 | specification name, and a string constant that used by the GNU CC driver | |
127 | program. | |
128 | ||
129 | Do not define this macro if it does not need to do anything. */ | |
130 | ||
131 | #define EXTRA_SPECS \ | |
132 | { "cpp_cpu", CPP_CPU_SPEC }, \ | |
133 | { "asm_cpu", ASM_CPU_SPEC }, \ | |
134 | { "startfile_default", STARTFILE_DEFAULT_SPEC }, \ | |
135 | { "startfile_crtbegin", STARTFILE_CRTBEGIN_SPEC } | |
136 | ||
137 | #define ASM_CPU_SPEC "\ | |
2e383aa6 | 138 | %{v:-V}\ |
44ae13fb SC |
139 | %{g:\ |
140 | %{mno-legend:-Wc,off}\ | |
141 | %{!mno-legend:-Wc,-fix-bb,-s\"%i\"\ | |
142 | %{traditional:,-lc}\ | |
143 | %{!traditional:,-lansi-c}\ | |
144 | %{mstandard:,-keep-std}\ | |
145 | %{mexternal-legend:,-external}\ | |
146 | %{mocs-frame-position:,-ocs}}}" | |
147 | ||
148 | #define CPP_CPU_SPEC "\ | |
149 | %{!m88000:%{!m88100:%{m88110:-D__m88110__}}} \ | |
150 | %{!m88000:%{!m88110:%{m88100:-D__m88100__}}} \ | |
151 | %{!ansi:%{!traditional:-D__OPEN_NAMESPACE__}}" | |
152 | ||
153 | #define STARTFILE_DEFAULT_SPEC "\ | |
154 | %{!shared:%{!symbolic:%{pg:gcrt0.o%s} \ | |
81910840 | 155 | %{!pg:%{p:/lib/mcrt0.o}%{!p:/lib/crt0.o}} \ |
cea60f06 | 156 | %(startfile_crtbegin) \ |
81910840 TW |
157 | %{svr4:%{ansi:/lib/values-Xc.o} \ |
158 | %{!ansi:%{traditional:/lib/values-Xt.o} \ | |
159 | %{!traditional:/usr/lib/values-Xa.o}}}}}" | |
160 | ||
44ae13fb SC |
161 | #define STARTFILE_CRTBEGIN_SPEC "\ |
162 | %{msvr3:m88kdgux.ld%s bcscrtbegin.o%s} \ | |
163 | %{!msvr3:crtbegin.o%s}" | |
164 | ||
50eb31b2 SC |
165 | #undef GPLUSPLUS_INCLUDE_DIR |
166 | #define GPLUSPLUS_INCLUDE_DIR "/usr/opt/g++/lib/g++-include" | |
167 | ||
81910840 TW |
168 | /* Fast DG/UX version of profiler that does not require lots of |
169 | registers to be stored. */ | |
170 | #undef FUNCTION_PROFILER | |
171 | #define FUNCTION_PROFILER(FILE, LABELNO) \ | |
172 | output_function_profiler (FILE, LABELNO, "gcc.mcount", 0) | |
173 | ||
81910840 TW |
174 | /* Output the legend info for mxdb when debugging except if standard |
175 | debugging information only is explicitly requested. */ | |
176 | #undef ASM_FIRST_LINE | |
177 | #define ASM_FIRST_LINE(FILE) \ | |
178 | do { \ | |
50eb31b2 SC |
179 | if (TARGET_SVR4) \ |
180 | { \ | |
181 | if (TARGET_88110) \ | |
182 | fprintf (FILE, "\t%s\t \"%s\"\n", VERSION_ASM_OP, "04.00"); \ | |
183 | else \ | |
184 | fprintf (FILE, "\t%s\t \"%s\"\n", VERSION_ASM_OP, "03.00"); \ | |
185 | } \ | |
cbbb4649 | 186 | if (write_symbols != NO_DEBUG && !TARGET_NOLEGEND) \ |
81910840 TW |
187 | { \ |
188 | fprintf (FILE, ";legend_info -fix-bb -h\"gcc-%s\" -s\"%s\"", \ | |
189 | VERSION_STRING, main_input_filename); \ | |
190 | fputs (flag_traditional ? " -lc" : " -lansi-c", FILE); \ | |
191 | if (TARGET_STANDARD) \ | |
192 | fputs (" -keep-std", FILE); \ | |
193 | if (TARGET_EXTERNAL_LEGEND) \ | |
194 | fputs (" -external", FILE); \ | |
195 | if (TARGET_OCS_FRAME_POSITION) \ | |
196 | fputs (" -ocs", FILE); \ | |
197 | fputc ('\n', FILE); \ | |
198 | } \ | |
199 | } while (0) | |
200 | ||
201 | /* Override svr4.h. */ | |
202 | #undef PTRDIFF_TYPE | |
203 | #undef WCHAR_TYPE | |
204 | #undef WCHAR_TYPE_SIZE | |
205 | ||
cb1110b5 TW |
206 | /* Override svr4.h and m88k.h except when compiling crtstuff.c. These must |
207 | be constant strings when compiling crtstuff.c. Otherwise, respect the | |
208 | -mversion-STRING option used. */ | |
6e4e5f1b | 209 | #undef INIT_SECTION_PREAMBLE |
1f29c913 SC |
210 | #undef INIT_SECTION_ASM_OP |
211 | #undef FINI_SECTION_ASM_OP | |
212 | #undef CTORS_SECTION_ASM_OP | |
213 | #undef DTORS_SECTION_ASM_OP | |
214 | ||
6e4e5f1b SC |
215 | #if defined (CRT_BEGIN) || defined (CRT_END) || defined (L__main) |
216 | /* routines to invoke global constructors and destructors are always COFF | |
217 | to enable linking mixed COFF and ELF objects */ | |
218 | #define FINI_SECTION_ASM_OP ("section .fini,\"x\"") | |
219 | #ifndef BCS | |
220 | #define INIT_SECTION_PREAMBLE asm ("\taddu\tr31,r31,0x20") | |
221 | #endif | |
81910840 | 222 | #undef INIT_SECTION_ASM_OP |
6e4e5f1b | 223 | #define INIT_SECTION_ASM_OP ("section\t .init,\"x\"") |
81910840 | 224 | #undef CTORS_SECTION_ASM_OP |
6e4e5f1b | 225 | #define CTORS_SECTION_ASM_OP ("section\t .ctors,\"d\"") |
81910840 | 226 | #undef DTORS_SECTION_ASM_OP |
6e4e5f1b SC |
227 | #define DTORS_SECTION_ASM_OP ("section\t .dtors,\"d\"") |
228 | #undef OBJECT_FORMAT_ELF | |
1f29c913 | 229 | #else |
6e4e5f1b SC |
230 | #undef INIT_SECTION_ASM_OP |
231 | #define INIT_SECTION_ASM_OP (TARGET_SVR4 \ | |
232 | ? "section\t .init,\"xa\"" \ | |
233 | : "section\t .init,\"x\"") | |
234 | #undef CTORS_SECTION_ASM_OP | |
235 | #define CTORS_SECTION_ASM_OP (TARGET_SVR4 \ | |
236 | ? "section\t .ctors,\"aw\"" \ | |
237 | : "section\t .ctors,\"d\"") | |
238 | #undef DTORS_SECTION_ASM_OP | |
239 | #define DTORS_SECTION_ASM_OP (TARGET_SVR4 \ | |
240 | ? "section\t .dtors,\"aw\"" \ | |
241 | : "section\t .dtors,\"d\"") | |
81910840 | 242 | #endif /* crtstuff.c */ |
cb1110b5 TW |
243 | |
244 | /* The lists of global object constructors and global destructors are always | |
245 | placed in the .ctors/.dtors sections. This requires the use of a link | |
246 | script if the COFF linker is used, but otherwise COFF and ELF objects | |
247 | can be intermixed. A COFF object will pad the section to 16 bytes with | |
248 | zeros; and ELF object will not contain padding. We deal with this by | |
249 | putting a -1 marker at the begin and end of the list and ignoring zero | |
250 | entries. */ | |
251 | ||
252 | /* Mark the end of the .ctors/.dtors sections with a -1. */ | |
6e4e5f1b SC |
253 | |
254 | #define CTOR_LIST_BEGIN \ | |
255 | asm (CTORS_SECTION_ASM_OP); \ | |
256 | func_ptr __CTOR_LIST__[1] = { (func_ptr) (-1) } | |
257 | ||
cb1110b5 TW |
258 | #define CTOR_LIST_END \ |
259 | asm (CTORS_SECTION_ASM_OP); \ | |
260 | func_ptr __CTOR_END__[1] = { (func_ptr) (-1) } | |
261 | ||
6e4e5f1b SC |
262 | #define DTOR_LIST_BEGIN \ |
263 | asm (DTORS_SECTION_ASM_OP); \ | |
264 | func_ptr __DTOR_LIST__[1] = { (func_ptr) (-1) } | |
265 | ||
cb1110b5 TW |
266 | #define DTOR_LIST_END \ |
267 | asm (DTORS_SECTION_ASM_OP); \ | |
268 | func_ptr __DTOR_END__[1] = { (func_ptr) (-1) } | |
269 | ||
270 | /* Walk the list ignoring NULL entries till we hit the terminating -1. */ | |
271 | #define DO_GLOBAL_CTORS_BODY \ | |
272 | do { \ | |
273 | int i; \ | |
274 | for (i=1;(int)(__CTOR_LIST__[i]) != -1; i++) \ | |
275 | if (((int *)__CTOR_LIST__)[i] != 0) \ | |
276 | __CTOR_LIST__[i] (); \ | |
277 | } while (0) | |
278 | ||
279 | /* Walk the list looking for the terminating -1 that marks the end. | |
280 | Go backward and ignore any NULL entries. */ | |
281 | #define DO_GLOBAL_DTORS_BODY \ | |
282 | do { \ | |
283 | int i; \ | |
284 | for (i=1;(int)(__DTOR_LIST__[i]) != -1; i++); \ | |
285 | for (i-=1;(int)(__DTOR_LIST__[i]) != -1; i--) \ | |
286 | if (((int *)__DTOR_LIST__)[i] != 0) \ | |
287 | __DTOR_LIST__[i] (); \ | |
288 | } while (0) | |
6e4e5f1b SC |
289 | |
290 | /* The maximum alignment which the object file format can support. | |
291 | page alignment would seem to be enough */ | |
292 | #undef MAX_OFILE_ALIGNMENT | |
293 | #define MAX_OFILE_ALIGNMENT 0x1000 | |
294 | ||
295 | /* Must use data section for relocatable constants when pic. */ | |
296 | #undef SELECT_RTX_SECTION | |
297 | #define SELECT_RTX_SECTION(MODE,RTX) \ | |
298 | { \ | |
299 | if (flag_pic && symbolic_operand (RTX)) \ | |
300 | data_section (); \ | |
301 | else \ | |
302 | const_section (); \ | |
303 | } |