]>
Commit | Line | Data |
---|---|---|
e3f1f242 | 1 | /* Target definitions for GNU compiler for PowerPC running System V.4 |
e556ad19 FS |
2 | Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001 |
3 | Free Software Foundation, Inc. | |
e3f1f242 MM |
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 | |
c15c9075 RK |
20 | the Free Software Foundation, 59 Temple Place - Suite 330, |
21 | Boston, MA 02111-1307, USA. */ | |
e3f1f242 | 22 | |
9ebbca7d GK |
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" | |
2bfcf297 DB |
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}" | |
9ebbca7d GK |
113 | |
114 | /* Small data support types. */ | |
d9407988 | 115 | enum rs6000_sdata_type { |
9ebbca7d GK |
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. */ | |
d9407988 | 120 | }; |
d14a6d05 | 121 | |
d9407988 MM |
122 | extern enum rs6000_sdata_type rs6000_sdata; |
123 | ||
9ebbca7d GK |
124 | /* V.4/eabi switches. */ |
125 | #define MASK_NO_BITFIELD_TYPE 0x40000000 /* Set PCC_BITFIELD_TYPE_MATTERS to 0. */ | |
d14a6d05 | 126 | #define MASK_STRICT_ALIGN 0x20000000 /* Set STRICT_ALIGNMENT to 1. */ |
9ebbca7d GK |
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. */ | |
e0f7170a | 132 | #define MASK_LONG_DOUBLE_128 0x00800000 /* Use IEEE quad long double. */ |
9a155f91 | 133 | #define MASK_NO_BITFIELD_WORD 0x00400000 /* Bitfields cannot cross word boundaries */ |
d14a6d05 MM |
134 | |
135 | #define TARGET_NO_BITFIELD_TYPE (target_flags & MASK_NO_BITFIELD_TYPE) | |
9ebbca7d GK |
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) | |
4697a36c | 141 | #define TARGET_PROTOTYPE (target_flags & MASK_PROTOTYPE) |
e0f7170a | 142 | #define TARGET_LONG_DOUBLE_128 (target_flags & MASK_LONG_DOUBLE_128) |
9a155f91 | 143 | #define TARGET_NO_BITFIELD_WORD (target_flags & MASK_NO_BITFIELD_WORD) |
64d732de MM |
144 | #define TARGET_TOC ((target_flags & MASK_64BIT) \ |
145 | || ((target_flags & (MASK_RELOCATABLE \ | |
146 | | MASK_MINIMAL_TOC)) \ | |
147 | && flag_pic > 1) \ | |
9ebbca7d | 148 | || DEFAULT_ABI == ABI_AIX) |
7e69e155 MM |
149 | |
150 | #define TARGET_BITFIELD_TYPE (! TARGET_NO_BITFIELD_TYPE) | |
9ebbca7d | 151 | #define TARGET_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN) |
4697a36c MM |
152 | #define TARGET_NO_PROTOTYPE (! TARGET_PROTOTYPE) |
153 | #define TARGET_NO_TOC (! TARGET_TOC) | |
9ebbca7d | 154 | #define TARGET_NO_EABI (! TARGET_EABI) |
c81bebd7 | 155 | |
d9407988 | 156 | /* Strings provided by SUBTARGET_OPTIONS */ |
815cdc52 MM |
157 | extern const char *rs6000_abi_name; |
158 | extern const char *rs6000_sdata_name; | |
d9407988 | 159 | |
9ebbca7d GK |
160 | /* Override rs6000.h definition. */ |
161 | #undef SUBTARGET_OPTIONS | |
162 | #define SUBTARGET_OPTIONS \ | |
047142d3 PT |
163 | { "call-", &rs6000_abi_name, N_("Select ABI calling convention.") }, \ |
164 | { "sdata=", &rs6000_sdata_name, N_("Select method for sdata handling.") } | |
3933e0e1 | 165 | |
88228c4b MM |
166 | /* Max # of bytes for variables to automatically be put into the .sdata |
167 | or .sdata2 sections. */ | |
9ebbca7d GK |
168 | extern int g_switch_value; /* Value of the -G xx switch. */ |
169 | extern int g_switch_set; /* Whether -G xx was passed. */ | |
88228c4b | 170 | |
88228c4b | 171 | #define SDATA_DEFAULT_SIZE 8 |
9ebbca7d GK |
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 \ | |
047142d3 PT |
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.") }, \ | |
e0f7170a GK |
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") }, \ | |
047142d3 PT |
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.") }, \ | |
9a155f91 GK |
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") }, \ | |
047142d3 PT |
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") }, | |
9ebbca7d GK |
238 | |
239 | /* This is meant to be redefined in the host dependent files. */ | |
240 | #define EXTRA_SUBTARGET_SWITCHES | |
88228c4b | 241 | |
3933e0e1 MM |
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 { \ | |
88228c4b MM |
253 | if (!g_switch_set) \ |
254 | g_switch_value = SDATA_DEFAULT_SIZE; \ | |
255 | \ | |
c81bebd7 MM |
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")) \ | |
670866a5 MM |
270 | { \ |
271 | rs6000_current_abi = ABI_AIX_NODESC; \ | |
272 | target_flags |= MASK_EABI; \ | |
273 | } \ | |
c81bebd7 MM |
274 | else if (!strcmp (rs6000_abi_name, "aixdesc")) \ |
275 | rs6000_current_abi = ABI_AIX; \ | |
c81bebd7 MM |
276 | else if (!strcmp (rs6000_abi_name, "linux")) \ |
277 | rs6000_current_abi = ABI_V4; \ | |
edf1b3f3 AC |
278 | else if (!strcmp (rs6000_abi_name, "netbsd")) \ |
279 | rs6000_current_abi = ABI_V4; \ | |
c81bebd7 MM |
280 | else if (!strcmp (rs6000_abi_name, "solaris")) \ |
281 | rs6000_current_abi = ABI_SOLARIS; \ | |
c36ae96c GK |
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 | } \ | |
c81bebd7 MM |
289 | else \ |
290 | { \ | |
291 | rs6000_current_abi = ABI_V4; \ | |
292 | error ("Bad value for -mcall-%s", rs6000_abi_name); \ | |
293 | } \ | |
7509c759 | 294 | \ |
d9407988 MM |
295 | if (rs6000_sdata_name) \ |
296 | { \ | |
d9407988 | 297 | if (!strcmp (rs6000_sdata_name, "none")) \ |
38c1f2d7 | 298 | rs6000_sdata = SDATA_NONE; \ |
d9407988 MM |
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 | } \ | |
5b9d9a0c | 310 | else if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS) \ |
d9407988 MM |
311 | { \ |
312 | rs6000_sdata = SDATA_DATA; \ | |
84f414bc | 313 | rs6000_sdata_name = "data"; \ |
d9407988 MM |
314 | } \ |
315 | else \ | |
84f414bc MM |
316 | { \ |
317 | rs6000_sdata = SDATA_NONE; \ | |
318 | rs6000_sdata_name = "none"; \ | |
319 | } \ | |
9a57586f | 320 | \ |
d9407988 MM |
321 | if (TARGET_RELOCATABLE && \ |
322 | (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV)) \ | |
7509c759 | 323 | { \ |
5b9d9a0c | 324 | rs6000_sdata = SDATA_DATA; \ |
84f414bc MM |
325 | error ("-mrelocatable and -msdata=%s are incompatible.", \ |
326 | rs6000_sdata_name); \ | |
7509c759 MM |
327 | } \ |
328 | \ | |
84f414bc MM |
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 | \ | |
38c1f2d7 MM |
338 | if (rs6000_sdata != SDATA_NONE && DEFAULT_ABI != ABI_V4 \ |
339 | && DEFAULT_ABI != ABI_SOLARIS) \ | |
7509c759 | 340 | { \ |
38c1f2d7 MM |
341 | rs6000_sdata = SDATA_NONE; \ |
342 | error ("-msdata=%s and -mcall-%s are incompatible.", \ | |
343 | rs6000_sdata_name, rs6000_abi_name); \ | |
7509c759 MM |
344 | } \ |
345 | \ | |
3933e0e1 MM |
346 | if (TARGET_RELOCATABLE && !TARGET_MINIMAL_TOC) \ |
347 | { \ | |
348 | target_flags |= MASK_MINIMAL_TOC; \ | |
349 | error ("-mrelocatable and -mno-minimal-toc are incompatible."); \ | |
3933e0e1 | 350 | } \ |
b6c9286a | 351 | \ |
9ebbca7d | 352 | if (TARGET_RELOCATABLE && rs6000_current_abi == ABI_AIX) \ |
b6c9286a MM |
353 | { \ |
354 | target_flags &= ~MASK_RELOCATABLE; \ | |
c81bebd7 MM |
355 | error ("-mrelocatable and -mcall-%s are incompatible.", \ |
356 | rs6000_abi_name); \ | |
b6c9286a MM |
357 | } \ |
358 | \ | |
9ebbca7d | 359 | if (flag_pic > 1 && rs6000_current_abi == ABI_AIX) \ |
3201f6d9 MM |
360 | { \ |
361 | flag_pic = 0; \ | |
362 | error ("-fPIC and -mcall-%s are incompatible.", \ | |
363 | rs6000_abi_name); \ | |
364 | } \ | |
365 | \ | |
c81bebd7 | 366 | if (rs6000_current_abi == ABI_AIX && TARGET_LITTLE_ENDIAN) \ |
b6c9286a MM |
367 | { \ |
368 | target_flags &= ~MASK_LITTLE_ENDIAN; \ | |
369 | error ("-mcall-aixdesc must be big endian"); \ | |
370 | } \ | |
371 | \ | |
9ebbca7d | 372 | /* Treat -fPIC the same as -mrelocatable. */ \ |
84f414bc | 373 | if (flag_pic > 1) \ |
3201f6d9 | 374 | target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC; \ |
84f414bc MM |
375 | \ |
376 | else if (TARGET_RELOCATABLE) \ | |
377 | flag_pic = 2; \ | |
378 | \ | |
3933e0e1 | 379 | } while (0) |
75814ad4 | 380 | |
a260abc9 | 381 | |
9ebbca7d GK |
382 | /* Override rs6000.h definition. */ |
383 | #undef TARGET_DEFAULT | |
384 | #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS) | |
a260abc9 | 385 | |
9ebbca7d GK |
386 | /* Override rs6000.h definition. */ |
387 | #undef PROCESSOR_DEFAULT | |
388 | #define PROCESSOR_DEFAULT PROCESSOR_PPC750 | |
e3f1f242 | 389 | |
5d36722d RK |
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 | ||
5d36722d RK |
393 | #define FIXED_R13 1 |
394 | ||
9ebbca7d GK |
395 | /* Size of the V.4 varargs area if needed. */ |
396 | /* Override rs6000.h definition. */ | |
4697a36c | 397 | #undef RS6000_VARARGS_AREA |
00dba523 | 398 | #define RS6000_VARARGS_AREA ((cfun->machine->sysv_varargs_p) ? RS6000_VARARGS_SIZE : 0) |
4697a36c | 399 | |
9ebbca7d GK |
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) | |
75814ad4 | 405 | |
4d3f9f5b RK |
406 | /* Define this to set the endianness to use in libgcc2.c, which can |
407 | not depend on target_flags. */ | |
7d473b07 | 408 | #if !defined(_LITTLE_ENDIAN) && !defined(__sun__) |
4d3f9f5b RK |
409 | #define LIBGCC2_WORDS_BIG_ENDIAN 1 |
410 | #else | |
411 | #define LIBGCC2_WORDS_BIG_ENDIAN 0 | |
412 | #endif | |
413 | ||
4697a36c | 414 | /* Define cutoff for using external functions to save floating point. |
9ebbca7d | 415 | Currently on V.4, always use inline stores. */ |
4697a36c MM |
416 | #define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 64) |
417 | ||
e9a25f70 | 418 | /* Put jump tables in read-only memory, rather than in .text. */ |
75197b37 | 419 | #define JUMP_TABLES_IN_TEXT_SECTION 0 |
e9a25f70 | 420 | |
9ebbca7d | 421 | /* Prefix and suffix to use to saving floating point. */ |
e3f1f242 MM |
422 | #define SAVE_FP_PREFIX "_savefpr_" |
423 | #define SAVE_FP_SUFFIX "_l" | |
424 | ||
9ebbca7d | 425 | /* Prefix and suffix to use to restoring floating point. */ |
e3f1f242 MM |
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. */ | |
e3f1f242 MM |
430 | #define PTRDIFF_TYPE "int" |
431 | ||
432 | /* Type used for wchar_t, as a string used in a declaration. */ | |
9ebbca7d | 433 | /* Override svr4.h definition. */ |
e3f1f242 | 434 | #undef WCHAR_TYPE |
f9317f0d | 435 | #define WCHAR_TYPE "long int" |
e3f1f242 MM |
436 | |
437 | /* Width of wchar_t in bits. */ | |
9ebbca7d | 438 | /* Override svr4.h definition. */ |
e3f1f242 | 439 | #undef WCHAR_TYPE_SIZE |
f9317f0d | 440 | #define WCHAR_TYPE_SIZE 32 |
e3f1f242 | 441 | |
e0f7170a GK |
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 | ||
9ebbca7d GK |
458 | /* Make int foo : 8 not cause structures to be aligned to an int boundary. */ |
459 | /* Override elfos.h definition. */ | |
c81bebd7 MM |
460 | #undef PCC_BITFIELD_TYPE_MATTERS |
461 | #define PCC_BITFIELD_TYPE_MATTERS (TARGET_BITFIELD_TYPE) | |
462 | ||
9a155f91 GK |
463 | #undef BITFIELD_NBYTES_LIMITED |
464 | #define BITFIELD_NBYTES_LIMITED (TARGET_NO_BITFIELD_WORD) | |
465 | ||
c81bebd7 MM |
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 | |
bef84347 | 468 | will merely go slower in that case, define this macro as 0. */ |
c81bebd7 | 469 | #undef STRICT_ALIGNMENT |
bef84347 | 470 | #define STRICT_ALIGNMENT (TARGET_STRICT_ALIGN) |
c81bebd7 | 471 | |
61b2fbe7 MM |
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. */ | |
e3f1f242 | 475 | #undef STACK_BOUNDARY |
61b2fbe7 MM |
476 | #define STACK_BOUNDARY 64 |
477 | ||
9ebbca7d | 478 | /* Real stack boundary as mandated by the appropriate ABI. */ |
61b2fbe7 | 479 | #define ABI_STACK_BOUNDARY ((TARGET_EABI) ? 64 : 128) |
e3f1f242 MM |
480 | |
481 | /* No data type wants to be aligned rounder than this. */ | |
482 | #undef BIGGEST_ALIGNMENT | |
c81bebd7 MM |
483 | #define BIGGEST_ALIGNMENT ((TARGET_EABI) ? 64 : 128) |
484 | ||
f589b741 | 485 | #undef BIGGEST_FIELD_ALIGNMENT |
3e99621c DE |
486 | #undef ADJUST_FIELD_ALIGN |
487 | #undef ROUND_TYPE_ALIGN | |
e3f1f242 MM |
488 | |
489 | /* Use ELF style section commands. */ | |
490 | ||
9ebbca7d | 491 | #define TEXT_SECTION_ASM_OP "\t.section\t\".text\"" |
e3f1f242 | 492 | |
9ebbca7d | 493 | #define DATA_SECTION_ASM_OP "\t.section\t\".data\"" |
fff4998b | 494 | |
9ebbca7d | 495 | #define BSS_SECTION_ASM_OP "\t.section\t\".bss\"" |
e3f1f242 | 496 | |
9ebbca7d GK |
497 | /* Override elfos.h definition. */ |
498 | #undef INIT_SECTION_ASM_OP | |
499 | #define INIT_SECTION_ASM_OP "\t.section\t\".init\",\"ax\"" | |
c81bebd7 | 500 | |
9ebbca7d GK |
501 | /* Override elfos.h definition. */ |
502 | #undef FINI_SECTION_ASM_OP | |
503 | #define FINI_SECTION_ASM_OP "\t.section\t\".fini\",\"ax\"" | |
c81bebd7 | 504 | |
9ebbca7d | 505 | #define TOC_SECTION_ASM_OP "\t.section\t\".got\",\"aw\"" |
c81bebd7 | 506 | |
9ebbca7d GK |
507 | /* Put PC relative got entries in .got2. */ |
508 | #define MINIMAL_TOC_SECTION_ASM_OP \ | |
4f3397ae | 509 | ((TARGET_RELOCATABLE || flag_pic) ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"") |
c81bebd7 | 510 | |
9ebbca7d GK |
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 \ | |
ba1a5707 | 514 | ((DEFAULT_ABI == ABI_SOLARIS) ? "\t.section\t\".sbss\",\"aw\"" : "\t.section\t\".sbss\",\"aw\",@nobits") |
c81bebd7 MM |
515 | |
516 | ||
e3f1f242 | 517 | /* Besides the usual ELF sections, we need a toc section. */ |
9ebbca7d GK |
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 | |
e3f1f242 | 521 | |
9ebbca7d GK |
522 | /* Override elfos.h definition. */ |
523 | #undef EXTRA_SECTION_FUNCTIONS | |
524 | #define EXTRA_SECTION_FUNCTIONS \ | |
e3f1f242 MM |
525 | CONST_SECTION_FUNCTION \ |
526 | CTORS_SECTION_FUNCTION \ | |
527 | DTORS_SECTION_FUNCTION \ | |
7509c759 MM |
528 | TOC_SECTION_FUNCTION \ |
529 | SDATA_SECTION_FUNCTION \ | |
530 | SDATA2_SECTION_FUNCTION \ | |
c81bebd7 MM |
531 | SBSS_SECTION_FUNCTION \ |
532 | INIT_SECTION_FUNCTION \ | |
533 | FINI_SECTION_FUNCTION | |
7509c759 | 534 | |
9ebbca7d | 535 | #define TOC_SECTION_FUNCTION \ |
e3f1f242 MM |
536 | void \ |
537 | toc_section () \ | |
538 | { \ | |
d14a6d05 MM |
539 | if (in_section != in_toc) \ |
540 | { \ | |
4697a36c | 541 | in_section = in_toc; \ |
9ebbca7d | 542 | if (DEFAULT_ABI == ABI_AIX \ |
b6c9286a MM |
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 | } \ | |
9ebbca7d | 563 | else if (DEFAULT_ABI == ABI_AIX && !TARGET_RELOCATABLE) \ |
b6c9286a MM |
564 | fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \ |
565 | else \ | |
e3f1f242 | 566 | { \ |
b6c9286a MM |
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 | } \ | |
e3f1f242 | 574 | } \ |
e3f1f242 MM |
575 | } \ |
576 | } | |
577 | ||
9ebbca7d | 578 | #define SDATA_SECTION_FUNCTION \ |
7509c759 MM |
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 | ||
9ebbca7d | 589 | #define SDATA2_SECTION_FUNCTION \ |
7509c759 MM |
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 | ||
9ebbca7d | 600 | #define SBSS_SECTION_FUNCTION \ |
7509c759 MM |
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 | } \ | |
e3f1f242 MM |
609 | } |
610 | ||
9ebbca7d | 611 | #define INIT_SECTION_FUNCTION \ |
c81bebd7 MM |
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 | ||
9ebbca7d | 622 | #define FINI_SECTION_FUNCTION \ |
c81bebd7 MM |
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 | ||
7509c759 MM |
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 | ||
9ebbca7d GK |
642 | /* Override elfos.h definition. */ |
643 | #undef SELECT_RTX_SECTION | |
644 | #define SELECT_RTX_SECTION(MODE, X) rs6000_select_rtx_section (MODE, X) | |
7509c759 MM |
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 | ||
9ebbca7d GK |
651 | /* Override elfos.h definition. */ |
652 | #undef SELECT_SECTION | |
63019373 GK |
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) | |
7509c759 | 666 | |
b6c9286a MM |
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 | ||
956d6950 | 675 | Unlike AIX, we don't key off of -mminimal-toc, but instead do not |
b6c9286a MM |
676 | allow floating point constants in the TOC if -mrelocatable. */ |
677 | ||
678 | #undef ASM_OUTPUT_SPECIAL_POOL_ENTRY_P | |
a9098fd0 | 679 | #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) \ |
b6c9286a MM |
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 \ | |
a9098fd0 GK |
685 | || (GET_CODE (X) == CONST_INT \ |
686 | && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode)) \ | |
b6c9286a MM |
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 | ||
e3f1f242 MM |
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 | ||
874a0744 | 702 | extern int rs6000_pic_labelno; |
e3f1f242 | 703 | |
9ebbca7d | 704 | /* Override elfos.h definition. */ |
e3f1f242 MM |
705 | #undef ASM_DECLARE_FUNCTION_NAME |
706 | #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ | |
707 | do { \ | |
ec940faa | 708 | const char *init_ptr = (TARGET_64BIT) ? ".quad" : ".long"; \ |
b6c9286a | 709 | \ |
9ebbca7d GK |
710 | if (TARGET_RELOCATABLE && (get_pool_size () != 0 || profile_flag) \ |
711 | && uses_TOC()) \ | |
874a0744 | 712 | { \ |
ec940faa | 713 | char buf[256]; \ |
874a0744 MM |
714 | \ |
715 | ASM_OUTPUT_INTERNAL_LABEL (FILE, "LCL", rs6000_pic_labelno); \ | |
716 | \ | |
717 | ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1); \ | |
9ebbca7d GK |
718 | fprintf (FILE, "\t%s ", init_ptr); \ |
719 | assemble_name (FILE, buf); \ | |
720 | putc ('-', FILE); \ | |
874a0744 | 721 | ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); \ |
9ebbca7d GK |
722 | assemble_name (FILE, buf); \ |
723 | putc ('\n', FILE); \ | |
874a0744 MM |
724 | } \ |
725 | \ | |
b9f7d63e | 726 | fprintf (FILE, "%s", TYPE_ASM_OP); \ |
9ebbca7d GK |
727 | assemble_name (FILE, NAME); \ |
728 | putc (',', FILE); \ | |
e3f1f242 MM |
729 | fprintf (FILE, TYPE_OPERAND_FMT, "function"); \ |
730 | putc ('\n', FILE); \ | |
e3f1f242 | 731 | ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \ |
b6c9286a | 732 | \ |
9ebbca7d | 733 | if (DEFAULT_ABI == ABI_AIX) \ |
b6c9286a | 734 | { \ |
9ebbca7d | 735 | const char *desc_name, *orig_name; \ |
b6c9286a | 736 | \ |
9ebbca7d GK |
737 | STRIP_NAME_ENCODING (orig_name, NAME); \ |
738 | desc_name = orig_name; \ | |
b6c9286a MM |
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 | } \ | |
9ebbca7d | 753 | ASM_OUTPUT_LABEL (FILE, NAME); \ |
e3f1f242 MM |
754 | } while (0) |
755 | ||
9ebbca7d GK |
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 | ||
2bfcf297 DB |
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 | |
9ebbca7d GK |
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 | ||
e3f1f242 MM |
789 | /* How to renumber registers for dbx and gdb. */ |
790 | ||
9ebbca7d GK |
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 "" | |
e3f1f242 MM |
798 | |
799 | /* svr4.h overrides ASM_OUTPUT_INTERNAL_LABEL. */ | |
800 | ||
9ebbca7d GK |
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) | |
e3f1f242 | 813 | |
c81bebd7 MM |
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 | ||
9ebbca7d | 818 | /* Override elfos.h definition. */ |
c81bebd7 | 819 | #undef SKIP_ASM_OP |
76bbee81 | 820 | #define SKIP_ASM_OP "\t.space\t" |
c81bebd7 | 821 | |
5f01fc14 MM |
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 | ||
76bbee81 | 827 | #define LOCAL_ASM_OP "\t.local\t" |
5f01fc14 | 828 | |
76bbee81 | 829 | #define LCOMM_ASM_OP "\t.lcomm\t" |
e47ae1c2 | 830 | |
9ebbca7d GK |
831 | /* Override elfos.h definition. */ |
832 | #undef ASM_OUTPUT_ALIGNED_LOCAL | |
833 | #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ | |
5f01fc14 | 834 | do { \ |
38c1f2d7 MM |
835 | if (rs6000_sdata != SDATA_NONE && (SIZE) > 0 \ |
836 | && (SIZE) <= g_switch_value) \ | |
e47ae1c2 | 837 | { \ |
a9aefc1e | 838 | sbss_section (); \ |
e47ae1c2 MM |
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 | { \ | |
b9f7d63e | 844 | fprintf (FILE, "%s", SIZE_ASM_OP); \ |
e47ae1c2 MM |
845 | assemble_name (FILE, NAME); \ |
846 | fprintf (FILE, ",%d\n", SIZE); \ | |
847 | } \ | |
848 | } \ | |
5f01fc14 | 849 | else \ |
e47ae1c2 | 850 | { \ |
b9f7d63e | 851 | fprintf (FILE, "%s", LCOMM_ASM_OP); \ |
e47ae1c2 MM |
852 | assemble_name ((FILE), (NAME)); \ |
853 | fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \ | |
854 | } \ | |
fff4998b MM |
855 | } while (0) |
856 | ||
9ebbca7d GK |
857 | /* Describe how to emit uninitialized external linkage items. */ |
858 | #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ | |
fff4998b MM |
859 | do { \ |
860 | ASM_GLOBALIZE_LABEL (FILE, NAME); \ | |
861 | ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \ | |
5f01fc14 MM |
862 | } while (0) |
863 | ||
9ebbca7d | 864 | /* Switch Recognition by gcc.c. Add -G xx support. */ |
88228c4b | 865 | |
9ebbca7d GK |
866 | /* Override svr4.h definition. */ |
867 | #undef SWITCH_TAKES_ARG | |
868 | #define SWITCH_TAKES_ARG(CHAR) \ | |
88228c4b MM |
869 | ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o' \ |
870 | || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \ | |
3411a85a MM |
871 | || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x' \ |
872 | || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V' \ | |
873 | || (CHAR) == 'B' || (CHAR) == 'b' || (CHAR) == 'G') | |
88228c4b | 874 | |
5f30b0ff | 875 | /* Output .file. */ |
9ebbca7d GK |
876 | /* Override elfos.h definition. */ |
877 | #undef ASM_FILE_START | |
878 | #define ASM_FILE_START(FILE) \ | |
4d3f9f5b | 879 | do { \ |
4d3f9f5b | 880 | output_file_directive ((FILE), main_input_filename); \ |
3cfa4909 | 881 | rs6000_file_start (FILE, TARGET_CPU_DEFAULT); \ |
4d3f9f5b RK |
882 | } while (0) |
883 | ||
b6c9286a | 884 | |
9ebbca7d GK |
885 | extern int fixuplabelno; |
886 | ||
b6c9286a MM |
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. */ | |
9ebbca7d | 890 | /* Override rs6000.h definition. */ |
b6c9286a MM |
891 | #undef ASM_OUTPUT_INT |
892 | #define ASM_OUTPUT_INT(FILE,VALUE) \ | |
893 | do { \ | |
894 | static int recurse = 0; \ | |
9ebbca7d | 895 | if (TARGET_RELOCATABLE \ |
b6c9286a MM |
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 | { \ | |
ec940faa | 905 | char buf[256]; \ |
b6c9286a MM |
906 | \ |
907 | recurse = 1; \ | |
9ebbca7d GK |
908 | ASM_GENERATE_INTERNAL_LABEL (buf, "LCP", fixuplabelno); \ |
909 | fixuplabelno++; \ | |
910 | ASM_OUTPUT_LABEL (FILE, buf); \ | |
b6c9286a MM |
911 | fprintf (FILE, "\t.long ("); \ |
912 | output_addr_const (FILE, (VALUE)); \ | |
913 | fprintf (FILE, ")@fixup\n"); \ | |
9ebbca7d | 914 | fprintf (FILE, "\t.section\t\".fixup\",\"aw\"\n"); \ |
b6c9286a | 915 | ASM_OUTPUT_ALIGN (FILE, 2); \ |
9ebbca7d GK |
916 | fprintf (FILE, "\t.long\t"); \ |
917 | assemble_name (FILE, buf); \ | |
918 | fprintf (FILE, "\n\t.previous\n"); \ | |
b6c9286a MM |
919 | recurse = 0; \ |
920 | } \ | |
9ebbca7d | 921 | /* Remove initial .'s to turn a -mcall-aixdesc function \ |
b6c9286a MM |
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] == '.' \ | |
9ebbca7d | 926 | && DEFAULT_ABI == ABI_AIX) \ |
b6c9286a | 927 | { \ |
3cce094d | 928 | const char *name = XSTR (VALUE, 0); \ |
b6c9286a MM |
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 | ||
e3f1f242 MM |
942 | /* This is the end of what might become sysv4.h. */ |
943 | ||
c81bebd7 | 944 | /* Allow stabs and dwarf, for now, make stabs the default debugging type, |
9ebbca7d | 945 | not dwarf since G++ doesn't support dwarf. */ |
c81bebd7 | 946 | #undef PREFERRED_DEBUGGING_TYPE |
9ebbca7d | 947 | #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG |
c81bebd7 | 948 | |
e3f1f242 | 949 | #define DBX_DEBUGGING_INFO |
e3f1f242 | 950 | |
b6c9286a MM |
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 | |
9ebbca7d | 954 | call. For real AIX calling sequences, we also replace the |
b6c9286a MM |
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 | |
9ebbca7d | 957 | to read the prefixes. */ |
b6c9286a MM |
958 | |
959 | #undef ENCODE_SECTION_INFO | |
9ebbca7d | 960 | #define ENCODE_SECTION_INFO(DECL) rs6000_encode_section_info (DECL) |
d9407988 | 961 | |
9ebbca7d GK |
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) | |
b6c9286a | 966 | |
24ba1fb8 MM |
967 | /* This macro gets just the user-specified name |
968 | out of the string in a SYMBOL_REF. Discard | |
9ebbca7d GK |
969 | a leading * or @. */ |
970 | #define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \ | |
6fa02a05 | 971 | do { \ |
ec940faa | 972 | const char *_name = SYMBOL_NAME; \ |
6fa02a05 MM |
973 | while (*_name == '*' || *_name == '@') \ |
974 | _name++; \ | |
975 | (VAR) = _name; \ | |
976 | } while (0) | |
7509c759 MM |
977 | |
978 | /* This is how to output a reference to a user-level label named NAME. | |
979 | `assemble_name' uses this. */ | |
980 | ||
9ebbca7d GK |
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); \ | |
6fa02a05 | 993 | } while (0) |
24ba1fb8 | 994 | |
9ebbca7d GK |
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. */ | |
f7856bbc | 1007 | |
9ebbca7d | 1008 | /* Override elfos.h definition. */ |
f7856bbc | 1009 | #undef ASM_OUTPUT_SECTION_NAME |
9ebbca7d | 1010 | #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \ |
f7856bbc MM |
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; \ | |
3cce094d | 1019 | const char *mode; \ |
f7856bbc MM |
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"; \ | |
ad4ff310 | 1028 | else if (DECL && DECL_READONLY_SECTION (DECL, RELOC) && !TARGET_RELOCATABLE && !flag_pic) \ |
f7856bbc MM |
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; \ | |
ba1a5707 | 1041 | fprintf (FILE, "\t.section\t\"%s\",\"%s\"\n", NAME, mode); \ |
f7856bbc MM |
1042 | } \ |
1043 | else \ | |
1044 | { \ | |
1045 | if (DECL && s->type != type) \ | |
1046 | error_with_decl (DECL, "%s causes a section type conflict"); \ | |
1047 | \ | |
ba1a5707 | 1048 | fprintf (FILE, "\t.section\t\"%s\"\n", NAME); \ |
f7856bbc MM |
1049 | } \ |
1050 | } while (0) | |
1051 | ||
9ebbca7d GK |
1052 | /* Override elfos.h definition. */ |
1053 | #undef ASM_OUTPUT_CONSTRUCTOR | |
1054 | #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \ | |
c81bebd7 | 1055 | do { \ |
802a0058 MM |
1056 | if (DEFAULT_ABI != ABI_SOLARIS) \ |
1057 | { \ | |
1058 | ctors_section (); \ | |
b9f7d63e | 1059 | fprintf (FILE, "%s", INT_ASM_OP); \ |
802a0058 MM |
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); \ | |
c81bebd7 MM |
1069 | } while (0) |
1070 | ||
1071 | /* A C statement (sans semicolon) to output an element in the table of | |
1072 | global destructors. */ | |
9ebbca7d GK |
1073 | /* Override elfos.h definition. */ |
1074 | #undef ASM_OUTPUT_DESTRUCTOR | |
1075 | #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \ | |
c81bebd7 | 1076 | do { \ |
802a0058 MM |
1077 | if (DEFAULT_ABI != ABI_SOLARIS) \ |
1078 | { \ | |
1079 | dtors_section (); \ | |
b9f7d63e | 1080 | fprintf (FILE, "%s", INT_ASM_OP); \ |
802a0058 MM |
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); \ | |
c81bebd7 | 1090 | } while (0) |
c81bebd7 | 1091 | |
e3f1f242 MM |
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 | ||
9ebbca7d GK |
1099 | /* Override rs6000.h definition. */ |
1100 | #undef TARGET_VERSION | |
1101 | #define TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)"); | |
4697a36c | 1102 | \f |
9ebbca7d | 1103 | #define CPP_PREDEFINES \ |
2b57e919 | 1104 | "-DPPC -Dunix -D__svr4__ -Asystem=unix -Asystem=svr4 -Acpu=powerpc -Amachine=powerpc" |
c2baf133 | 1105 | |
9ebbca7d GK |
1106 | /* Pass various options to the assembler. */ |
1107 | /* Override svr4.h definition. */ | |
1108 | #undef ASM_SPEC | |
1109 | #define ASM_SPEC "%(asm_cpu) \ | |
38c1f2d7 | 1110 | %{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \ |
c81bebd7 | 1111 | %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \ |
3201f6d9 | 1112 | %{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \ |
b872164e | 1113 | %{memb} %{!memb: %{msdata: -memb} %{msdata=eabi: -memb}} \ |
c81bebd7 MM |
1114 | %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian} \ |
1115 | %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \ | |
bef84347 | 1116 | %{mcall-solaris: -mlittle -msolaris} \ |
c36ae96c | 1117 | %{mcall-i960-old: -mlittle} \ |
edf1b3f3 AC |
1118 | %{mcall-linux: -mbig} \ |
1119 | %{mcall-netbsd: -mbig} }}}}" | |
bef84347 | 1120 | |
9ebbca7d | 1121 | #define CC1_ENDIAN_BIG_SPEC "" |
bef84347 | 1122 | |
9ebbca7d | 1123 | #define CC1_ENDIAN_LITTLE_SPEC "\ |
bef84347 | 1124 | %{!mstrict-align: %{!mno-strict-align: \ |
c36ae96c | 1125 | %{!mcall-i960-old: \ |
bef84347 | 1126 | -mstrict-align \ |
c36ae96c | 1127 | } \ |
bef84347 | 1128 | }}" |
bef84347 | 1129 | |
9ebbca7d | 1130 | #define CC1_ENDIAN_DEFAULT_SPEC "%(cc1_endian_big_spec)" |
c81bebd7 | 1131 | |
9ebbca7d GK |
1132 | /* Pass -G xxx to the compiler and set correct endian mode. */ |
1133 | #define CC1_SPEC "%{G*} \ | |
bef84347 VM |
1134 | %{mlittle: %(cc1_endian_little)} %{!mlittle: %{mlittle-endian: %(cc1_endian_little)}} \ |
1135 | %{mbig: %(cc1_endian_big)} %{!mbig: %{mbig-endian: %(cc1_endian_big)}} \ | |
56e4a0eb | 1136 | %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \ |
56e4a0eb JW |
1137 | %{mcall-aixdesc: -mbig %(cc1_endian_big) } \ |
1138 | %{mcall-solaris: -mlittle %(cc1_endian_little) } \ | |
c36ae96c | 1139 | %{mcall-i960-old: -mlittle %(cc1_endian_little) } \ |
56e4a0eb | 1140 | %{mcall-linux: -mbig %(cc1_endian_big) } \ |
edf1b3f3 AC |
1141 | %{mcall-netbsd: -mbig %(cc1_endian_big) } \ |
1142 | %{!mcall-aixdesc: %{!mcall-solaris: %{!mcall-i960-old: %{!mcall-linux: %{!mcall-netbsd: \ | |
bef84347 | 1143 | %(cc1_endian_default) \ |
edf1b3f3 | 1144 | }}}}} \ |
56e4a0eb | 1145 | }}}} \ |
5c7ad97f | 1146 | %{mcall-solaris: -mregnames } \ |
d9407988 | 1147 | %{mno-sdata: -msdata=none } \ |
c81bebd7 MM |
1148 | %{meabi: %{!mcall-*: -mcall-sysv }} \ |
1149 | %{!meabi: %{!mno-eabi: \ | |
802a0058 | 1150 | %{mrelocatable: -meabi } \ |
c81bebd7 | 1151 | %{mcall-solaris: -mno-eabi } \ |
c36ae96c | 1152 | %{mcall-i960-old: -meabi } \ |
edf1b3f3 AC |
1153 | %{mcall-linux: -mno-eabi } \ |
1154 | %{mcall-netbsd: -mno-eabi }}} \ | |
38c1f2d7 | 1155 | %{msdata: -msdata=default} \ |
d540a32c FS |
1156 | %{mno-sdata: -msdata=none} \ |
1157 | %{profile: -p}" | |
c81bebd7 | 1158 | |
9ebbca7d | 1159 | /* Don't put -Y P,<path> for cross compilers. */ |
7509c759 MM |
1160 | #ifndef CROSS_COMPILE |
1161 | #define LINK_PATH_SPEC "\ | |
d6a2af95 | 1162 | %{!R*:%{L*:-R %*}} \ |
fba29a8c MM |
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}}}}" | |
7509c759 | 1171 | |
113166a6 | 1172 | #else |
7509c759 MM |
1173 | #define LINK_PATH_SPEC "" |
1174 | #endif | |
75814ad4 | 1175 | |
9ebbca7d | 1176 | /* Default starting address if specified. */ |
c81bebd7 | 1177 | #define LINK_START_SPEC "\ |
e9a25f70 JL |
1178 | %{mads: %(link_start_ads) } \ |
1179 | %{myellowknife: %(link_start_yellowknife) } \ | |
c81bebd7 MM |
1180 | %{mmvme: %(link_start_mvme) } \ |
1181 | %{msim: %(link_start_sim) } \ | |
1182 | %{mcall-linux: %(link_start_linux) } \ | |
edf1b3f3 | 1183 | %{mcall-netbsd: %(link_start_netbsd) } \ |
c81bebd7 | 1184 | %{mcall-solaris: %(link_start_solaris) } \ |
edf1b3f3 | 1185 | %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(link_start_default) }}}}}}}" |
c81bebd7 | 1186 | |
9da71b16 | 1187 | #define LINK_START_DEFAULT_SPEC "" |
c81bebd7 | 1188 | |
9ebbca7d GK |
1189 | /* Override svr4.h definition. */ |
1190 | #undef LINK_SPEC | |
1191 | #define LINK_SPEC "\ | |
48a0fabb | 1192 | %{h*} %{v:-V} %{G*} \ |
fba29a8c MM |
1193 | %{Wl,*:%*} %{YP,*} %{R*} \ |
1194 | %{Qy:} %{!Qn:-Qy} \ | |
1195 | %(link_shlib) \ | |
362c63a5 | 1196 | %{!Wl,-T*: %{!T*: %(link_start) }} \ |
fba29a8c MM |
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 | ||
fba29a8c | 1205 | #ifndef NO_SHARED_LIB_SUPPORT |
956d6950 | 1206 | /* Shared libraries are default. */ |
fba29a8c MM |
1207 | #define LINK_SHLIB_SPEC "\ |
1208 | %{!static: %(link_path) %{!R*:%{L*:-R %*}}} \ | |
1209 | %{mshlib: } \ | |
afec0ea9 | 1210 | %{static:-dn -Bstatic} \ |
8b496c8d ILT |
1211 | %{shared:-G -dy -z text} \ |
1212 | %{symbolic:-Bsymbolic -G -dy -z text}" | |
fba29a8c MM |
1213 | |
1214 | #else | |
1215 | /* Shared libraries are not default. */ | |
1216 | #define LINK_SHLIB_SPEC "\ | |
d6a2af95 | 1217 | %{mshlib: %(link_path) } \ |
fba29a8c MM |
1218 | %{!mshlib: %{!shared: %{!symbolic: -dn -Bstatic}}} \ |
1219 | %{static: } \ | |
8b496c8d ILT |
1220 | %{shared:-G -dy -z text %(link_path) } \ |
1221 | %{symbolic:-Bsymbolic -G -dy -z text %(link_path) }" | |
fba29a8c MM |
1222 | #endif |
1223 | ||
1224 | /* Override the default target of the linker. */ | |
fba29a8c | 1225 | #define LINK_TARGET_SPEC "\ |
36b8ffbe | 1226 | %{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } \ |
9ebbca7d | 1227 | %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \ |
c36ae96c | 1228 | %{mcall-i960-old: --oformat elf32-powerpcle} \ |
36b8ffbe | 1229 | %{mcall-solaris: --oformat elf32-powerpcle} \ |
9ebbca7d | 1230 | }}}}" |
fba29a8c | 1231 | |
9ebbca7d | 1232 | /* Any specific OS flags. */ |
fba29a8c | 1233 | #define LINK_OS_SPEC "\ |
e9a25f70 JL |
1234 | %{mads: %(link_os_ads) } \ |
1235 | %{myellowknife: %(link_os_yellowknife) } \ | |
fba29a8c MM |
1236 | %{mmvme: %(link_os_mvme) } \ |
1237 | %{msim: %(link_os_sim) } \ | |
1238 | %{mcall-linux: %(link_os_linux) } \ | |
edf1b3f3 | 1239 | %{mcall-netbsd: %(link_os_netbsd) } \ |
fba29a8c | 1240 | %{mcall-solaris: %(link_os_solaris) } \ |
edf1b3f3 | 1241 | %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(link_os_default) }}}}}}}" |
c81bebd7 | 1242 | |
fba29a8c | 1243 | #define LINK_OS_DEFAULT_SPEC "" |
afec0ea9 | 1244 | |
841faeed | 1245 | #define CPP_SYSV_SPEC \ |
3cfa4909 | 1246 | "%{mrelocatable*: -D_RELOCATABLE} \ |
5b9d9a0c | 1247 | %{fpic: -D__PIC__=1 -D__pic__=1} \ |
d540a32c | 1248 | %{!fpic: %{fPIC: -D__PIC__=2 -D__pic__=2}} \ |
e0f7170a GK |
1249 | %{mlong-double-128: -D__LONG_DOUBLE_128__=1} \ |
1250 | %{!mlong-double-64: %(cpp_longdouble_default)} \ | |
9ebbca7d | 1251 | %{mcall-sysv: -D_CALL_SYSV} \ |
b6c9286a | 1252 | %{mcall-aix: -D_CALL_AIX} %{mcall-aixdesc: -D_CALL_AIX -D_CALL_AIXDESC} \ |
9ebbca7d GK |
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 "" | |
841faeed | 1267 | |
e0f7170a GK |
1268 | /* Whether 'long double' is 128 bits by default. */ |
1269 | #define CPP_LONGDOUBLE_DEFAULT_SPEC "" | |
1270 | ||
841faeed MM |
1271 | #define CPP_SYSV_DEFAULT_SPEC "-D_CALL_SYSV" |
1272 | ||
2bfcf297 | 1273 | #define CPP_ENDIAN_BIG_SPEC "-D_BIG_ENDIAN -D__BIG_ENDIAN__ -Amachine=bigendian" |
5b9d9a0c | 1274 | |
2bfcf297 | 1275 | #define CPP_ENDIAN_LITTLE_SPEC "-D_LITTLE_ENDIAN -D__LITTLE_ENDIAN__ -Amachine=littleendian" |
5b9d9a0c | 1276 | |
2bfcf297 | 1277 | #define CPP_ENDIAN_SOLARIS_SPEC "-D__LITTLE_ENDIAN__ -Amachine=littleendian" |
5b9d9a0c | 1278 | |
c81bebd7 | 1279 | /* For solaris, don't define _LITTLE_ENDIAN, it conflicts with a header file. */ |
841faeed | 1280 | #define CPP_ENDIAN_SPEC \ |
5b9d9a0c MM |
1281 | "%{mlittle: %(cpp_endian_little) } \ |
1282 | %{mlittle-endian: %(cpp_endian_little) } \ | |
1283 | %{mbig: %(cpp_endian_big) } \ | |
1284 | %{mbig-endian: %(cpp_endian_big) } \ | |
c81bebd7 | 1285 | %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \ |
5b9d9a0c | 1286 | %{mcall-solaris: %(cpp_endian_solaris) } \ |
5b9d9a0c | 1287 | %{mcall-linux: %(cpp_endian_big) } \ |
edf1b3f3 | 1288 | %{mcall-netbsd: %(cpp_endian_big) } \ |
c36ae96c | 1289 | %{mcall-i960-old: %(cpp_endian_little) } \ |
5b9d9a0c | 1290 | %{mcall-aixdesc: %(cpp_endian_big) } \ |
edf1b3f3 | 1291 | %{!mcall-solaris: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-aixdesc: %(cpp_endian_default) }}}}}}}}" |
c81bebd7 | 1292 | |
5b9d9a0c | 1293 | #define CPP_ENDIAN_DEFAULT_SPEC "%(cpp_endian_big)" |
841faeed | 1294 | |
9ebbca7d GK |
1295 | /* Override rs6000.h definition. */ |
1296 | #undef CPP_SPEC | |
1297 | #define CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_sysv) %(cpp_endian) %(cpp_cpu) \ | |
e9a25f70 JL |
1298 | %{mads: %(cpp_os_ads) } \ |
1299 | %{myellowknife: %(cpp_os_yellowknife) } \ | |
c81bebd7 MM |
1300 | %{mmvme: %(cpp_os_mvme) } \ |
1301 | %{msim: %(cpp_os_sim) } \ | |
1302 | %{mcall-linux: %(cpp_os_linux) } \ | |
edf1b3f3 | 1303 | %{mcall-netbsd: %(cpp_os_netbsd) } \ |
c81bebd7 | 1304 | %{mcall-solaris: %(cpp_os_solaris) } \ |
edf1b3f3 | 1305 | %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(cpp_os_default) }}}}}}}" |
c81bebd7 | 1306 | |
9ebbca7d | 1307 | #define CPP_OS_DEFAULT_SPEC "" |
c81bebd7 | 1308 | |
9ebbca7d GK |
1309 | /* Override svr4.h definition. */ |
1310 | #undef STARTFILE_SPEC | |
c81bebd7 | 1311 | #define STARTFILE_SPEC "\ |
e9a25f70 JL |
1312 | %{mads: %(startfile_ads) } \ |
1313 | %{myellowknife: %(startfile_yellowknife) } \ | |
c81bebd7 MM |
1314 | %{mmvme: %(startfile_mvme) } \ |
1315 | %{msim: %(startfile_sim) } \ | |
1316 | %{mcall-linux: %(startfile_linux) } \ | |
edf1b3f3 | 1317 | %{mcall-netbsd: %(startfile_netbsd) } \ |
c81bebd7 | 1318 | %{mcall-solaris: %(startfile_solaris) } \ |
edf1b3f3 | 1319 | %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(startfile_default) }}}}}}}" |
c81bebd7 | 1320 | |
c81bebd7 MM |
1321 | #define STARTFILE_DEFAULT_SPEC "" |
1322 | ||
9ebbca7d | 1323 | /* Override svr4.h definition. */ |
c81bebd7 MM |
1324 | #undef LIB_SPEC |
1325 | #define LIB_SPEC "\ | |
e9a25f70 JL |
1326 | %{mads: %(lib_ads) } \ |
1327 | %{myellowknife: %(lib_yellowknife) } \ | |
c81bebd7 MM |
1328 | %{mmvme: %(lib_mvme) } \ |
1329 | %{msim: %(lib_sim) } \ | |
1330 | %{mcall-linux: %(lib_linux) } \ | |
edf1b3f3 | 1331 | %{mcall-netbsd: %(lib_netbsd) } \ |
c81bebd7 | 1332 | %{mcall-solaris: %(lib_solaris) } \ |
edf1b3f3 | 1333 | %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(lib_default) }}}}}}}" |
c81bebd7 | 1334 | |
9da71b16 | 1335 | #define LIB_DEFAULT_SPEC "" |
9da71b16 | 1336 | |
9ebbca7d | 1337 | /* Override svr4.h definition. */ |
c81bebd7 MM |
1338 | #undef ENDFILE_SPEC |
1339 | #define ENDFILE_SPEC "\ | |
362c63a5 GK |
1340 | %{mads: %(endfile_ads)} \ |
1341 | %{myellowknife: %(endfile_yellowknife)} \ | |
1342 | %{mmvme: %(endfile_mvme)} \ | |
1343 | %{msim: %(endfile_sim)} \ | |
03453a9f | 1344 | %{mcall-linux: %(endfile_linux) } \ |
edf1b3f3 | 1345 | %{mcall-netbsd: %(endfile_netbsd) } \ |
362c63a5 | 1346 | %{mcall-solaris: %(endfile_solaris)} \ |
9ebbca7d | 1347 | %{mvxworks: %(endfile_vxworks) } \ |
edf1b3f3 | 1348 | %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %{!mvxworks: %(endfile_default) }}}}}}}}" |
c81bebd7 | 1349 | |
c81bebd7 MM |
1350 | #define ENDFILE_DEFAULT_SPEC "" |
1351 | ||
e9a25f70 | 1352 | /* Motorola ADS support. */ |
e9a25f70 | 1353 | #define LIB_ADS_SPEC "--start-group -lads -lc --end-group" |
e9a25f70 | 1354 | |
362c63a5 | 1355 | #define STARTFILE_ADS_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s" |
e9a25f70 | 1356 | |
362c63a5 | 1357 | #define ENDFILE_ADS_SPEC "crtend.o%s ecrtn.o%s" |
e9a25f70 | 1358 | |
e9a25f70 | 1359 | #define LINK_START_ADS_SPEC "-T ads.ld%s" |
e9a25f70 | 1360 | |
e9a25f70 | 1361 | #define LINK_OS_ADS_SPEC "" |
e9a25f70 | 1362 | |
e9a25f70 | 1363 | #define CPP_OS_ADS_SPEC "" |
e9a25f70 JL |
1364 | |
1365 | /* Motorola Yellowknife support. */ | |
e9a25f70 | 1366 | #define LIB_YELLOWKNIFE_SPEC "--start-group -lyk -lc --end-group" |
e9a25f70 | 1367 | |
362c63a5 | 1368 | #define STARTFILE_YELLOWKNIFE_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s" |
e9a25f70 | 1369 | |
362c63a5 | 1370 | #define ENDFILE_YELLOWKNIFE_SPEC "crtend.o%s ecrtn.o%s" |
e9a25f70 | 1371 | |
e9a25f70 | 1372 | #define LINK_START_YELLOWKNIFE_SPEC "-T yellowknife.ld%s" |
e9a25f70 | 1373 | |
e9a25f70 | 1374 | #define LINK_OS_YELLOWKNIFE_SPEC "" |
e9a25f70 | 1375 | |
e9a25f70 | 1376 | #define CPP_OS_YELLOWKNIFE_SPEC "" |
e9a25f70 | 1377 | |
c81bebd7 | 1378 | /* Motorola MVME support. */ |
e9a25f70 | 1379 | #define LIB_MVME_SPEC "--start-group -lmvme -lc --end-group" |
c81bebd7 | 1380 | |
362c63a5 | 1381 | #define STARTFILE_MVME_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s" |
c81bebd7 | 1382 | |
362c63a5 | 1383 | #define ENDFILE_MVME_SPEC "crtend.o%s ecrtn.o%s" |
c81bebd7 | 1384 | |
362c63a5 | 1385 | #define LINK_START_MVME_SPEC "-Ttext 0x40000" |
c81bebd7 | 1386 | |
fba29a8c | 1387 | #define LINK_OS_MVME_SPEC "" |
fba29a8c | 1388 | |
c81bebd7 | 1389 | #define CPP_OS_MVME_SPEC "" |
c81bebd7 MM |
1390 | |
1391 | /* PowerPC simulator based on netbsd system calls support. */ | |
e9a25f70 | 1392 | #define LIB_SIM_SPEC "--start-group -lsim -lc --end-group" |
c81bebd7 | 1393 | |
362c63a5 | 1394 | #define STARTFILE_SIM_SPEC "ecrti.o%s sim-crt0.o%s crtbegin.o%s" |
c81bebd7 | 1395 | |
362c63a5 | 1396 | #define ENDFILE_SIM_SPEC "crtend.o%s ecrtn.o%s" |
c81bebd7 | 1397 | |
362c63a5 | 1398 | #define LINK_START_SIM_SPEC "" |
c81bebd7 | 1399 | |
362c63a5 | 1400 | #define LINK_OS_SIM_SPEC "-m elf32ppcsim" |
fba29a8c | 1401 | |
c81bebd7 | 1402 | #define CPP_OS_SIM_SPEC "" |
c81bebd7 | 1403 | |
956d6950 | 1404 | /* GNU/Linux support. */ |
d540a32c FS |
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 | |
c81bebd7 | 1413 | |
9a57586f MM |
1414 | #define STARTFILE_LINUX_SPEC "\ |
1415 | %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \ | |
b26e3a82 | 1416 | %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \ |
362c63a5 | 1417 | %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" |
c81bebd7 | 1418 | |
362c63a5 GK |
1419 | #define ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \ |
1420 | %{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}" | |
c81bebd7 | 1421 | |
362c63a5 | 1422 | #define LINK_START_LINUX_SPEC "" |
c81bebd7 | 1423 | |
362c63a5 GK |
1424 | #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \ |
1425 | %{rdynamic:-export-dynamic} \ | |
1426 | %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}" | |
fba29a8c | 1427 | |
d540a32c | 1428 | #ifdef USE_GNULIBC_1 |
5a1b894d FS |
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}}} \ | |
2b57e919 | 1434 | -Asystem=unix -Asystem=posix" |
d540a32c | 1435 | #else |
5a1b894d FS |
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}}} \ | |
2b57e919 | 1441 | -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}" |
d540a32c | 1442 | #endif |
c81bebd7 | 1443 | |
edf1b3f3 AC |
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 | ||
c81bebd7 MM |
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 | ||
c81bebd7 | 1479 | #define LIB_SOLARIS_SPEC "\ |
e9a25f70 | 1480 | %{mnewlib: --start-group -lsolaris -lc --end-group } \ |
c81bebd7 MM |
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} \ | |
f7856bbc | 1487 | %{solaris-cclib: /opt/SUNWspro/SC4.0/lib/libabi.a} \ |
35cf49d4 | 1488 | %{!shared: %{!symbolic: -lc }}}" |
c81bebd7 | 1489 | |
0bc25b2b MM |
1490 | #define STARTFILE_SOLARIS_SPEC "\ |
1491 | %{!msolaris-cclib: scrti.o%s scrt0.o%s} \ | |
362c63a5 GK |
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}" | |
c81bebd7 | 1494 | |
0bc25b2b | 1495 | #define ENDFILE_SOLARIS_SPEC "\ |
362c63a5 | 1496 | %{!shared:crtend.o%s} %{shared:crtendS.o%s} \ |
0bc25b2b | 1497 | %{!msolaris-cclib: scrtn.o%s} \ |
f7856bbc | 1498 | %{msolaris-cclib: /opt/SUNWspro/SC4.0/lib/crtn.o%s}" |
c81bebd7 | 1499 | |
c81bebd7 | 1500 | #define LINK_START_SOLARIS_SPEC "" |
c81bebd7 | 1501 | |
fba29a8c | 1502 | #define LINK_OS_SOLARIS_SPEC "" |
fba29a8c | 1503 | |
c81bebd7 | 1504 | #define CPP_OS_SOLARIS_SPEC "-D__ppc -D__sun__=1 -D__unix__ -D__svr4__ -D__SVR4__ \ |
f58f9450 DJ |
1505 | %{!undef:%{!ansi:%{!std=*:-Dsun=1 -Dunix -DSVR4 -D__EXTENSIONS__} \ |
1506 | %{std=gnu*:-Dsun=1 -Dunix -DSVR4 -D__EXTENSIONS__}}} \ | |
2b57e919 | 1507 | -Amachine=prep" |
9ebbca7d GK |
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}" | |
c81bebd7 MM |
1548 | |
1549 | /* Define any extra SPECS that the compiler needs to generate. */ | |
9ebbca7d | 1550 | /* Override rs6000.h definition. */ |
c81bebd7 | 1551 | #undef SUBTARGET_EXTRA_SPECS |
9ebbca7d GK |
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 }, \ | |
e9a25f70 JL |
1557 | { "lib_ads", LIB_ADS_SPEC }, \ |
1558 | { "lib_yellowknife", LIB_YELLOWKNIFE_SPEC }, \ | |
c81bebd7 MM |
1559 | { "lib_mvme", LIB_MVME_SPEC }, \ |
1560 | { "lib_sim", LIB_SIM_SPEC }, \ | |
1561 | { "lib_linux", LIB_LINUX_SPEC }, \ | |
edf1b3f3 | 1562 | { "lib_netbsd", LIB_NETBSD_SPEC }, \ |
c81bebd7 | 1563 | { "lib_solaris", LIB_SOLARIS_SPEC }, \ |
9ebbca7d | 1564 | { "lib_vxworks", LIB_VXWORKS_SPEC }, \ |
c81bebd7 | 1565 | { "lib_default", LIB_DEFAULT_SPEC }, \ |
e9a25f70 JL |
1566 | { "startfile_ads", STARTFILE_ADS_SPEC }, \ |
1567 | { "startfile_yellowknife", STARTFILE_YELLOWKNIFE_SPEC }, \ | |
c81bebd7 MM |
1568 | { "startfile_mvme", STARTFILE_MVME_SPEC }, \ |
1569 | { "startfile_sim", STARTFILE_SIM_SPEC }, \ | |
1570 | { "startfile_linux", STARTFILE_LINUX_SPEC }, \ | |
edf1b3f3 | 1571 | { "startfile_netbsd", STARTFILE_NETBSD_SPEC }, \ |
c81bebd7 | 1572 | { "startfile_solaris", STARTFILE_SOLARIS_SPEC }, \ |
9ebbca7d | 1573 | { "startfile_vxworks", STARTFILE_VXWORKS_SPEC }, \ |
c81bebd7 | 1574 | { "startfile_default", STARTFILE_DEFAULT_SPEC }, \ |
e9a25f70 JL |
1575 | { "endfile_ads", ENDFILE_ADS_SPEC }, \ |
1576 | { "endfile_yellowknife", ENDFILE_YELLOWKNIFE_SPEC }, \ | |
c81bebd7 MM |
1577 | { "endfile_mvme", ENDFILE_MVME_SPEC }, \ |
1578 | { "endfile_sim", ENDFILE_SIM_SPEC }, \ | |
1579 | { "endfile_linux", ENDFILE_LINUX_SPEC }, \ | |
edf1b3f3 | 1580 | { "endfile_netbsd", ENDFILE_NETBSD_SPEC }, \ |
c81bebd7 | 1581 | { "endfile_solaris", ENDFILE_SOLARIS_SPEC }, \ |
9ebbca7d | 1582 | { "endfile_vxworks", ENDFILE_VXWORKS_SPEC }, \ |
c81bebd7 | 1583 | { "endfile_default", ENDFILE_DEFAULT_SPEC }, \ |
fba29a8c MM |
1584 | { "link_path", LINK_PATH_SPEC }, \ |
1585 | { "link_shlib", LINK_SHLIB_SPEC }, \ | |
1586 | { "link_target", LINK_TARGET_SPEC }, \ | |
83cd7147 | 1587 | { "link_start", LINK_START_SPEC }, \ |
e9a25f70 JL |
1588 | { "link_start_ads", LINK_START_ADS_SPEC }, \ |
1589 | { "link_start_yellowknife", LINK_START_YELLOWKNIFE_SPEC }, \ | |
c81bebd7 MM |
1590 | { "link_start_mvme", LINK_START_MVME_SPEC }, \ |
1591 | { "link_start_sim", LINK_START_SIM_SPEC }, \ | |
1592 | { "link_start_linux", LINK_START_LINUX_SPEC }, \ | |
edf1b3f3 | 1593 | { "link_start_netbsd", LINK_START_NETBSD_SPEC }, \ |
c81bebd7 | 1594 | { "link_start_solaris", LINK_START_SOLARIS_SPEC }, \ |
9ebbca7d | 1595 | { "link_start_vxworks", LINK_START_VXWORKS_SPEC }, \ |
c81bebd7 | 1596 | { "link_start_default", LINK_START_DEFAULT_SPEC }, \ |
fba29a8c | 1597 | { "link_os", LINK_OS_SPEC }, \ |
e9a25f70 JL |
1598 | { "link_os_ads", LINK_OS_ADS_SPEC }, \ |
1599 | { "link_os_yellowknife", LINK_OS_YELLOWKNIFE_SPEC }, \ | |
fba29a8c MM |
1600 | { "link_os_mvme", LINK_OS_MVME_SPEC }, \ |
1601 | { "link_os_sim", LINK_OS_SIM_SPEC }, \ | |
1602 | { "link_os_linux", LINK_OS_LINUX_SPEC }, \ | |
edf1b3f3 | 1603 | { "link_os_netbsd", LINK_OS_NETBSD_SPEC }, \ |
fba29a8c | 1604 | { "link_os_solaris", LINK_OS_SOLARIS_SPEC }, \ |
9ebbca7d | 1605 | { "link_os_vxworks", LINK_OS_VXWORKS_SPEC }, \ |
fba29a8c | 1606 | { "link_os_default", LINK_OS_DEFAULT_SPEC }, \ |
bef84347 VM |
1607 | { "cc1_endian_big", CC1_ENDIAN_BIG_SPEC }, \ |
1608 | { "cc1_endian_little", CC1_ENDIAN_LITTLE_SPEC }, \ | |
1609 | { "cc1_endian_default", CC1_ENDIAN_DEFAULT_SPEC }, \ | |
5b9d9a0c MM |
1610 | { "cpp_endian_big", CPP_ENDIAN_BIG_SPEC }, \ |
1611 | { "cpp_endian_little", CPP_ENDIAN_LITTLE_SPEC }, \ | |
1612 | { "cpp_endian_solaris", CPP_ENDIAN_SOLARIS_SPEC }, \ | |
9ebbca7d | 1613 | { "cpp_float_default", CPP_FLOAT_DEFAULT_SPEC }, \ |
e0f7170a | 1614 | { "cpp_longdouble_default", CPP_LONGDOUBLE_DEFAULT_SPEC }, \ |
e9a25f70 JL |
1615 | { "cpp_os_ads", CPP_OS_ADS_SPEC }, \ |
1616 | { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \ | |
c81bebd7 MM |
1617 | { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \ |
1618 | { "cpp_os_sim", CPP_OS_SIM_SPEC }, \ | |
1619 | { "cpp_os_linux", CPP_OS_LINUX_SPEC }, \ | |
edf1b3f3 | 1620 | { "cpp_os_netbsd", CPP_OS_NETBSD_SPEC }, \ |
c81bebd7 | 1621 | { "cpp_os_solaris", CPP_OS_SOLARIS_SPEC }, \ |
9ebbca7d | 1622 | { "cpp_os_vxworks", CPP_OS_VXWORKS_SPEC }, \ |
fba29a8c | 1623 | { "cpp_os_default", CPP_OS_DEFAULT_SPEC }, |
b6c9286a MM |
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 | ||
3807773b | 1634 | #define MULTILIB_DEFAULTS { "mbig", "mcall-sysv" } |
38c1f2d7 MM |
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. */ | |
38c1f2d7 | 1642 | #define RS6000_MCOUNT "_mcount" |
e0f7170a | 1643 | |
edf11378 FS |
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 | ||
e0f7170a GK |
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) | |
e44713f7 GK |
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. */ | |
50c30603 GK |
1716 | #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \ |
1717 | ((flag_pic || TARGET_RELOCATABLE) \ | |
e44713f7 GK |
1718 | ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \ |
1719 | : DW_EH_PE_absptr) | |
50c30603 | 1720 | |
e44713f7 | 1721 | #define EXCEPTION_SECTION readonly_data_section |
2bfcf297 | 1722 | #define DOUBLE_INT_ASM_OP ".quad" |