]>
Commit | Line | Data |
---|---|---|
1 | /* Target definitions for GNU compiler for PowerPC running System V.4 | |
2 | Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001 | |
3 | Free Software Foundation, Inc. | |
4 | Contributed by Cygnus Support. | |
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 | ||
24 | /* Yes! We are ELF. */ | |
25 | #define TARGET_OBJECT_FORMAT OBJECT_ELF | |
26 | ||
27 | /* Default ABI to compile code for. */ | |
28 | #define DEFAULT_ABI rs6000_current_abi | |
29 | ||
30 | /* Default ABI to use. */ | |
31 | #define RS6000_ABI_NAME "sysv" | |
32 | ||
33 | /* Override rs6000.h definition. */ | |
34 | #undef ASM_DEFAULT_SPEC | |
35 | #define ASM_DEFAULT_SPEC "-mppc" | |
36 | ||
37 | /* Override rs6000.h definition. */ | |
38 | #undef CPP_DEFAULT_SPEC | |
39 | #define CPP_DEFAULT_SPEC "-D_ARCH_PPC" | |
40 | /* Common CPP definitions used by CPP_SPEC among the various targets | |
41 | for handling -mcpu=xxx switches. */ | |
42 | #define CPP_CPU_SPEC \ | |
43 | "%{!mcpu*: \ | |
44 | %{mpower: %{!mpower2: -D_ARCH_PWR}} \ | |
45 | %{mpower2: -D_ARCH_PWR2} \ | |
46 | %{mpowerpc*: -D_ARCH_PPC} \ | |
47 | %{mno-power: %{!mpowerpc*: -D_ARCH_COM}} \ | |
48 | %{!mno-power: %{!mpower2: %(cpp_default)}}} \ | |
49 | %{mcpu=common: -D_ARCH_COM} \ | |
50 | %{mcpu=power: -D_ARCH_PWR} \ | |
51 | %{mcpu=power2: -D_ARCH_PWR2} \ | |
52 | %{mcpu=powerpc: -D_ARCH_PPC} \ | |
53 | %{mcpu=rios: -D_ARCH_PWR} \ | |
54 | %{mcpu=rios1: -D_ARCH_PWR} \ | |
55 | %{mcpu=rios2: -D_ARCH_PWR2} \ | |
56 | %{mcpu=rsc: -D_ARCH_PWR} \ | |
57 | %{mcpu=rsc1: -D_ARCH_PWR} \ | |
58 | %{mcpu=401: -D_ARCH_PPC} \ | |
59 | %{mcpu=403: -D_ARCH_PPC} \ | |
60 | %{mcpu=505: -D_ARCH_PPC} \ | |
61 | %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \ | |
62 | %{mcpu=602: -D_ARCH_PPC} \ | |
63 | %{mcpu=603: -D_ARCH_PPC} \ | |
64 | %{mcpu=603e: -D_ARCH_PPC} \ | |
65 | %{mcpu=ec603e: -D_ARCH_PPC} \ | |
66 | %{mcpu=604: -D_ARCH_PPC} \ | |
67 | %{mcpu=604e: -D_ARCH_PPC} \ | |
68 | %{mcpu=620: -D_ARCH_PPC} \ | |
69 | %{mcpu=740: -D_ARCH_PPC} \ | |
70 | %{mcpu=750: -D_ARCH_PPC} \ | |
71 | %{mcpu=801: -D_ARCH_PPC} \ | |
72 | %{mcpu=821: -D_ARCH_PPC} \ | |
73 | %{mcpu=823: -D_ARCH_PPC} \ | |
74 | %{mcpu=860: -D_ARCH_PPC}" | |
75 | ||
76 | #define CPP_DEFAULT_SPEC "-D_ARCH_PPC" | |
77 | ||
78 | /* Common ASM definitions used by ASM_SPEC among the various targets | |
79 | for handling -mcpu=xxx switches. */ | |
80 | #define ASM_CPU_SPEC \ | |
81 | "%{!mcpu*: \ | |
82 | %{mpower: %{!mpower2: -mpwr}} \ | |
83 | %{mpower2: -mpwrx} \ | |
84 | %{mpowerpc*: -mppc} \ | |
85 | %{mno-power: %{!mpowerpc*: -mcom}} \ | |
86 | %{!mno-power: %{!mpower2: %(asm_default)}}} \ | |
87 | %{mcpu=common: -mcom} \ | |
88 | %{mcpu=power: -mpwr} \ | |
89 | %{mcpu=power2: -mpwrx} \ | |
90 | %{mcpu=powerpc: -mppc} \ | |
91 | %{mcpu=rios: -mpwr} \ | |
92 | %{mcpu=rios1: -mpwr} \ | |
93 | %{mcpu=rios2: -mpwrx} \ | |
94 | %{mcpu=rsc: -mpwr} \ | |
95 | %{mcpu=rsc1: -mpwr} \ | |
96 | %{mcpu=401: -mppc} \ | |
97 | %{mcpu=403: -mppc} \ | |
98 | %{mcpu=505: -mppc} \ | |
99 | %{mcpu=601: -m601} \ | |
100 | %{mcpu=602: -mppc} \ | |
101 | %{mcpu=603: -mppc} \ | |
102 | %{mcpu=603e: -mppc} \ | |
103 | %{mcpu=ec603e: -mppc} \ | |
104 | %{mcpu=604: -mppc} \ | |
105 | %{mcpu=604e: -mppc} \ | |
106 | %{mcpu=620: -mppc} \ | |
107 | %{mcpu=740: -mppc} \ | |
108 | %{mcpu=750: -mppc} \ | |
109 | %{mcpu=801: -mppc} \ | |
110 | %{mcpu=821: -mppc} \ | |
111 | %{mcpu=823: -mppc} \ | |
112 | %{mcpu=860: -mppc}" | |
113 | ||
114 | /* Small data support types. */ | |
115 | enum rs6000_sdata_type { | |
116 | SDATA_NONE, /* No small data support. */ | |
117 | SDATA_DATA, /* Just put data in .sbss/.sdata, don't use relocs. */ | |
118 | SDATA_SYSV, /* Use r13 to point to .sdata/.sbss. */ | |
119 | SDATA_EABI /* Use r13 like above, r2 points to .sdata2/.sbss2. */ | |
120 | }; | |
121 | ||
122 | extern enum rs6000_sdata_type rs6000_sdata; | |
123 | ||
124 | /* V.4/eabi switches. */ | |
125 | #define MASK_NO_BITFIELD_TYPE 0x40000000 /* Set PCC_BITFIELD_TYPE_MATTERS to 0. */ | |
126 | #define MASK_STRICT_ALIGN 0x20000000 /* Set STRICT_ALIGNMENT to 1. */ | |
127 | #define MASK_RELOCATABLE 0x10000000 /* GOT pointers are PC relative. */ | |
128 | #define MASK_EABI 0x08000000 /* Adhere to eabi, not System V spec. */ | |
129 | #define MASK_LITTLE_ENDIAN 0x04000000 /* Target is little endian. */ | |
130 | #define MASK_REGNAMES 0x02000000 /* Use alternate register names. */ | |
131 | #define MASK_PROTOTYPE 0x01000000 /* Only prototyped fcns pass variable args. */ | |
132 | #define MASK_LONG_DOUBLE_128 0x00800000 /* Use IEEE quad long double. */ | |
133 | #define MASK_NO_BITFIELD_WORD 0x00400000 /* Bitfields cannot cross word boundaries */ | |
134 | ||
135 | #define TARGET_NO_BITFIELD_TYPE (target_flags & MASK_NO_BITFIELD_TYPE) | |
136 | #define TARGET_STRICT_ALIGN (target_flags & MASK_STRICT_ALIGN) | |
137 | #define TARGET_RELOCATABLE (target_flags & MASK_RELOCATABLE) | |
138 | #define TARGET_EABI (target_flags & MASK_EABI) | |
139 | #define TARGET_LITTLE_ENDIAN (target_flags & MASK_LITTLE_ENDIAN) | |
140 | #define TARGET_REGNAMES (target_flags & MASK_REGNAMES) | |
141 | #define TARGET_PROTOTYPE (target_flags & MASK_PROTOTYPE) | |
142 | #define TARGET_LONG_DOUBLE_128 (target_flags & MASK_LONG_DOUBLE_128) | |
143 | #define TARGET_NO_BITFIELD_WORD (target_flags & MASK_NO_BITFIELD_WORD) | |
144 | #define TARGET_TOC ((target_flags & MASK_64BIT) \ | |
145 | || ((target_flags & (MASK_RELOCATABLE \ | |
146 | | MASK_MINIMAL_TOC)) \ | |
147 | && flag_pic > 1) \ | |
148 | || DEFAULT_ABI == ABI_AIX) | |
149 | ||
150 | #define TARGET_BITFIELD_TYPE (! TARGET_NO_BITFIELD_TYPE) | |
151 | #define TARGET_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN) | |
152 | #define TARGET_NO_PROTOTYPE (! TARGET_PROTOTYPE) | |
153 | #define TARGET_NO_TOC (! TARGET_TOC) | |
154 | #define TARGET_NO_EABI (! TARGET_EABI) | |
155 | ||
156 | /* Strings provided by SUBTARGET_OPTIONS */ | |
157 | extern const char *rs6000_abi_name; | |
158 | extern const char *rs6000_sdata_name; | |
159 | ||
160 | /* Override rs6000.h definition. */ | |
161 | #undef SUBTARGET_OPTIONS | |
162 | #define SUBTARGET_OPTIONS \ | |
163 | { "call-", &rs6000_abi_name, N_("Select ABI calling convention.") }, \ | |
164 | { "sdata=", &rs6000_sdata_name, N_("Select method for sdata handling.") } | |
165 | ||
166 | /* Max # of bytes for variables to automatically be put into the .sdata | |
167 | or .sdata2 sections. */ | |
168 | extern int g_switch_value; /* Value of the -G xx switch. */ | |
169 | extern int g_switch_set; /* Whether -G xx was passed. */ | |
170 | ||
171 | #define SDATA_DEFAULT_SIZE 8 | |
172 | ||
173 | /* Note, V.4 no longer uses a normal TOC, so make -mfull-toc, be just | |
174 | the same as -mminimal-toc. */ | |
175 | /* Override rs6000.h definition. */ | |
176 | #undef SUBTARGET_SWITCHES | |
177 | #define SUBTARGET_SWITCHES \ | |
178 | { "bit-align", -MASK_NO_BITFIELD_TYPE, \ | |
179 | N_("Align to the base type of the bitfield.") }, \ | |
180 | { "no-bit-align", MASK_NO_BITFIELD_TYPE, \ | |
181 | N_("Don't align to the base type of the bitfield.") }, \ | |
182 | { "strict-align", MASK_STRICT_ALIGN, \ | |
183 | N_("Don't assume that unaligned accesses are handled by the system") }, \ | |
184 | { "no-strict-align", -MASK_STRICT_ALIGN, \ | |
185 | N_("Assume that unaligned accesses are handled by the system") }, \ | |
186 | { "relocatable", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, \ | |
187 | N_("Produce code relocatable at runtime.") }, \ | |
188 | { "no-relocatable", -MASK_RELOCATABLE, \ | |
189 | N_("Don't produce code relocatable at runtime.") }, \ | |
190 | { "relocatable-lib", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, \ | |
191 | N_("Produce code relocatable at runtime.") }, \ | |
192 | { "no-relocatable-lib", -MASK_RELOCATABLE, \ | |
193 | N_("Don't produce code relocatable at runtime.") }, \ | |
194 | { "little-endian", MASK_LITTLE_ENDIAN, \ | |
195 | N_("Produce little endian code.") }, \ | |
196 | { "little", MASK_LITTLE_ENDIAN, \ | |
197 | N_("Produce little endian code.") }, \ | |
198 | { "big-endian", -MASK_LITTLE_ENDIAN, \ | |
199 | N_("Produce big endian code.") }, \ | |
200 | { "big", -MASK_LITTLE_ENDIAN, \ | |
201 | N_("Produce big endian code.") }, \ | |
202 | { "long-double-64", -MASK_LONG_DOUBLE_128, \ | |
203 | N_("Use 64 bit long doubles") }, \ | |
204 | { "long-double-128", MASK_LONG_DOUBLE_128, \ | |
205 | N_("Use 128 bit long doubles") }, \ | |
206 | { "no-toc", 0, N_("no description yet") }, \ | |
207 | { "toc", MASK_MINIMAL_TOC, N_("no description yet") }, \ | |
208 | { "full-toc", MASK_MINIMAL_TOC, N_("no description yet") }, \ | |
209 | { "prototype", MASK_PROTOTYPE, N_("no description yet") }, \ | |
210 | { "no-prototype", -MASK_PROTOTYPE, N_("no description yet") }, \ | |
211 | { "no-traceback", 0, N_("no description yet") }, \ | |
212 | { "eabi", MASK_EABI, N_("Use EABI.") }, \ | |
213 | { "no-eabi", -MASK_EABI, N_("Don't use EABI.") }, \ | |
214 | { "bit-word", -MASK_NO_BITFIELD_WORD, "" }, \ | |
215 | { "no-bit-word", MASK_NO_BITFIELD_WORD, \ | |
216 | N_("Do not allow bitfields to cross word boundaries") }, \ | |
217 | { "regnames", MASK_REGNAMES, \ | |
218 | N_("Use alternate register names.") }, \ | |
219 | { "no-regnames", -MASK_REGNAMES, \ | |
220 | N_("Don't use alternate register names.") }, \ | |
221 | { "sdata", 0, N_("no description yet") }, \ | |
222 | { "no-sdata", 0, N_("no description yet") }, \ | |
223 | { "sim", 0, \ | |
224 | N_("Link with libsim.a, libc.a and sim-crt0.o.") }, \ | |
225 | { "ads", 0, \ | |
226 | N_("Link with libads.a, libc.a and crt0.o.") }, \ | |
227 | { "yellowknife", 0, \ | |
228 | N_("Link with libyk.a, libc.a and crt0.o.") }, \ | |
229 | { "mvme", 0, \ | |
230 | N_("Link with libmvme.a, libc.a and crt0.o.") }, \ | |
231 | { "emb", 0, \ | |
232 | N_("Set the PPC_EMB bit in the ELF flags header") }, \ | |
233 | { "vxworks", 0, N_("no description yet") }, \ | |
234 | { "solaris-cclib", 0, N_("no description yet") }, \ | |
235 | { "shlib", 0, N_("no description yet") }, \ | |
236 | EXTRA_SUBTARGET_SWITCHES \ | |
237 | { "newlib", 0, N_("no description yet") }, | |
238 | ||
239 | /* This is meant to be redefined in the host dependent files. */ | |
240 | #define EXTRA_SUBTARGET_SWITCHES | |
241 | ||
242 | /* Sometimes certain combinations of command options do not make sense | |
243 | on a particular target machine. You can define a macro | |
244 | `OVERRIDE_OPTIONS' to take account of this. This macro, if | |
245 | defined, is executed once just after all the command options have | |
246 | been parsed. | |
247 | ||
248 | The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to | |
249 | get control. */ | |
250 | ||
251 | #define SUBTARGET_OVERRIDE_OPTIONS \ | |
252 | do { \ | |
253 | if (!g_switch_set) \ | |
254 | g_switch_value = SDATA_DEFAULT_SIZE; \ | |
255 | \ | |
256 | if (!strcmp (rs6000_abi_name, "sysv")) \ | |
257 | rs6000_current_abi = ABI_V4; \ | |
258 | else if (!strcmp (rs6000_abi_name, "sysv-noeabi")) \ | |
259 | { \ | |
260 | rs6000_current_abi = ABI_V4; \ | |
261 | target_flags &= ~ MASK_EABI; \ | |
262 | } \ | |
263 | else if (!strcmp (rs6000_abi_name, "sysv-eabi") \ | |
264 | || !strcmp (rs6000_abi_name, "eabi")) \ | |
265 | { \ | |
266 | rs6000_current_abi = ABI_V4; \ | |
267 | target_flags |= MASK_EABI; \ | |
268 | } \ | |
269 | else if (!strcmp (rs6000_abi_name, "aix")) \ | |
270 | { \ | |
271 | rs6000_current_abi = ABI_AIX_NODESC; \ | |
272 | target_flags |= MASK_EABI; \ | |
273 | } \ | |
274 | else if (!strcmp (rs6000_abi_name, "aixdesc")) \ | |
275 | rs6000_current_abi = ABI_AIX; \ | |
276 | else if (!strcmp (rs6000_abi_name, "linux")) \ | |
277 | rs6000_current_abi = ABI_V4; \ | |
278 | else if (!strcmp (rs6000_abi_name, "netbsd")) \ | |
279 | rs6000_current_abi = ABI_V4; \ | |
280 | else if (!strcmp (rs6000_abi_name, "solaris")) \ | |
281 | rs6000_current_abi = ABI_SOLARIS; \ | |
282 | else if (!strcmp (rs6000_abi_name, "i960-old")) \ | |
283 | { \ | |
284 | rs6000_current_abi = ABI_V4; \ | |
285 | target_flags |= (MASK_LITTLE_ENDIAN | MASK_EABI \ | |
286 | | MASK_NO_BITFIELD_WORD); \ | |
287 | target_flags &= ~MASK_STRICT_ALIGN; \ | |
288 | } \ | |
289 | else \ | |
290 | { \ | |
291 | rs6000_current_abi = ABI_V4; \ | |
292 | error ("Bad value for -mcall-%s", rs6000_abi_name); \ | |
293 | } \ | |
294 | \ | |
295 | if (rs6000_sdata_name) \ | |
296 | { \ | |
297 | if (!strcmp (rs6000_sdata_name, "none")) \ | |
298 | rs6000_sdata = SDATA_NONE; \ | |
299 | else if (!strcmp (rs6000_sdata_name, "data")) \ | |
300 | rs6000_sdata = SDATA_DATA; \ | |
301 | else if (!strcmp (rs6000_sdata_name, "default")) \ | |
302 | rs6000_sdata = (TARGET_EABI) ? SDATA_EABI : SDATA_SYSV; \ | |
303 | else if (!strcmp (rs6000_sdata_name, "sysv")) \ | |
304 | rs6000_sdata = SDATA_SYSV; \ | |
305 | else if (!strcmp (rs6000_sdata_name, "eabi")) \ | |
306 | rs6000_sdata = SDATA_EABI; \ | |
307 | else \ | |
308 | error ("Bad value for -msdata=%s", rs6000_sdata_name); \ | |
309 | } \ | |
310 | else if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS) \ | |
311 | { \ | |
312 | rs6000_sdata = SDATA_DATA; \ | |
313 | rs6000_sdata_name = "data"; \ | |
314 | } \ | |
315 | else \ | |
316 | { \ | |
317 | rs6000_sdata = SDATA_NONE; \ | |
318 | rs6000_sdata_name = "none"; \ | |
319 | } \ | |
320 | \ | |
321 | if (TARGET_RELOCATABLE && \ | |
322 | (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV)) \ | |
323 | { \ | |
324 | rs6000_sdata = SDATA_DATA; \ | |
325 | error ("-mrelocatable and -msdata=%s are incompatible.", \ | |
326 | rs6000_sdata_name); \ | |
327 | } \ | |
328 | \ | |
329 | else if (flag_pic && \ | |
330 | (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV)) \ | |
331 | { \ | |
332 | rs6000_sdata = SDATA_DATA; \ | |
333 | error ("-f%s and -msdata=%s are incompatible.", \ | |
334 | (flag_pic > 1) ? "PIC" : "pic", \ | |
335 | rs6000_sdata_name); \ | |
336 | } \ | |
337 | \ | |
338 | if (rs6000_sdata != SDATA_NONE && DEFAULT_ABI != ABI_V4 \ | |
339 | && DEFAULT_ABI != ABI_SOLARIS) \ | |
340 | { \ | |
341 | rs6000_sdata = SDATA_NONE; \ | |
342 | error ("-msdata=%s and -mcall-%s are incompatible.", \ | |
343 | rs6000_sdata_name, rs6000_abi_name); \ | |
344 | } \ | |
345 | \ | |
346 | if (TARGET_RELOCATABLE && !TARGET_MINIMAL_TOC) \ | |
347 | { \ | |
348 | target_flags |= MASK_MINIMAL_TOC; \ | |
349 | error ("-mrelocatable and -mno-minimal-toc are incompatible."); \ | |
350 | } \ | |
351 | \ | |
352 | if (TARGET_RELOCATABLE && rs6000_current_abi == ABI_AIX) \ | |
353 | { \ | |
354 | target_flags &= ~MASK_RELOCATABLE; \ | |
355 | error ("-mrelocatable and -mcall-%s are incompatible.", \ | |
356 | rs6000_abi_name); \ | |
357 | } \ | |
358 | \ | |
359 | if (flag_pic > 1 && rs6000_current_abi == ABI_AIX) \ | |
360 | { \ | |
361 | flag_pic = 0; \ | |
362 | error ("-fPIC and -mcall-%s are incompatible.", \ | |
363 | rs6000_abi_name); \ | |
364 | } \ | |
365 | \ | |
366 | if (rs6000_current_abi == ABI_AIX && TARGET_LITTLE_ENDIAN) \ | |
367 | { \ | |
368 | target_flags &= ~MASK_LITTLE_ENDIAN; \ | |
369 | error ("-mcall-aixdesc must be big endian"); \ | |
370 | } \ | |
371 | \ | |
372 | /* Treat -fPIC the same as -mrelocatable. */ \ | |
373 | if (flag_pic > 1) \ | |
374 | target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC; \ | |
375 | \ | |
376 | else if (TARGET_RELOCATABLE) \ | |
377 | flag_pic = 2; \ | |
378 | \ | |
379 | } while (0) | |
380 | ||
381 | ||
382 | /* Override rs6000.h definition. */ | |
383 | #undef TARGET_DEFAULT | |
384 | #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS) | |
385 | ||
386 | /* Override rs6000.h definition. */ | |
387 | #undef PROCESSOR_DEFAULT | |
388 | #define PROCESSOR_DEFAULT PROCESSOR_PPC750 | |
389 | ||
390 | /* System V.4 uses register 13 as a pointer to the small data area, | |
391 | so it is not available to the normal user. */ | |
392 | ||
393 | #define FIXED_R13 1 | |
394 | ||
395 | /* Size of the V.4 varargs area if needed. */ | |
396 | /* Override rs6000.h definition. */ | |
397 | #undef RS6000_VARARGS_AREA | |
398 | #define RS6000_VARARGS_AREA ((cfun->machine->sysv_varargs_p) ? RS6000_VARARGS_SIZE : 0) | |
399 | ||
400 | /* Override default big endianism definitions in rs6000.h. */ | |
401 | #undef BYTES_BIG_ENDIAN | |
402 | #undef WORDS_BIG_ENDIAN | |
403 | #define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN) | |
404 | #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN) | |
405 | ||
406 | /* Define this to set the endianness to use in libgcc2.c, which can | |
407 | not depend on target_flags. */ | |
408 | #if !defined(_LITTLE_ENDIAN) && !defined(__sun__) | |
409 | #define LIBGCC2_WORDS_BIG_ENDIAN 1 | |
410 | #else | |
411 | #define LIBGCC2_WORDS_BIG_ENDIAN 0 | |
412 | #endif | |
413 | ||
414 | /* Define cutoff for using external functions to save floating point. | |
415 | Currently on V.4, always use inline stores. */ | |
416 | #define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 64) | |
417 | ||
418 | /* Put jump tables in read-only memory, rather than in .text. */ | |
419 | #define JUMP_TABLES_IN_TEXT_SECTION 0 | |
420 | ||
421 | /* Prefix and suffix to use to saving floating point. */ | |
422 | #define SAVE_FP_PREFIX "_savefpr_" | |
423 | #define SAVE_FP_SUFFIX "_l" | |
424 | ||
425 | /* Prefix and suffix to use to restoring floating point. */ | |
426 | #define RESTORE_FP_PREFIX "_restfpr_" | |
427 | #define RESTORE_FP_SUFFIX "_l" | |
428 | ||
429 | /* Type used for ptrdiff_t, as a string used in a declaration. */ | |
430 | #define PTRDIFF_TYPE "int" | |
431 | ||
432 | /* Type used for wchar_t, as a string used in a declaration. */ | |
433 | /* Override svr4.h definition. */ | |
434 | #undef WCHAR_TYPE | |
435 | #define WCHAR_TYPE "long int" | |
436 | ||
437 | /* Width of wchar_t in bits. */ | |
438 | /* Override svr4.h definition. */ | |
439 | #undef WCHAR_TYPE_SIZE | |
440 | #define WCHAR_TYPE_SIZE 32 | |
441 | ||
442 | /* Define for support of TFmode long double and REAL_ARITHMETIC. | |
443 | PowerPC SVR4 ABI says that long double is 4 words. */ | |
444 | #undef LONG_DOUBLE_TYPE_SIZE | |
445 | #define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64) | |
446 | ||
447 | /* Constant which presents upper bound of the above value. */ | |
448 | #define MAX_LONG_DOUBLE_TYPE_SIZE 128 | |
449 | ||
450 | /* Define this to set long double type size to use in libgcc2.c, which can | |
451 | not depend on target_flags. */ | |
452 | #ifdef __LONG_DOUBLE_128__ | |
453 | #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128 | |
454 | #else | |
455 | #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64 | |
456 | #endif | |
457 | ||
458 | /* Make int foo : 8 not cause structures to be aligned to an int boundary. */ | |
459 | /* Override elfos.h definition. */ | |
460 | #undef PCC_BITFIELD_TYPE_MATTERS | |
461 | #define PCC_BITFIELD_TYPE_MATTERS (TARGET_BITFIELD_TYPE) | |
462 | ||
463 | #undef BITFIELD_NBYTES_LIMITED | |
464 | #define BITFIELD_NBYTES_LIMITED (TARGET_NO_BITFIELD_WORD) | |
465 | ||
466 | /* Define this macro to be the value 1 if instructions will fail to | |
467 | work if given data not on the nominal alignment. If instructions | |
468 | will merely go slower in that case, define this macro as 0. */ | |
469 | #undef STRICT_ALIGNMENT | |
470 | #define STRICT_ALIGNMENT (TARGET_STRICT_ALIGN) | |
471 | ||
472 | /* Alignment in bits of the stack boundary. Note, in order to allow building | |
473 | one set of libraries with -mno-eabi instead of eabi libraries and non-eabi | |
474 | versions, just use 64 as the stack boundary. */ | |
475 | #undef STACK_BOUNDARY | |
476 | #define STACK_BOUNDARY 64 | |
477 | ||
478 | /* Real stack boundary as mandated by the appropriate ABI. */ | |
479 | #define ABI_STACK_BOUNDARY ((TARGET_EABI) ? 64 : 128) | |
480 | ||
481 | /* No data type wants to be aligned rounder than this. */ | |
482 | #undef BIGGEST_ALIGNMENT | |
483 | #define BIGGEST_ALIGNMENT ((TARGET_EABI) ? 64 : 128) | |
484 | ||
485 | #undef BIGGEST_FIELD_ALIGNMENT | |
486 | #undef ADJUST_FIELD_ALIGN | |
487 | #undef ROUND_TYPE_ALIGN | |
488 | ||
489 | /* Use ELF style section commands. */ | |
490 | ||
491 | #define TEXT_SECTION_ASM_OP "\t.section\t\".text\"" | |
492 | ||
493 | #define DATA_SECTION_ASM_OP "\t.section\t\".data\"" | |
494 | ||
495 | #define BSS_SECTION_ASM_OP "\t.section\t\".bss\"" | |
496 | ||
497 | /* Override elfos.h definition. */ | |
498 | #undef INIT_SECTION_ASM_OP | |
499 | #define INIT_SECTION_ASM_OP "\t.section\t\".init\",\"ax\"" | |
500 | ||
501 | /* Override elfos.h definition. */ | |
502 | #undef FINI_SECTION_ASM_OP | |
503 | #define FINI_SECTION_ASM_OP "\t.section\t\".fini\",\"ax\"" | |
504 | ||
505 | #define TOC_SECTION_ASM_OP "\t.section\t\".got\",\"aw\"" | |
506 | ||
507 | /* Put PC relative got entries in .got2. */ | |
508 | #define MINIMAL_TOC_SECTION_ASM_OP \ | |
509 | ((TARGET_RELOCATABLE || flag_pic) ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"") | |
510 | ||
511 | #define SDATA_SECTION_ASM_OP "\t.section\t\".sdata\",\"aw\"" | |
512 | #define SDATA2_SECTION_ASM_OP "\t.section\t\".sdata2\",\"a\"" | |
513 | #define SBSS_SECTION_ASM_OP \ | |
514 | ((DEFAULT_ABI == ABI_SOLARIS) ? "\t.section\t\".sbss\",\"aw\"" : "\t.section\t\".sbss\",\"aw\",@nobits") | |
515 | ||
516 | ||
517 | /* Besides the usual ELF sections, we need a toc section. */ | |
518 | /* Override elfos.h definition. */ | |
519 | #undef EXTRA_SECTIONS | |
520 | #define EXTRA_SECTIONS in_const, in_ctors, in_dtors, in_toc, in_sdata, in_sdata2, in_sbss, in_init, in_fini | |
521 | ||
522 | /* Override elfos.h definition. */ | |
523 | #undef EXTRA_SECTION_FUNCTIONS | |
524 | #define EXTRA_SECTION_FUNCTIONS \ | |
525 | CONST_SECTION_FUNCTION \ | |
526 | CTORS_SECTION_FUNCTION \ | |
527 | DTORS_SECTION_FUNCTION \ | |
528 | TOC_SECTION_FUNCTION \ | |
529 | SDATA_SECTION_FUNCTION \ | |
530 | SDATA2_SECTION_FUNCTION \ | |
531 | SBSS_SECTION_FUNCTION \ | |
532 | INIT_SECTION_FUNCTION \ | |
533 | FINI_SECTION_FUNCTION | |
534 | ||
535 | #define TOC_SECTION_FUNCTION \ | |
536 | void \ | |
537 | toc_section () \ | |
538 | { \ | |
539 | if (in_section != in_toc) \ | |
540 | { \ | |
541 | in_section = in_toc; \ | |
542 | if (DEFAULT_ABI == ABI_AIX \ | |
543 | && TARGET_MINIMAL_TOC \ | |
544 | && !TARGET_RELOCATABLE) \ | |
545 | { \ | |
546 | if (! toc_initialized) \ | |
547 | { \ | |
548 | toc_initialized = 1; \ | |
549 | fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \ | |
550 | ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LCTOC", 0); \ | |
551 | fprintf (asm_out_file, "\t.tc "); \ | |
552 | ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1[TC],"); \ | |
553 | ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \ | |
554 | fprintf (asm_out_file, "\n"); \ | |
555 | \ | |
556 | fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \ | |
557 | ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \ | |
558 | fprintf (asm_out_file, " = .+32768\n"); \ | |
559 | } \ | |
560 | else \ | |
561 | fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \ | |
562 | } \ | |
563 | else if (DEFAULT_ABI == ABI_AIX && !TARGET_RELOCATABLE) \ | |
564 | fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \ | |
565 | else \ | |
566 | { \ | |
567 | fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \ | |
568 | if (! toc_initialized) \ | |
569 | { \ | |
570 | ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \ | |
571 | fprintf (asm_out_file, " = .+32768\n"); \ | |
572 | toc_initialized = 1; \ | |
573 | } \ | |
574 | } \ | |
575 | } \ | |
576 | } | |
577 | ||
578 | #define SDATA_SECTION_FUNCTION \ | |
579 | void \ | |
580 | sdata_section () \ | |
581 | { \ | |
582 | if (in_section != in_sdata) \ | |
583 | { \ | |
584 | in_section = in_sdata; \ | |
585 | fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \ | |
586 | } \ | |
587 | } | |
588 | ||
589 | #define SDATA2_SECTION_FUNCTION \ | |
590 | void \ | |
591 | sdata2_section () \ | |
592 | { \ | |
593 | if (in_section != in_sdata2) \ | |
594 | { \ | |
595 | in_section = in_sdata2; \ | |
596 | fprintf (asm_out_file, "%s\n", SDATA2_SECTION_ASM_OP); \ | |
597 | } \ | |
598 | } | |
599 | ||
600 | #define SBSS_SECTION_FUNCTION \ | |
601 | void \ | |
602 | sbss_section () \ | |
603 | { \ | |
604 | if (in_section != in_sbss) \ | |
605 | { \ | |
606 | in_section = in_sbss; \ | |
607 | fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP); \ | |
608 | } \ | |
609 | } | |
610 | ||
611 | #define INIT_SECTION_FUNCTION \ | |
612 | void \ | |
613 | init_section () \ | |
614 | { \ | |
615 | if (in_section != in_init) \ | |
616 | { \ | |
617 | in_section = in_init; \ | |
618 | fprintf (asm_out_file, "%s\n", INIT_SECTION_ASM_OP); \ | |
619 | } \ | |
620 | } | |
621 | ||
622 | #define FINI_SECTION_FUNCTION \ | |
623 | void \ | |
624 | fini_section () \ | |
625 | { \ | |
626 | if (in_section != in_fini) \ | |
627 | { \ | |
628 | in_section = in_fini; \ | |
629 | fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP); \ | |
630 | } \ | |
631 | } | |
632 | ||
633 | /* A C statement or statements to switch to the appropriate section | |
634 | for output of RTX in mode MODE. You can assume that RTX is some | |
635 | kind of constant in RTL. The argument MODE is redundant except in | |
636 | the case of a `const_int' rtx. Select the section by calling | |
637 | `text_section' or one of the alternatives for other sections. | |
638 | ||
639 | Do not define this macro if you put all constants in the read-only | |
640 | data section. */ | |
641 | ||
642 | /* Override elfos.h definition. */ | |
643 | #undef SELECT_RTX_SECTION | |
644 | #define SELECT_RTX_SECTION(MODE, X) rs6000_select_rtx_section (MODE, X) | |
645 | ||
646 | /* A C statement or statements to switch to the appropriate | |
647 | section for output of DECL. DECL is either a `VAR_DECL' node | |
648 | or a constant of some sort. RELOC indicates whether forming | |
649 | the initial value of DECL requires link-time relocations. */ | |
650 | ||
651 | /* Override elfos.h definition. */ | |
652 | #undef SELECT_SECTION | |
653 | #define SELECT_SECTION(DECL, RELOC) rs6000_select_section (DECL, RELOC) | |
654 | ||
655 | /* A C statement to build up a unique section name, expressed as a | |
656 | STRING_CST node, and assign it to DECL_SECTION_NAME (decl). | |
657 | RELOC indicates whether the initial value of EXP requires | |
658 | link-time relocations. If you do not define this macro, GCC will use | |
659 | the symbol name prefixed by `.' as the section name. Note - this | |
660 | macro can now be called for unitialised data items as well as | |
661 | initialised data and functions. */ | |
662 | ||
663 | /* Override elfos.h definition. */ | |
664 | #undef UNIQUE_SECTION | |
665 | #define UNIQUE_SECTION(DECL, RELOC) rs6000_unique_section (DECL, RELOC) | |
666 | ||
667 | /* Return non-zero if this entry is to be written into the constant pool | |
668 | in a special way. We do so if this is a SYMBOL_REF, LABEL_REF or a CONST | |
669 | containing one of them. If -mfp-in-toc (the default), we also do | |
670 | this for floating-point constants. We actually can only do this | |
671 | if the FP formats of the target and host machines are the same, but | |
672 | we can't check that since not every file that uses | |
673 | GO_IF_LEGITIMATE_ADDRESS_P includes real.h. | |
674 | ||
675 | Unlike AIX, we don't key off of -mminimal-toc, but instead do not | |
676 | allow floating point constants in the TOC if -mrelocatable. */ | |
677 | ||
678 | #undef ASM_OUTPUT_SPECIAL_POOL_ENTRY_P | |
679 | #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) \ | |
680 | (TARGET_TOC \ | |
681 | && (GET_CODE (X) == SYMBOL_REF \ | |
682 | || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \ | |
683 | && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \ | |
684 | || GET_CODE (X) == LABEL_REF \ | |
685 | || (GET_CODE (X) == CONST_INT \ | |
686 | && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode)) \ | |
687 | || (!TARGET_NO_FP_IN_TOC \ | |
688 | && !TARGET_RELOCATABLE \ | |
689 | && GET_CODE (X) == CONST_DOUBLE \ | |
690 | && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ | |
691 | && BITS_PER_WORD == HOST_BITS_PER_INT))) | |
692 | ||
693 | /* These macros generate the special .type and .size directives which | |
694 | are used to set the corresponding fields of the linker symbol table | |
695 | entries in an ELF object file under SVR4. These macros also output | |
696 | the starting labels for the relevant functions/objects. */ | |
697 | ||
698 | /* Write the extra assembler code needed to declare a function properly. | |
699 | Some svr4 assemblers need to also have something extra said about the | |
700 | function's return value. We allow for that here. */ | |
701 | ||
702 | extern int rs6000_pic_labelno; | |
703 | ||
704 | /* Override elfos.h definition. */ | |
705 | #undef ASM_DECLARE_FUNCTION_NAME | |
706 | #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ | |
707 | do { \ | |
708 | const char *init_ptr = (TARGET_64BIT) ? ".quad" : ".long"; \ | |
709 | \ | |
710 | if (TARGET_RELOCATABLE && (get_pool_size () != 0 || profile_flag) \ | |
711 | && uses_TOC()) \ | |
712 | { \ | |
713 | char buf[256]; \ | |
714 | \ | |
715 | ASM_OUTPUT_INTERNAL_LABEL (FILE, "LCL", rs6000_pic_labelno); \ | |
716 | \ | |
717 | ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1); \ | |
718 | fprintf (FILE, "\t%s ", init_ptr); \ | |
719 | assemble_name (FILE, buf); \ | |
720 | putc ('-', FILE); \ | |
721 | ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); \ | |
722 | assemble_name (FILE, buf); \ | |
723 | putc ('\n', FILE); \ | |
724 | } \ | |
725 | \ | |
726 | fprintf (FILE, "%s", TYPE_ASM_OP); \ | |
727 | assemble_name (FILE, NAME); \ | |
728 | putc (',', FILE); \ | |
729 | fprintf (FILE, TYPE_OPERAND_FMT, "function"); \ | |
730 | putc ('\n', FILE); \ | |
731 | ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \ | |
732 | \ | |
733 | if (DEFAULT_ABI == ABI_AIX) \ | |
734 | { \ | |
735 | const char *desc_name, *orig_name; \ | |
736 | \ | |
737 | STRIP_NAME_ENCODING (orig_name, NAME); \ | |
738 | desc_name = orig_name; \ | |
739 | while (*desc_name == '.') \ | |
740 | desc_name++; \ | |
741 | \ | |
742 | if (TREE_PUBLIC (DECL)) \ | |
743 | fprintf (FILE, "\t.globl %s\n", desc_name); \ | |
744 | \ | |
745 | fprintf (FILE, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \ | |
746 | fprintf (FILE, "%s:\n", desc_name); \ | |
747 | fprintf (FILE, "\t%s %s\n", init_ptr, orig_name); \ | |
748 | fprintf (FILE, "\t%s _GLOBAL_OFFSET_TABLE_\n", init_ptr); \ | |
749 | if (DEFAULT_ABI == ABI_AIX) \ | |
750 | fprintf (FILE, "\t%s 0\n", init_ptr); \ | |
751 | fprintf (FILE, "\t.previous\n"); \ | |
752 | } \ | |
753 | ASM_OUTPUT_LABEL (FILE, NAME); \ | |
754 | } while (0) | |
755 | ||
756 | /* A C compound statement that outputs the assembler code for a thunk function, | |
757 | used to implement C++ virtual function calls with multiple inheritance. The | |
758 | thunk acts as a wrapper around a virtual function, adjusting the implicit | |
759 | object parameter before handing control off to the real function. | |
760 | ||
761 | First, emit code to add the integer DELTA to the location that contains the | |
762 | incoming first argument. Assume that this argument contains a pointer, and | |
763 | is the one used to pass the this' pointer in C++. This is the incoming | |
764 | argument *before* the function prologue, e.g. %o0' on a sparc. The | |
765 | addition must preserve the values of all other incoming arguments. | |
766 | ||
767 | After the addition, emit code to jump to FUNCTION, which is a | |
768 | FUNCTION_DECL'. This is a direct pure jump, not a call, and does not touch | |
769 | the return address. Hence returning from FUNCTION will return to whoever | |
770 | called the current thunk'. | |
771 | ||
772 | The effect must be as if FUNCTION had been called directly with the adjusted | |
773 | first argument. This macro is responsible for emitting all of the code for | |
774 | a thunk function; FUNCTION_PROLOGUE' and FUNCTION_EPILOGUE' are not | |
775 | invoked. | |
776 | ||
777 | The THUNK_FNDECL is redundant. (DELTA and FUNCTION have already been | |
778 | extracted from it.) It might possibly be useful on some targets, but | |
779 | probably not. | |
780 | ||
781 | If you do not define this macro, the target-independent code in the C++ | |
782 | frontend will generate a less efficient heavyweight thunk that calls | |
783 | FUNCTION instead of jumping to it. The generic approach does not support | |
784 | varargs. */ | |
785 | ||
786 | #define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \ | |
787 | output_mi_thunk (FILE, THUNK_FNDECL, DELTA, FUNCTION) | |
788 | ||
789 | /* How to renumber registers for dbx and gdb. */ | |
790 | ||
791 | #define DBX_REGISTER_NUMBER(REGNO) (REGNO) | |
792 | ||
793 | /* The USER_LABEL_PREFIX stuff is affected by the -fleading-underscore | |
794 | flag. The LOCAL_LABEL_PREFIX variable is used by dbxelf.h. */ | |
795 | ||
796 | #define LOCAL_LABEL_PREFIX "." | |
797 | #define USER_LABEL_PREFIX "" | |
798 | ||
799 | /* svr4.h overrides ASM_OUTPUT_INTERNAL_LABEL. */ | |
800 | ||
801 | #define ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX) \ | |
802 | asm_fprintf (FILE, "%L%s", PREFIX) | |
803 | ||
804 | #define ASM_OUTPUT_LABEL(FILE,NAME) \ | |
805 | (assemble_name (FILE, NAME), fputs (":\n", FILE)) | |
806 | ||
807 | /* This is how to output a command to make the user-level label named NAME | |
808 | defined for reference from other files. */ | |
809 | ||
810 | #define ASM_GLOBALIZE_LABEL(FILE,NAME) \ | |
811 | do { fputs ("\t.globl ", FILE); \ | |
812 | assemble_name (FILE, NAME); putc ('\n', FILE);} while (0) | |
813 | ||
814 | /* This is how to allocate empty space in some section. Use .space | |
815 | instead of .zero because the Solaris PowerPC assembler doesn't | |
816 | like it, and gas accepts either syntax. */ | |
817 | ||
818 | /* Override elfos.h definition. */ | |
819 | #undef SKIP_ASM_OP | |
820 | #define SKIP_ASM_OP "\t.space\t" | |
821 | ||
822 | /* This says how to output assembler code to declare an | |
823 | uninitialized internal linkage data object. Under SVR4, | |
824 | the linker seems to want the alignment of data objects | |
825 | to depend on their types. We do exactly that here. */ | |
826 | ||
827 | #define LOCAL_ASM_OP "\t.local\t" | |
828 | ||
829 | #define LCOMM_ASM_OP "\t.lcomm\t" | |
830 | ||
831 | /* Override elfos.h definition. */ | |
832 | #undef ASM_OUTPUT_ALIGNED_LOCAL | |
833 | #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ | |
834 | do { \ | |
835 | if (rs6000_sdata != SDATA_NONE && (SIZE) > 0 \ | |
836 | && (SIZE) <= g_switch_value) \ | |
837 | { \ | |
838 | sbss_section (); \ | |
839 | ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT)); \ | |
840 | ASM_OUTPUT_LABEL (FILE, NAME); \ | |
841 | ASM_OUTPUT_SKIP (FILE, SIZE); \ | |
842 | if (!flag_inhibit_size_directive && (SIZE) > 0) \ | |
843 | { \ | |
844 | fprintf (FILE, "%s", SIZE_ASM_OP); \ | |
845 | assemble_name (FILE, NAME); \ | |
846 | fprintf (FILE, ",%d\n", SIZE); \ | |
847 | } \ | |
848 | } \ | |
849 | else \ | |
850 | { \ | |
851 | fprintf (FILE, "%s", LCOMM_ASM_OP); \ | |
852 | assemble_name ((FILE), (NAME)); \ | |
853 | fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \ | |
854 | } \ | |
855 | } while (0) | |
856 | ||
857 | /* Describe how to emit uninitialized external linkage items. */ | |
858 | #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ | |
859 | do { \ | |
860 | ASM_GLOBALIZE_LABEL (FILE, NAME); \ | |
861 | ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \ | |
862 | } while (0) | |
863 | ||
864 | /* Switch Recognition by gcc.c. Add -G xx support. */ | |
865 | ||
866 | /* Override svr4.h definition. */ | |
867 | #undef SWITCH_TAKES_ARG | |
868 | #define SWITCH_TAKES_ARG(CHAR) \ | |
869 | ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o' \ | |
870 | || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \ | |
871 | || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x' \ | |
872 | || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V' \ | |
873 | || (CHAR) == 'B' || (CHAR) == 'b' || (CHAR) == 'G') | |
874 | ||
875 | /* Output .file. */ | |
876 | /* Override elfos.h definition. */ | |
877 | #undef ASM_FILE_START | |
878 | #define ASM_FILE_START(FILE) \ | |
879 | do { \ | |
880 | output_file_directive ((FILE), main_input_filename); \ | |
881 | rs6000_file_start (FILE, TARGET_CPU_DEFAULT); \ | |
882 | } while (0) | |
883 | ||
884 | ||
885 | extern int fixuplabelno; | |
886 | ||
887 | /* This is how to output an assembler line defining an `int' constant. | |
888 | For -mrelocatable, we mark all addresses that need to be fixed up | |
889 | in the .fixup section. */ | |
890 | /* Override rs6000.h definition. */ | |
891 | #undef ASM_OUTPUT_INT | |
892 | #define ASM_OUTPUT_INT(FILE,VALUE) \ | |
893 | do { \ | |
894 | static int recurse = 0; \ | |
895 | if (TARGET_RELOCATABLE \ | |
896 | && in_section != in_toc \ | |
897 | && in_section != in_text \ | |
898 | && in_section != in_ctors \ | |
899 | && in_section != in_dtors \ | |
900 | && !recurse \ | |
901 | && GET_CODE (VALUE) != CONST_INT \ | |
902 | && GET_CODE (VALUE) != CONST_DOUBLE \ | |
903 | && CONSTANT_P (VALUE)) \ | |
904 | { \ | |
905 | char buf[256]; \ | |
906 | \ | |
907 | recurse = 1; \ | |
908 | ASM_GENERATE_INTERNAL_LABEL (buf, "LCP", fixuplabelno); \ | |
909 | fixuplabelno++; \ | |
910 | ASM_OUTPUT_LABEL (FILE, buf); \ | |
911 | fprintf (FILE, "\t.long ("); \ | |
912 | output_addr_const (FILE, (VALUE)); \ | |
913 | fprintf (FILE, ")@fixup\n"); \ | |
914 | fprintf (FILE, "\t.section\t\".fixup\",\"aw\"\n"); \ | |
915 | ASM_OUTPUT_ALIGN (FILE, 2); \ | |
916 | fprintf (FILE, "\t.long\t"); \ | |
917 | assemble_name (FILE, buf); \ | |
918 | fprintf (FILE, "\n\t.previous\n"); \ | |
919 | recurse = 0; \ | |
920 | } \ | |
921 | /* Remove initial .'s to turn a -mcall-aixdesc function \ | |
922 | address into the address of the descriptor, not the function \ | |
923 | itself. */ \ | |
924 | else if (GET_CODE (VALUE) == SYMBOL_REF \ | |
925 | && XSTR (VALUE, 0)[0] == '.' \ | |
926 | && DEFAULT_ABI == ABI_AIX) \ | |
927 | { \ | |
928 | const char *name = XSTR (VALUE, 0); \ | |
929 | while (*name == '.') \ | |
930 | name++; \ | |
931 | \ | |
932 | fprintf (FILE, "\t.long %s\n", name); \ | |
933 | } \ | |
934 | else \ | |
935 | { \ | |
936 | fprintf (FILE, "\t.long "); \ | |
937 | output_addr_const (FILE, (VALUE)); \ | |
938 | fprintf (FILE, "\n"); \ | |
939 | } \ | |
940 | } while (0) | |
941 | ||
942 | /* This is the end of what might become sysv4.h. */ | |
943 | ||
944 | /* Allow stabs and dwarf, for now, make stabs the default debugging type, | |
945 | not dwarf since G++ doesn't support dwarf. */ | |
946 | #undef PREFERRED_DEBUGGING_TYPE | |
947 | #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG | |
948 | ||
949 | #define DBX_DEBUGGING_INFO | |
950 | ||
951 | /* If we are referencing a function that is static or is known to be | |
952 | in this file, make the SYMBOL_REF special. We can use this to indicate | |
953 | that we can branch to this function without emitting a no-op after the | |
954 | call. For real AIX calling sequences, we also replace the | |
955 | function name with the real name (1 or 2 leading .'s), rather than | |
956 | the function descriptor name. This saves a lot of overriding code | |
957 | to read the prefixes. */ | |
958 | ||
959 | #undef ENCODE_SECTION_INFO | |
960 | #define ENCODE_SECTION_INFO(DECL) rs6000_encode_section_info (DECL) | |
961 | ||
962 | /* The ELF version doesn't encode [DS] or whatever at the end of symbols. */ | |
963 | ||
964 | #define RS6000_OUTPUT_BASENAME(FILE, NAME) \ | |
965 | assemble_name (FILE, NAME) | |
966 | ||
967 | /* This macro gets just the user-specified name | |
968 | out of the string in a SYMBOL_REF. Discard | |
969 | a leading * or @. */ | |
970 | #define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \ | |
971 | do { \ | |
972 | const char *_name = SYMBOL_NAME; \ | |
973 | while (*_name == '*' || *_name == '@') \ | |
974 | _name++; \ | |
975 | (VAR) = _name; \ | |
976 | } while (0) | |
977 | ||
978 | /* This is how to output a reference to a user-level label named NAME. | |
979 | `assemble_name' uses this. */ | |
980 | ||
981 | /* Override elfos.h definition. */ | |
982 | #undef ASM_OUTPUT_LABELREF | |
983 | #define ASM_OUTPUT_LABELREF(FILE,NAME) \ | |
984 | do { \ | |
985 | const char *_name = NAME; \ | |
986 | if (*_name == '@') \ | |
987 | _name++; \ | |
988 | \ | |
989 | if (*_name == '*') \ | |
990 | fprintf (FILE, "%s", _name + 1); \ | |
991 | else \ | |
992 | asm_fprintf (FILE, "%U%s", _name); \ | |
993 | } while (0) | |
994 | ||
995 | /* Switch into a generic section. | |
996 | ||
997 | We make the section read-only and executable for a function decl, | |
998 | read-only for a const data decl, and writable for a non-const data decl. | |
999 | ||
1000 | If the section has already been defined, we must not | |
1001 | emit the attributes here. The SVR4 assembler does not | |
1002 | recognize section redefinitions. | |
1003 | If DECL is NULL, no attributes are emitted. | |
1004 | ||
1005 | Note, Solaris as doesn't like @nobits, and gas can handle .sbss without | |
1006 | needing @nobits. */ | |
1007 | ||
1008 | /* Override elfos.h definition. */ | |
1009 | #undef ASM_OUTPUT_SECTION_NAME | |
1010 | #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \ | |
1011 | do { \ | |
1012 | static struct section_info \ | |
1013 | { \ | |
1014 | struct section_info *next; \ | |
1015 | char *name; \ | |
1016 | enum sect_enum {SECT_RW, SECT_RO, SECT_EXEC} type; \ | |
1017 | } *sections; \ | |
1018 | struct section_info *s; \ | |
1019 | const char *mode; \ | |
1020 | enum sect_enum type; \ | |
1021 | \ | |
1022 | for (s = sections; s; s = s->next) \ | |
1023 | if (!strcmp (NAME, s->name)) \ | |
1024 | break; \ | |
1025 | \ | |
1026 | if (DECL && TREE_CODE (DECL) == FUNCTION_DECL) \ | |
1027 | type = SECT_EXEC, mode = "ax"; \ | |
1028 | else if (DECL && DECL_READONLY_SECTION (DECL, RELOC) && !TARGET_RELOCATABLE && !flag_pic) \ | |
1029 | type = SECT_RO, mode = "a"; \ | |
1030 | else \ | |
1031 | type = SECT_RW, mode = "aw"; \ | |
1032 | \ | |
1033 | if (s == 0) \ | |
1034 | { \ | |
1035 | s = (struct section_info *) xmalloc (sizeof (struct section_info)); \ | |
1036 | s->name = xmalloc ((strlen (NAME) + 1) * sizeof (*NAME)); \ | |
1037 | strcpy (s->name, NAME); \ | |
1038 | s->type = type; \ | |
1039 | s->next = sections; \ | |
1040 | sections = s; \ | |
1041 | fprintf (FILE, "\t.section\t\"%s\",\"%s\"\n", NAME, mode); \ | |
1042 | } \ | |
1043 | else \ | |
1044 | { \ | |
1045 | if (DECL && s->type != type) \ | |
1046 | error_with_decl (DECL, "%s causes a section type conflict"); \ | |
1047 | \ | |
1048 | fprintf (FILE, "\t.section\t\"%s\"\n", NAME); \ | |
1049 | } \ | |
1050 | } while (0) | |
1051 | ||
1052 | /* Override elfos.h definition. */ | |
1053 | #undef ASM_OUTPUT_CONSTRUCTOR | |
1054 | #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \ | |
1055 | do { \ | |
1056 | if (DEFAULT_ABI != ABI_SOLARIS) \ | |
1057 | { \ | |
1058 | ctors_section (); \ | |
1059 | fprintf (FILE, "%s", INT_ASM_OP); \ | |
1060 | assemble_name (FILE, NAME); \ | |
1061 | } \ | |
1062 | else \ | |
1063 | { \ | |
1064 | init_section (); \ | |
1065 | fputs ("\tbl ", FILE); \ | |
1066 | assemble_name (FILE, NAME); \ | |
1067 | } \ | |
1068 | fputs ("\n", FILE); \ | |
1069 | } while (0) | |
1070 | ||
1071 | /* A C statement (sans semicolon) to output an element in the table of | |
1072 | global destructors. */ | |
1073 | /* Override elfos.h definition. */ | |
1074 | #undef ASM_OUTPUT_DESTRUCTOR | |
1075 | #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \ | |
1076 | do { \ | |
1077 | if (DEFAULT_ABI != ABI_SOLARIS) \ | |
1078 | { \ | |
1079 | dtors_section (); \ | |
1080 | fprintf (FILE, "%s", INT_ASM_OP); \ | |
1081 | assemble_name (FILE, NAME); \ | |
1082 | } \ | |
1083 | else \ | |
1084 | { \ | |
1085 | fini_section (); \ | |
1086 | fputs ("\tbl ", FILE); \ | |
1087 | assemble_name (FILE, NAME); \ | |
1088 | } \ | |
1089 | fputs ("\n", FILE); \ | |
1090 | } while (0) | |
1091 | ||
1092 | /* But, to make this work, we have to output the stabs for the function | |
1093 | name *first*... */ | |
1094 | ||
1095 | #define DBX_FUNCTION_FIRST | |
1096 | ||
1097 | /* This is the end of what might become sysv4dbx.h. */ | |
1098 | ||
1099 | /* Override rs6000.h definition. */ | |
1100 | #undef TARGET_VERSION | |
1101 | #define TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)"); | |
1102 | \f | |
1103 | #define CPP_PREDEFINES \ | |
1104 | "-DPPC -Dunix -D__svr4__ -Asystem=unix -Asystem=svr4 -Acpu=powerpc -Amachine=powerpc" | |
1105 | ||
1106 | /* Pass various options to the assembler. */ | |
1107 | /* Override svr4.h definition. */ | |
1108 | #undef ASM_SPEC | |
1109 | #define ASM_SPEC "%(asm_cpu) \ | |
1110 | %{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \ | |
1111 | %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \ | |
1112 | %{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \ | |
1113 | %{memb} %{!memb: %{msdata: -memb} %{msdata=eabi: -memb}} \ | |
1114 | %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian} \ | |
1115 | %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \ | |
1116 | %{mcall-solaris: -mlittle -msolaris} \ | |
1117 | %{mcall-i960-old: -mlittle} \ | |
1118 | %{mcall-linux: -mbig} \ | |
1119 | %{mcall-netbsd: -mbig} }}}}" | |
1120 | ||
1121 | #define CC1_ENDIAN_BIG_SPEC "" | |
1122 | ||
1123 | #define CC1_ENDIAN_LITTLE_SPEC "\ | |
1124 | %{!mstrict-align: %{!mno-strict-align: \ | |
1125 | %{!mcall-i960-old: \ | |
1126 | -mstrict-align \ | |
1127 | } \ | |
1128 | }}" | |
1129 | ||
1130 | #define CC1_ENDIAN_DEFAULT_SPEC "%(cc1_endian_big_spec)" | |
1131 | ||
1132 | /* Pass -G xxx to the compiler and set correct endian mode. */ | |
1133 | #define CC1_SPEC "%{G*} \ | |
1134 | %{mlittle: %(cc1_endian_little)} %{!mlittle: %{mlittle-endian: %(cc1_endian_little)}} \ | |
1135 | %{mbig: %(cc1_endian_big)} %{!mbig: %{mbig-endian: %(cc1_endian_big)}} \ | |
1136 | %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \ | |
1137 | %{mcall-aixdesc: -mbig %(cc1_endian_big) } \ | |
1138 | %{mcall-solaris: -mlittle %(cc1_endian_little) } \ | |
1139 | %{mcall-i960-old: -mlittle %(cc1_endian_little) } \ | |
1140 | %{mcall-linux: -mbig %(cc1_endian_big) } \ | |
1141 | %{mcall-netbsd: -mbig %(cc1_endian_big) } \ | |
1142 | %{!mcall-aixdesc: %{!mcall-solaris: %{!mcall-i960-old: %{!mcall-linux: %{!mcall-netbsd: \ | |
1143 | %(cc1_endian_default) \ | |
1144 | }}}}} \ | |
1145 | }}}} \ | |
1146 | %{mcall-solaris: -mregnames } \ | |
1147 | %{mno-sdata: -msdata=none } \ | |
1148 | %{meabi: %{!mcall-*: -mcall-sysv }} \ | |
1149 | %{!meabi: %{!mno-eabi: \ | |
1150 | %{mrelocatable: -meabi } \ | |
1151 | %{mcall-solaris: -mno-eabi } \ | |
1152 | %{mcall-i960-old: -meabi } \ | |
1153 | %{mcall-linux: -mno-eabi } \ | |
1154 | %{mcall-netbsd: -mno-eabi }}} \ | |
1155 | %{msdata: -msdata=default} \ | |
1156 | %{mno-sdata: -msdata=none} \ | |
1157 | %{profile: -p}" | |
1158 | ||
1159 | /* Don't put -Y P,<path> for cross compilers. */ | |
1160 | #ifndef CROSS_COMPILE | |
1161 | #define LINK_PATH_SPEC "\ | |
1162 | %{!R*:%{L*:-R %*}} \ | |
1163 | %{!nostdlib: %{!YP,*: \ | |
1164 | %{compat-bsd: \ | |
1165 | %{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ | |
1166 | %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}} \ | |
1167 | %{!R*: %{!L*: -R /usr/ucblib}} \ | |
1168 | %{!compat-bsd: \ | |
1169 | %{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ | |
1170 | %{!p:-Y P,/usr/ccs/lib:/usr/lib}}}}" | |
1171 | ||
1172 | #else | |
1173 | #define LINK_PATH_SPEC "" | |
1174 | #endif | |
1175 | ||
1176 | /* Default starting address if specified. */ | |
1177 | #define LINK_START_SPEC "\ | |
1178 | %{mads: %(link_start_ads) } \ | |
1179 | %{myellowknife: %(link_start_yellowknife) } \ | |
1180 | %{mmvme: %(link_start_mvme) } \ | |
1181 | %{msim: %(link_start_sim) } \ | |
1182 | %{mcall-linux: %(link_start_linux) } \ | |
1183 | %{mcall-netbsd: %(link_start_netbsd) } \ | |
1184 | %{mcall-solaris: %(link_start_solaris) } \ | |
1185 | %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(link_start_default) }}}}}}}" | |
1186 | ||
1187 | #define LINK_START_DEFAULT_SPEC "" | |
1188 | ||
1189 | /* Override svr4.h definition. */ | |
1190 | #undef LINK_SPEC | |
1191 | #define LINK_SPEC "\ | |
1192 | %{h*} %{v:-V} %{G*} \ | |
1193 | %{Wl,*:%*} %{YP,*} %{R*} \ | |
1194 | %{Qy:} %{!Qn:-Qy} \ | |
1195 | %(link_shlib) \ | |
1196 | %{!Wl,-T*: %{!T*: %(link_start) }} \ | |
1197 | %(link_target) \ | |
1198 | %(link_os)" | |
1199 | ||
1200 | /* For now, turn off shared libraries by default. */ | |
1201 | #ifndef SHARED_LIB_SUPPORT | |
1202 | #define NO_SHARED_LIB_SUPPORT | |
1203 | #endif | |
1204 | ||
1205 | #ifndef NO_SHARED_LIB_SUPPORT | |
1206 | /* Shared libraries are default. */ | |
1207 | #define LINK_SHLIB_SPEC "\ | |
1208 | %{!static: %(link_path) %{!R*:%{L*:-R %*}}} \ | |
1209 | %{mshlib: } \ | |
1210 | %{static:-dn -Bstatic} \ | |
1211 | %{shared:-G -dy -z text} \ | |
1212 | %{symbolic:-Bsymbolic -G -dy -z text}" | |
1213 | ||
1214 | #else | |
1215 | /* Shared libraries are not default. */ | |
1216 | #define LINK_SHLIB_SPEC "\ | |
1217 | %{mshlib: %(link_path) } \ | |
1218 | %{!mshlib: %{!shared: %{!symbolic: -dn -Bstatic}}} \ | |
1219 | %{static: } \ | |
1220 | %{shared:-G -dy -z text %(link_path) } \ | |
1221 | %{symbolic:-Bsymbolic -G -dy -z text %(link_path) }" | |
1222 | #endif | |
1223 | ||
1224 | /* Override the default target of the linker. */ | |
1225 | #define LINK_TARGET_SPEC "\ | |
1226 | %{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } \ | |
1227 | %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \ | |
1228 | %{mcall-i960-old: --oformat elf32-powerpcle} \ | |
1229 | %{mcall-solaris: --oformat elf32-powerpcle} \ | |
1230 | }}}}" | |
1231 | ||
1232 | /* Any specific OS flags. */ | |
1233 | #define LINK_OS_SPEC "\ | |
1234 | %{mads: %(link_os_ads) } \ | |
1235 | %{myellowknife: %(link_os_yellowknife) } \ | |
1236 | %{mmvme: %(link_os_mvme) } \ | |
1237 | %{msim: %(link_os_sim) } \ | |
1238 | %{mcall-linux: %(link_os_linux) } \ | |
1239 | %{mcall-netbsd: %(link_os_netbsd) } \ | |
1240 | %{mcall-solaris: %(link_os_solaris) } \ | |
1241 | %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(link_os_default) }}}}}}}" | |
1242 | ||
1243 | #define LINK_OS_DEFAULT_SPEC "" | |
1244 | ||
1245 | #define CPP_SYSV_SPEC \ | |
1246 | "%{mrelocatable*: -D_RELOCATABLE} \ | |
1247 | %{fpic: -D__PIC__=1 -D__pic__=1} \ | |
1248 | %{!fpic: %{fPIC: -D__PIC__=2 -D__pic__=2}} \ | |
1249 | %{mlong-double-128: -D__LONG_DOUBLE_128__=1} \ | |
1250 | %{!mlong-double-64: %(cpp_longdouble_default)} \ | |
1251 | %{mcall-sysv: -D_CALL_SYSV} \ | |
1252 | %{mcall-aix: -D_CALL_AIX} %{mcall-aixdesc: -D_CALL_AIX -D_CALL_AIXDESC} \ | |
1253 | %{!mcall-sysv: %{!mcall-aix: %{!mcall-aixdesc: %(cpp_sysv_default) }}} \ | |
1254 | %{msoft-float: -D_SOFT_FLOAT} \ | |
1255 | %{!msoft-float: %{!mhard-float: \ | |
1256 | %{mcpu=401: -D_SOFT_FLOAT} \ | |
1257 | %{mcpu=403: -D_SOFT_FLOAT} \ | |
1258 | %{mcpu=ec603e: -D_SOFT_FLOAT} \ | |
1259 | %{mcpu=801: -D_SOFT_FLOAT} \ | |
1260 | %{mcpu=821: -D_SOFT_FLOAT} \ | |
1261 | %{mcpu=823: -D_SOFT_FLOAT} \ | |
1262 | %{mcpu=860: -D_SOFT_FLOAT} \ | |
1263 | %{!mcpu*: %(cpp_float_default) }}}" | |
1264 | ||
1265 | /* Whether floating point is disabled by default. */ | |
1266 | #define CPP_FLOAT_DEFAULT_SPEC "" | |
1267 | ||
1268 | /* Whether 'long double' is 128 bits by default. */ | |
1269 | #define CPP_LONGDOUBLE_DEFAULT_SPEC "" | |
1270 | ||
1271 | #define CPP_SYSV_DEFAULT_SPEC "-D_CALL_SYSV" | |
1272 | ||
1273 | #define CPP_ENDIAN_BIG_SPEC "-D_BIG_ENDIAN -D__BIG_ENDIAN__ -Amachine=bigendian" | |
1274 | ||
1275 | #define CPP_ENDIAN_LITTLE_SPEC "-D_LITTLE_ENDIAN -D__LITTLE_ENDIAN__ -Amachine=littleendian" | |
1276 | ||
1277 | #define CPP_ENDIAN_SOLARIS_SPEC "-D__LITTLE_ENDIAN__ -Amachine=littleendian" | |
1278 | ||
1279 | /* For solaris, don't define _LITTLE_ENDIAN, it conflicts with a header file. */ | |
1280 | #define CPP_ENDIAN_SPEC \ | |
1281 | "%{mlittle: %(cpp_endian_little) } \ | |
1282 | %{mlittle-endian: %(cpp_endian_little) } \ | |
1283 | %{mbig: %(cpp_endian_big) } \ | |
1284 | %{mbig-endian: %(cpp_endian_big) } \ | |
1285 | %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \ | |
1286 | %{mcall-solaris: %(cpp_endian_solaris) } \ | |
1287 | %{mcall-linux: %(cpp_endian_big) } \ | |
1288 | %{mcall-netbsd: %(cpp_endian_big) } \ | |
1289 | %{mcall-i960-old: %(cpp_endian_little) } \ | |
1290 | %{mcall-aixdesc: %(cpp_endian_big) } \ | |
1291 | %{!mcall-solaris: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-aixdesc: %(cpp_endian_default) }}}}}}}}" | |
1292 | ||
1293 | #define CPP_ENDIAN_DEFAULT_SPEC "%(cpp_endian_big)" | |
1294 | ||
1295 | /* Override rs6000.h definition. */ | |
1296 | #undef CPP_SPEC | |
1297 | #define CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_sysv) %(cpp_endian) %(cpp_cpu) \ | |
1298 | %{mads: %(cpp_os_ads) } \ | |
1299 | %{myellowknife: %(cpp_os_yellowknife) } \ | |
1300 | %{mmvme: %(cpp_os_mvme) } \ | |
1301 | %{msim: %(cpp_os_sim) } \ | |
1302 | %{mcall-linux: %(cpp_os_linux) } \ | |
1303 | %{mcall-netbsd: %(cpp_os_netbsd) } \ | |
1304 | %{mcall-solaris: %(cpp_os_solaris) } \ | |
1305 | %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(cpp_os_default) }}}}}}}" | |
1306 | ||
1307 | #define CPP_OS_DEFAULT_SPEC "" | |
1308 | ||
1309 | /* Override svr4.h definition. */ | |
1310 | #undef STARTFILE_SPEC | |
1311 | #define STARTFILE_SPEC "\ | |
1312 | %{mads: %(startfile_ads) } \ | |
1313 | %{myellowknife: %(startfile_yellowknife) } \ | |
1314 | %{mmvme: %(startfile_mvme) } \ | |
1315 | %{msim: %(startfile_sim) } \ | |
1316 | %{mcall-linux: %(startfile_linux) } \ | |
1317 | %{mcall-netbsd: %(startfile_netbsd) } \ | |
1318 | %{mcall-solaris: %(startfile_solaris) } \ | |
1319 | %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(startfile_default) }}}}}}}" | |
1320 | ||
1321 | #define STARTFILE_DEFAULT_SPEC "" | |
1322 | ||
1323 | /* Override svr4.h definition. */ | |
1324 | #undef LIB_SPEC | |
1325 | #define LIB_SPEC "\ | |
1326 | %{mads: %(lib_ads) } \ | |
1327 | %{myellowknife: %(lib_yellowknife) } \ | |
1328 | %{mmvme: %(lib_mvme) } \ | |
1329 | %{msim: %(lib_sim) } \ | |
1330 | %{mcall-linux: %(lib_linux) } \ | |
1331 | %{mcall-netbsd: %(lib_netbsd) } \ | |
1332 | %{mcall-solaris: %(lib_solaris) } \ | |
1333 | %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(lib_default) }}}}}}}" | |
1334 | ||
1335 | #define LIB_DEFAULT_SPEC "" | |
1336 | ||
1337 | /* Override svr4.h definition. */ | |
1338 | #undef ENDFILE_SPEC | |
1339 | #define ENDFILE_SPEC "\ | |
1340 | %{mads: %(endfile_ads)} \ | |
1341 | %{myellowknife: %(endfile_yellowknife)} \ | |
1342 | %{mmvme: %(endfile_mvme)} \ | |
1343 | %{msim: %(endfile_sim)} \ | |
1344 | %{mcall-linux: %(endfile_linux) } \ | |
1345 | %{mcall-netbsd: %(endfile_netbsd) } \ | |
1346 | %{mcall-solaris: %(endfile_solaris)} \ | |
1347 | %{mvxworks: %(endfile_vxworks) } \ | |
1348 | %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %{!mvxworks: %(endfile_default) }}}}}}}}" | |
1349 | ||
1350 | #define ENDFILE_DEFAULT_SPEC "" | |
1351 | ||
1352 | /* Motorola ADS support. */ | |
1353 | #define LIB_ADS_SPEC "--start-group -lads -lc --end-group" | |
1354 | ||
1355 | #define STARTFILE_ADS_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s" | |
1356 | ||
1357 | #define ENDFILE_ADS_SPEC "crtend.o%s ecrtn.o%s" | |
1358 | ||
1359 | #define LINK_START_ADS_SPEC "-T ads.ld%s" | |
1360 | ||
1361 | #define LINK_OS_ADS_SPEC "" | |
1362 | ||
1363 | #define CPP_OS_ADS_SPEC "" | |
1364 | ||
1365 | /* Motorola Yellowknife support. */ | |
1366 | #define LIB_YELLOWKNIFE_SPEC "--start-group -lyk -lc --end-group" | |
1367 | ||
1368 | #define STARTFILE_YELLOWKNIFE_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s" | |
1369 | ||
1370 | #define ENDFILE_YELLOWKNIFE_SPEC "crtend.o%s ecrtn.o%s" | |
1371 | ||
1372 | #define LINK_START_YELLOWKNIFE_SPEC "-T yellowknife.ld%s" | |
1373 | ||
1374 | #define LINK_OS_YELLOWKNIFE_SPEC "" | |
1375 | ||
1376 | #define CPP_OS_YELLOWKNIFE_SPEC "" | |
1377 | ||
1378 | /* Motorola MVME support. */ | |
1379 | #define LIB_MVME_SPEC "--start-group -lmvme -lc --end-group" | |
1380 | ||
1381 | #define STARTFILE_MVME_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s" | |
1382 | ||
1383 | #define ENDFILE_MVME_SPEC "crtend.o%s ecrtn.o%s" | |
1384 | ||
1385 | #define LINK_START_MVME_SPEC "-Ttext 0x40000" | |
1386 | ||
1387 | #define LINK_OS_MVME_SPEC "" | |
1388 | ||
1389 | #define CPP_OS_MVME_SPEC "" | |
1390 | ||
1391 | /* PowerPC simulator based on netbsd system calls support. */ | |
1392 | #define LIB_SIM_SPEC "--start-group -lsim -lc --end-group" | |
1393 | ||
1394 | #define STARTFILE_SIM_SPEC "ecrti.o%s sim-crt0.o%s crtbegin.o%s" | |
1395 | ||
1396 | #define ENDFILE_SIM_SPEC "crtend.o%s ecrtn.o%s" | |
1397 | ||
1398 | #define LINK_START_SIM_SPEC "" | |
1399 | ||
1400 | #define LINK_OS_SIM_SPEC "-m elf32ppcsim" | |
1401 | ||
1402 | #define CPP_OS_SIM_SPEC "" | |
1403 | ||
1404 | /* GNU/Linux support. */ | |
1405 | #ifdef USE_GNULIBC_1 | |
1406 | #define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \ | |
1407 | %{!mnewlib: -lc }" | |
1408 | #else | |
1409 | #define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \ | |
1410 | %{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } \ | |
1411 | %{profile:-lc_p} %{!profile:-lc}}}" | |
1412 | #endif | |
1413 | ||
1414 | #define STARTFILE_LINUX_SPEC "\ | |
1415 | %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \ | |
1416 | %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \ | |
1417 | %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" | |
1418 | ||
1419 | #define ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \ | |
1420 | %{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}" | |
1421 | ||
1422 | #define LINK_START_LINUX_SPEC "" | |
1423 | ||
1424 | #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \ | |
1425 | %{rdynamic:-export-dynamic} \ | |
1426 | %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}" | |
1427 | ||
1428 | #ifdef USE_GNULIBC_1 | |
1429 | #define CPP_OS_LINUX_SPEC "-D__unix__ -D__linux__ \ | |
1430 | %{!undef: \ | |
1431 | %{!ansi: \ | |
1432 | %{!std=*:-Dunix -D__unix -Dlinux -D__linux} \ | |
1433 | %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}} \ | |
1434 | -Asystem=unix -Asystem=posix" | |
1435 | #else | |
1436 | #define CPP_OS_LINUX_SPEC "-D__unix__ -D__linux__ \ | |
1437 | %{!undef: \ | |
1438 | %{!ansi: \ | |
1439 | %{!std=*:-Dunix -D__unix -Dlinux -D__linux} \ | |
1440 | %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}} \ | |
1441 | -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}" | |
1442 | #endif | |
1443 | ||
1444 | /* NetBSD support. */ | |
1445 | #define LIB_NETBSD_SPEC "\ | |
1446 | %{profile:-lgmon -lc_p} %{!profile:-lc}" | |
1447 | ||
1448 | #define STARTFILE_NETBSD_SPEC "\ | |
1449 | ncrti.o%s crt0.o%s \ | |
1450 | %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" | |
1451 | ||
1452 | #define ENDFILE_NETBSD_SPEC "\ | |
1453 | %{!shared:crtend.o%s} %{shared:crtendS.o%s} \ | |
1454 | ncrtn.o%s" | |
1455 | ||
1456 | #define LINK_START_NETBSD_SPEC "\ | |
1457 | " | |
1458 | ||
1459 | #define LINK_OS_NETBSD_SPEC "\ | |
1460 | %{!shared: %{!static: \ | |
1461 | %{rdynamic:-export-dynamic} \ | |
1462 | %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}}}" | |
1463 | ||
1464 | #define CPP_OS_NETBSD_SPEC "\ | |
1465 | -D__powerpc__ -D__NetBSD__ -D__ELF__ -D__KPRINTF_ATTRIBUTE__" | |
1466 | ||
1467 | /* Solaris support. */ | |
1468 | /* For Solaris, Gcc automatically adds in one of the files | |
1469 | /usr/ccs/lib/values-Xc.o, /usr/ccs/lib/values-Xa.o, or | |
1470 | /usr/ccs/lib/values-Xt.o for each final link step (depending upon the other | |
1471 | gcc options selected, such as -traditional and -ansi). These files each | |
1472 | contain one (initialized) copy of a special variable called `_lib_version'. | |
1473 | Each one of these files has `_lib_version' initialized to a different (enum) | |
1474 | value. The SVR4 library routines query the value of `_lib_version' at run | |
1475 | to decide how they should behave. Specifically, they decide (based upon the | |
1476 | value of `_lib_version') if they will act in a strictly ANSI conforming | |
1477 | manner or not. */ | |
1478 | ||
1479 | #define LIB_SOLARIS_SPEC "\ | |
1480 | %{mnewlib: --start-group -lsolaris -lc --end-group } \ | |
1481 | %{!mnewlib: \ | |
1482 | %{ansi:values-Xc.o%s} \ | |
1483 | %{!ansi: \ | |
1484 | %{traditional:values-Xt.o%s} \ | |
1485 | %{!traditional:values-Xa.o%s}} \ | |
1486 | %{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} \ | |
1487 | %{solaris-cclib: /opt/SUNWspro/SC4.0/lib/libabi.a} \ | |
1488 | %{!shared: %{!symbolic: -lc }}}" | |
1489 | ||
1490 | #define STARTFILE_SOLARIS_SPEC "\ | |
1491 | %{!msolaris-cclib: scrti.o%s scrt0.o%s} \ | |
1492 | %{msolaris-cclib: /opt/SUNWspro/SC4.0/lib/crti.o%s /opt/SUNWspro/SC4.0/lib/crt1.o%s} \ | |
1493 | %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" | |
1494 | ||
1495 | #define ENDFILE_SOLARIS_SPEC "\ | |
1496 | %{!shared:crtend.o%s} %{shared:crtendS.o%s} \ | |
1497 | %{!msolaris-cclib: scrtn.o%s} \ | |
1498 | %{msolaris-cclib: /opt/SUNWspro/SC4.0/lib/crtn.o%s}" | |
1499 | ||
1500 | #define LINK_START_SOLARIS_SPEC "" | |
1501 | ||
1502 | #define LINK_OS_SOLARIS_SPEC "" | |
1503 | ||
1504 | #define CPP_OS_SOLARIS_SPEC "-D__ppc -D__sun__=1 -D__unix__ -D__svr4__ -D__SVR4__ \ | |
1505 | %{!undef:%{!ansi:%{!std=*:-Dsun=1 -Dunix -DSVR4 -D__EXTENSIONS__} \ | |
1506 | %{std=gnu*:-Dsun=1 -Dunix -DSVR4 -D__EXTENSIONS__}}} \ | |
1507 | -Amachine=prep" | |
1508 | ||
1509 | /* VxWorks support. */ | |
1510 | /* VxWorks does all the library stuff itself. */ | |
1511 | #define LIB_VXWORKS_SPEC "" | |
1512 | ||
1513 | /* VxWorks provides the functionality of crt0.o and friends itself. */ | |
1514 | ||
1515 | #define STARTFILE_VXWORKS_SPEC "" | |
1516 | ||
1517 | #define ENDFILE_VXWORKS_SPEC "" | |
1518 | ||
1519 | /* Because it uses ld -r, vxworks has no start/end files, nor starting | |
1520 | address. */ | |
1521 | ||
1522 | #define LINK_START_VXWORKS_SPEC "" | |
1523 | ||
1524 | #define LINK_OS_VXWORKS_SPEC "-r" | |
1525 | ||
1526 | #define CPP_OS_VXWORKS_SPEC "\ | |
1527 | -DCPU_FAMILY=PPC \ | |
1528 | %{!mcpu*: \ | |
1529 | %{mpowerpc*: -DCPU=PPC603} \ | |
1530 | %{!mno-powerpc: -DCPU=PPC603}} \ | |
1531 | %{mcpu=powerpc: -DCPU=PPC603} \ | |
1532 | %{mcpu=401: -DCPU=PPC403} \ | |
1533 | %{mcpu=403: -DCPU=PPC403} \ | |
1534 | %{mcpu=601: -DCPU=PPC601} \ | |
1535 | %{mcpu=602: -DCPU=PPC603} \ | |
1536 | %{mcpu=603: -DCPU=PPC603} \ | |
1537 | %{mcpu=603e: -DCPU=PPC603} \ | |
1538 | %{mcpu=ec603e: -DCPU=PPC603} \ | |
1539 | %{mcpu=604: -DCPU=PPC604} \ | |
1540 | %{mcpu=604e: -DCPU=PPC604} \ | |
1541 | %{mcpu=620: -DCPU=PPC604} \ | |
1542 | %{mcpu=740: -DCPU=PPC603} \ | |
1543 | %{mcpu=750: -DCPU=PPC603} \ | |
1544 | %{mcpu=801: -DCPU=PPC603} \ | |
1545 | %{mcpu=821: -DCPU=PPC603} \ | |
1546 | %{mcpu=823: -DCPU=PPC603} \ | |
1547 | %{mcpu=860: -DCPU=PPC603}" | |
1548 | ||
1549 | /* Define any extra SPECS that the compiler needs to generate. */ | |
1550 | /* Override rs6000.h definition. */ | |
1551 | #undef SUBTARGET_EXTRA_SPECS | |
1552 | #define SUBTARGET_EXTRA_SPECS \ | |
1553 | { "cpp_sysv", CPP_SYSV_SPEC }, \ | |
1554 | { "cpp_sysv_default", CPP_SYSV_DEFAULT_SPEC }, \ | |
1555 | { "cpp_endian_default", CPP_ENDIAN_DEFAULT_SPEC }, \ | |
1556 | { "cpp_endian", CPP_ENDIAN_SPEC }, \ | |
1557 | { "lib_ads", LIB_ADS_SPEC }, \ | |
1558 | { "lib_yellowknife", LIB_YELLOWKNIFE_SPEC }, \ | |
1559 | { "lib_mvme", LIB_MVME_SPEC }, \ | |
1560 | { "lib_sim", LIB_SIM_SPEC }, \ | |
1561 | { "lib_linux", LIB_LINUX_SPEC }, \ | |
1562 | { "lib_netbsd", LIB_NETBSD_SPEC }, \ | |
1563 | { "lib_solaris", LIB_SOLARIS_SPEC }, \ | |
1564 | { "lib_vxworks", LIB_VXWORKS_SPEC }, \ | |
1565 | { "lib_default", LIB_DEFAULT_SPEC }, \ | |
1566 | { "startfile_ads", STARTFILE_ADS_SPEC }, \ | |
1567 | { "startfile_yellowknife", STARTFILE_YELLOWKNIFE_SPEC }, \ | |
1568 | { "startfile_mvme", STARTFILE_MVME_SPEC }, \ | |
1569 | { "startfile_sim", STARTFILE_SIM_SPEC }, \ | |
1570 | { "startfile_linux", STARTFILE_LINUX_SPEC }, \ | |
1571 | { "startfile_netbsd", STARTFILE_NETBSD_SPEC }, \ | |
1572 | { "startfile_solaris", STARTFILE_SOLARIS_SPEC }, \ | |
1573 | { "startfile_vxworks", STARTFILE_VXWORKS_SPEC }, \ | |
1574 | { "startfile_default", STARTFILE_DEFAULT_SPEC }, \ | |
1575 | { "endfile_ads", ENDFILE_ADS_SPEC }, \ | |
1576 | { "endfile_yellowknife", ENDFILE_YELLOWKNIFE_SPEC }, \ | |
1577 | { "endfile_mvme", ENDFILE_MVME_SPEC }, \ | |
1578 | { "endfile_sim", ENDFILE_SIM_SPEC }, \ | |
1579 | { "endfile_linux", ENDFILE_LINUX_SPEC }, \ | |
1580 | { "endfile_netbsd", ENDFILE_NETBSD_SPEC }, \ | |
1581 | { "endfile_solaris", ENDFILE_SOLARIS_SPEC }, \ | |
1582 | { "endfile_vxworks", ENDFILE_VXWORKS_SPEC }, \ | |
1583 | { "endfile_default", ENDFILE_DEFAULT_SPEC }, \ | |
1584 | { "link_path", LINK_PATH_SPEC }, \ | |
1585 | { "link_shlib", LINK_SHLIB_SPEC }, \ | |
1586 | { "link_target", LINK_TARGET_SPEC }, \ | |
1587 | { "link_start", LINK_START_SPEC }, \ | |
1588 | { "link_start_ads", LINK_START_ADS_SPEC }, \ | |
1589 | { "link_start_yellowknife", LINK_START_YELLOWKNIFE_SPEC }, \ | |
1590 | { "link_start_mvme", LINK_START_MVME_SPEC }, \ | |
1591 | { "link_start_sim", LINK_START_SIM_SPEC }, \ | |
1592 | { "link_start_linux", LINK_START_LINUX_SPEC }, \ | |
1593 | { "link_start_netbsd", LINK_START_NETBSD_SPEC }, \ | |
1594 | { "link_start_solaris", LINK_START_SOLARIS_SPEC }, \ | |
1595 | { "link_start_vxworks", LINK_START_VXWORKS_SPEC }, \ | |
1596 | { "link_start_default", LINK_START_DEFAULT_SPEC }, \ | |
1597 | { "link_os", LINK_OS_SPEC }, \ | |
1598 | { "link_os_ads", LINK_OS_ADS_SPEC }, \ | |
1599 | { "link_os_yellowknife", LINK_OS_YELLOWKNIFE_SPEC }, \ | |
1600 | { "link_os_mvme", LINK_OS_MVME_SPEC }, \ | |
1601 | { "link_os_sim", LINK_OS_SIM_SPEC }, \ | |
1602 | { "link_os_linux", LINK_OS_LINUX_SPEC }, \ | |
1603 | { "link_os_netbsd", LINK_OS_NETBSD_SPEC }, \ | |
1604 | { "link_os_solaris", LINK_OS_SOLARIS_SPEC }, \ | |
1605 | { "link_os_vxworks", LINK_OS_VXWORKS_SPEC }, \ | |
1606 | { "link_os_default", LINK_OS_DEFAULT_SPEC }, \ | |
1607 | { "cc1_endian_big", CC1_ENDIAN_BIG_SPEC }, \ | |
1608 | { "cc1_endian_little", CC1_ENDIAN_LITTLE_SPEC }, \ | |
1609 | { "cc1_endian_default", CC1_ENDIAN_DEFAULT_SPEC }, \ | |
1610 | { "cpp_endian_big", CPP_ENDIAN_BIG_SPEC }, \ | |
1611 | { "cpp_endian_little", CPP_ENDIAN_LITTLE_SPEC }, \ | |
1612 | { "cpp_endian_solaris", CPP_ENDIAN_SOLARIS_SPEC }, \ | |
1613 | { "cpp_float_default", CPP_FLOAT_DEFAULT_SPEC }, \ | |
1614 | { "cpp_longdouble_default", CPP_LONGDOUBLE_DEFAULT_SPEC }, \ | |
1615 | { "cpp_os_ads", CPP_OS_ADS_SPEC }, \ | |
1616 | { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \ | |
1617 | { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \ | |
1618 | { "cpp_os_sim", CPP_OS_SIM_SPEC }, \ | |
1619 | { "cpp_os_linux", CPP_OS_LINUX_SPEC }, \ | |
1620 | { "cpp_os_netbsd", CPP_OS_NETBSD_SPEC }, \ | |
1621 | { "cpp_os_solaris", CPP_OS_SOLARIS_SPEC }, \ | |
1622 | { "cpp_os_vxworks", CPP_OS_VXWORKS_SPEC }, \ | |
1623 | { "cpp_os_default", CPP_OS_DEFAULT_SPEC }, | |
1624 | ||
1625 | /* Define this macro as a C expression for the initializer of an | |
1626 | array of string to tell the driver program which options are | |
1627 | defaults for this target and thus do not need to be handled | |
1628 | specially when using `MULTILIB_OPTIONS'. | |
1629 | ||
1630 | Do not define this macro if `MULTILIB_OPTIONS' is not defined in | |
1631 | the target makefile fragment or if none of the options listed in | |
1632 | `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */ | |
1633 | ||
1634 | #define MULTILIB_DEFAULTS { "mbig", "mcall-sysv" } | |
1635 | ||
1636 | /* Define this macro if the code for function profiling should come | |
1637 | before the function prologue. Normally, the profiling code comes | |
1638 | after. */ | |
1639 | #define PROFILE_BEFORE_PROLOGUE 1 | |
1640 | ||
1641 | /* Function name to call to do profiling. */ | |
1642 | #define RS6000_MCOUNT "_mcount" | |
1643 | ||
1644 | /* Define this macro (to a value of 1) if you want to support the | |
1645 | Win32 style pragmas #pragma pack(push,<n>)' and #pragma | |
1646 | pack(pop)'. The pack(push,<n>) pragma specifies the maximum | |
1647 | alignment (in bytes) of fields within a structure, in much the | |
1648 | same way as the __aligned__' and __packed__' __attribute__'s | |
1649 | do. A pack value of zero resets the behaviour to the default. | |
1650 | Successive invocations of this pragma cause the previous values to | |
1651 | be stacked, so that invocations of #pragma pack(pop)' will return | |
1652 | to the previous value. */ | |
1653 | ||
1654 | #define HANDLE_PRAGMA_PACK_PUSH_POP 1 | |
1655 | ||
1656 | /* Define library calls for quad FP operations. These are all part of the | |
1657 | PowerPC 32bit ABI. */ | |
1658 | #define ADDTF3_LIBCALL "_q_add" | |
1659 | #define DIVTF3_LIBCALL "_q_div" | |
1660 | #define EXTENDDFTF2_LIBCALL "_q_dtoq" | |
1661 | #define EQTF2_LIBCALL "_q_feq" | |
1662 | #define GETF2_LIBCALL "_q_fge" | |
1663 | #define GTTF2_LIBCALL "_q_fgt" | |
1664 | #define LETF2_LIBCALL "_q_fle" | |
1665 | #define LTTF2_LIBCALL "_q_flt" | |
1666 | #define NETF2_LIBCALL "_q_fne" | |
1667 | #define FLOATSITF2_LIBCALL "_q_itoq" | |
1668 | #define MULTF3_LIBCALL "_q_mul" | |
1669 | #define NEGTF2_LIBCALL "_q_neg" | |
1670 | #define TRUNCTFDF2_LIBCALL "_q_qtod" | |
1671 | #define FIX_TRUNCTFSI2_LIBCALL "_q_qtoi" | |
1672 | #define TRUNCTFSF2_LIBCALL "_q_qtos" | |
1673 | #define FIXUNS_TRUNCTFSI2_LIBCALL "_q_qtou" | |
1674 | #define SQRTTF_LIBCALL "_q_sqrt" | |
1675 | #define EXTENDSFTF2_LIBCALL "_q_stoq" | |
1676 | #define SUBTF3_LIBCALL "_q_sub" | |
1677 | #define FLOATUNSSITF2_LIBCALL "_q_utoq" | |
1678 | ||
1679 | #define INIT_TARGET_OPTABS \ | |
1680 | do { \ | |
1681 | if (TARGET_HARD_FLOAT) \ | |
1682 | { \ | |
1683 | add_optab->handlers[(int) TFmode].libfunc \ | |
1684 | = init_one_libfunc (ADDTF3_LIBCALL); \ | |
1685 | sub_optab->handlers[(int) TFmode].libfunc \ | |
1686 | = init_one_libfunc (SUBTF3_LIBCALL); \ | |
1687 | neg_optab->handlers[(int) TFmode].libfunc \ | |
1688 | = init_one_libfunc (NEGTF2_LIBCALL); \ | |
1689 | smul_optab->handlers[(int) TFmode].libfunc \ | |
1690 | = init_one_libfunc (MULTF3_LIBCALL); \ | |
1691 | flodiv_optab->handlers[(int) TFmode].libfunc \ | |
1692 | = init_one_libfunc (DIVTF3_LIBCALL); \ | |
1693 | eqtf2_libfunc = init_one_libfunc (EQTF2_LIBCALL); \ | |
1694 | netf2_libfunc = init_one_libfunc (NETF2_LIBCALL); \ | |
1695 | gttf2_libfunc = init_one_libfunc (GTTF2_LIBCALL); \ | |
1696 | getf2_libfunc = init_one_libfunc (GETF2_LIBCALL); \ | |
1697 | lttf2_libfunc = init_one_libfunc (LTTF2_LIBCALL); \ | |
1698 | letf2_libfunc = init_one_libfunc (LETF2_LIBCALL); \ | |
1699 | trunctfsf2_libfunc = init_one_libfunc (TRUNCTFSF2_LIBCALL); \ | |
1700 | trunctfdf2_libfunc = init_one_libfunc (TRUNCTFDF2_LIBCALL); \ | |
1701 | extendsftf2_libfunc = init_one_libfunc (EXTENDSFTF2_LIBCALL); \ | |
1702 | extenddftf2_libfunc = init_one_libfunc (EXTENDDFTF2_LIBCALL); \ | |
1703 | floatsitf_libfunc = init_one_libfunc (FLOATSITF2_LIBCALL); \ | |
1704 | fixtfsi_libfunc = init_one_libfunc (FIX_TRUNCTFSI2_LIBCALL); \ | |
1705 | fixunstfsi_libfunc \ | |
1706 | = init_one_libfunc (FIXUNS_TRUNCTFSI2_LIBCALL); \ | |
1707 | if (TARGET_PPC_GPOPT || TARGET_POWER2) \ | |
1708 | sqrt_optab->handlers[(int) TFmode].libfunc \ | |
1709 | = init_one_libfunc (SQRTTF_LIBCALL); \ | |
1710 | } \ | |
1711 | } while (0) | |
1712 | ||
1713 | /* Select a format to encode pointers in exception handling data. CODE | |
1714 | is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is | |
1715 | true if the symbol may be affected by dynamic relocations. */ | |
1716 | #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \ | |
1717 | ((flag_pic || TARGET_RELOCATABLE) \ | |
1718 | ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \ | |
1719 | : DW_EH_PE_absptr) | |
1720 | ||
1721 | #define EXCEPTION_SECTION readonly_data_section | |
1722 | #define DOUBLE_INT_ASM_OP ".quad" |