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