OSDN Git Service

* target-def.h (TARGET_ASM_OUTPUT_MI_THUNK): Default to NULL.
[pf3gnuchains/gcc-fork.git] / gcc / config / rs6000 / sysv4.h
1 /* Target definitions for GNU compiler for PowerPC running System V.4
2    Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
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 /* Small data support types.  */
38 enum rs6000_sdata_type {
39   SDATA_NONE,                   /* No small data support.  */
40   SDATA_DATA,                   /* Just put data in .sbss/.sdata, don't use relocs.  */
41   SDATA_SYSV,                   /* Use r13 to point to .sdata/.sbss.  */
42   SDATA_EABI                    /* Use r13 like above, r2 points to .sdata2/.sbss2.  */
43 };
44
45 extern enum rs6000_sdata_type rs6000_sdata;
46
47 /* V.4/eabi switches.  */
48 #define MASK_NO_BITFIELD_TYPE   0x40000000      /* Set PCC_BITFIELD_TYPE_MATTERS to 0.  */
49 #define MASK_STRICT_ALIGN       0x20000000      /* Set STRICT_ALIGNMENT to 1.  */
50 #define MASK_RELOCATABLE        0x10000000      /* GOT pointers are PC relative.  */
51 #define MASK_EABI               0x08000000      /* Adhere to eabi, not System V spec.  */
52 #define MASK_LITTLE_ENDIAN      0x04000000      /* Target is little endian.  */
53 #define MASK_REGNAMES           0x02000000      /* Use alternate register names.  */
54 #define MASK_PROTOTYPE          0x01000000      /* Only prototyped fcns pass variable args.  */
55 #define MASK_NO_BITFIELD_WORD   0x00800000      /* Bitfields cannot cross word boundaries */
56
57 #define TARGET_NO_BITFIELD_TYPE (target_flags & MASK_NO_BITFIELD_TYPE)
58 #define TARGET_STRICT_ALIGN     (target_flags & MASK_STRICT_ALIGN)
59 #define TARGET_RELOCATABLE      (target_flags & MASK_RELOCATABLE)
60 #define TARGET_EABI             (target_flags & MASK_EABI)
61 #define TARGET_LITTLE_ENDIAN    (target_flags & MASK_LITTLE_ENDIAN)
62 #define TARGET_REGNAMES         (target_flags & MASK_REGNAMES)
63 #define TARGET_PROTOTYPE        (target_flags & MASK_PROTOTYPE)
64 #define TARGET_NO_BITFIELD_WORD (target_flags & MASK_NO_BITFIELD_WORD)
65 #define TARGET_TOC              ((target_flags & MASK_64BIT)            \
66                                  || ((target_flags & (MASK_RELOCATABLE  \
67                                                       | MASK_MINIMAL_TOC)) \
68                                      && flag_pic > 1)                   \
69                                  || DEFAULT_ABI == ABI_AIX)
70
71 #define TARGET_BITFIELD_TYPE    (! TARGET_NO_BITFIELD_TYPE)
72 #define TARGET_BIG_ENDIAN       (! TARGET_LITTLE_ENDIAN)
73 #define TARGET_NO_PROTOTYPE     (! TARGET_PROTOTYPE)
74 #define TARGET_NO_TOC           (! TARGET_TOC)
75 #define TARGET_NO_EABI          (! TARGET_EABI)
76
77 /* Strings provided by SUBTARGET_OPTIONS */
78 extern const char *rs6000_abi_name;
79 extern const char *rs6000_sdata_name;
80
81 /* Override rs6000.h definition.  */
82 #undef  SUBTARGET_OPTIONS
83 #define SUBTARGET_OPTIONS                                               \
84   { "call-",  &rs6000_abi_name, N_("Select ABI calling convention") },  \
85   { "sdata=", &rs6000_sdata_name, N_("Select method for sdata handling") }
86
87 /* Max # of bytes for variables to automatically be put into the .sdata
88    or .sdata2 sections.  */
89 extern int g_switch_value;              /* Value of the -G xx switch.  */
90 extern int g_switch_set;                /* Whether -G xx was passed.  */
91
92 #define SDATA_DEFAULT_SIZE 8
93
94 /* Note, V.4 no longer uses a normal TOC, so make -mfull-toc, be just
95    the same as -mminimal-toc.  */
96 /* Override rs6000.h definition.  */
97 #undef  SUBTARGET_SWITCHES
98 #define SUBTARGET_SWITCHES                                              \
99   { "bit-align",        -MASK_NO_BITFIELD_TYPE,                         \
100     N_("Align to the base type of the bit-field") },                    \
101   { "no-bit-align",      MASK_NO_BITFIELD_TYPE,                         \
102     N_("Don't align to the base type of the bit-field") },              \
103   { "strict-align",      MASK_STRICT_ALIGN,                             \
104     N_("Don't assume that unaligned accesses are handled by the system") }, \
105   { "no-strict-align",  -MASK_STRICT_ALIGN,                             \
106     N_("Assume that unaligned accesses are handled by the system") },   \
107   { "relocatable",       MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, \
108     N_("Produce code relocatable at runtime") },                        \
109   { "no-relocatable",   -MASK_RELOCATABLE,                              \
110     N_("Don't produce code relocatable at runtime") },                  \
111   { "relocatable-lib",   MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, \
112     N_("Produce code relocatable at runtime") },                        \
113   { "no-relocatable-lib", -MASK_RELOCATABLE,                            \
114     N_("Don't produce code relocatable at runtime") },                  \
115   { "little-endian",     MASK_LITTLE_ENDIAN,                            \
116     N_("Produce little endian code") },                                 \
117   { "little",            MASK_LITTLE_ENDIAN,                            \
118     N_("Produce little endian code") },                                 \
119   { "big-endian",       -MASK_LITTLE_ENDIAN,                            \
120     N_("Produce big endian code") },                                    \
121   { "big",              -MASK_LITTLE_ENDIAN,                            \
122     N_("Produce big endian code") },                                    \
123   { "no-toc",            0, N_("no description yet") },                 \
124   { "toc",               MASK_MINIMAL_TOC, N_("no description yet") },  \
125   { "full-toc",          MASK_MINIMAL_TOC, N_("no description yet") },  \
126   { "prototype",         MASK_PROTOTYPE, N_("no description yet") },    \
127   { "no-prototype",     -MASK_PROTOTYPE, N_("no description yet") },    \
128   { "no-traceback",      0, N_("no description yet") },                 \
129   { "eabi",              MASK_EABI, N_("Use EABI") },                   \
130   { "no-eabi",          -MASK_EABI, N_("Don't use EABI") },             \
131   { "bit-word",         -MASK_NO_BITFIELD_WORD, "" },                   \
132   { "no-bit-word",       MASK_NO_BITFIELD_WORD,                         \
133     N_("Do not allow bit-fields to cross word boundaries") },           \
134   { "regnames",           MASK_REGNAMES,                                \
135     N_("Use alternate register names") },                               \
136   { "no-regnames",       -MASK_REGNAMES,                                \
137     N_("Don't use alternate register names") },                         \
138   { "sdata",             0, N_("no description yet") },                 \
139   { "no-sdata",          0, N_("no description yet") },                 \
140   { "sim",               0,                                             \
141     N_("Link with libsim.a, libc.a and sim-crt0.o") },                  \
142   { "ads",               0,                                             \
143     N_("Link with libads.a, libc.a and crt0.o") },                      \
144   { "yellowknife",       0,                                             \
145     N_("Link with libyk.a, libc.a and crt0.o") },                       \
146   { "mvme",              0,                                             \
147     N_("Link with libmvme.a, libc.a and crt0.o") },                     \
148   { "emb",               0,                                             \
149     N_("Set the PPC_EMB bit in the ELF flags header") },                \
150   { "vxworks",           0, N_("no description yet") },                 \
151   { "windiss",           0, N_("Use the WindISS simulator") },          \
152   { "shlib",             0, N_("no description yet") },                 \
153   EXTRA_SUBTARGET_SWITCHES                                              \
154   { "newlib",            0, N_("no description yet") },
155
156 /* This is meant to be redefined in the host dependent files.  */
157 #define EXTRA_SUBTARGET_SWITCHES
158
159 /* Sometimes certain combinations of command options do not make sense
160    on a particular target machine.  You can define a macro
161    `OVERRIDE_OPTIONS' to take account of this.  This macro, if
162    defined, is executed once just after all the command options have
163    been parsed.
164
165    The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to
166    get control.  */
167
168 #define SUBTARGET_OVERRIDE_OPTIONS                                      \
169 do {                                                                    \
170   if (!g_switch_set)                                                    \
171     g_switch_value = SDATA_DEFAULT_SIZE;                                \
172                                                                         \
173   if (!strcmp (rs6000_abi_name, "sysv"))                                \
174     rs6000_current_abi = ABI_V4;                                        \
175   else if (!strcmp (rs6000_abi_name, "sysv-noeabi"))                    \
176     {                                                                   \
177       rs6000_current_abi = ABI_V4;                                      \
178       target_flags &= ~ MASK_EABI;                                      \
179     }                                                                   \
180   else if (!strcmp (rs6000_abi_name, "sysv-eabi")                       \
181            || !strcmp (rs6000_abi_name, "eabi"))                        \
182     {                                                                   \
183       rs6000_current_abi = ABI_V4;                                      \
184       target_flags |= MASK_EABI;                                        \
185     }                                                                   \
186   else if (!strcmp (rs6000_abi_name, "aix"))                            \
187     {                                                                   \
188       rs6000_current_abi = ABI_AIX_NODESC;                              \
189       target_flags |= MASK_EABI;                                        \
190     }                                                                   \
191   else if (!strcmp (rs6000_abi_name, "aixdesc"))                        \
192     rs6000_current_abi = ABI_AIX;                                       \
193   else if (!strcmp (rs6000_abi_name, "freebsd"))                        \
194     rs6000_current_abi = ABI_V4;                                        \
195   else if (!strcmp (rs6000_abi_name, "linux"))                          \
196     rs6000_current_abi = ABI_V4;                                        \
197   else if (!strcmp (rs6000_abi_name, "gnu"))                            \
198     rs6000_current_abi = ABI_V4;                                        \
199   else if (!strcmp (rs6000_abi_name, "netbsd"))                         \
200     rs6000_current_abi = ABI_V4;                                        \
201   else if (!strcmp (rs6000_abi_name, "i960-old"))                       \
202     {                                                                   \
203       rs6000_current_abi = ABI_V4;                                      \
204       target_flags |= (MASK_LITTLE_ENDIAN | MASK_EABI                   \
205                        | MASK_NO_BITFIELD_WORD);                        \
206       target_flags &= ~MASK_STRICT_ALIGN;                               \
207     }                                                                   \
208   else                                                                  \
209     {                                                                   \
210       rs6000_current_abi = ABI_V4;                                      \
211       error ("bad value for -mcall-%s", rs6000_abi_name);               \
212     }                                                                   \
213                                                                         \
214   if (rs6000_sdata_name)                                                \
215     {                                                                   \
216       if (!strcmp (rs6000_sdata_name, "none"))                          \
217         rs6000_sdata = SDATA_NONE;                                      \
218       else if (!strcmp (rs6000_sdata_name, "data"))                     \
219         rs6000_sdata = SDATA_DATA;                                      \
220       else if (!strcmp (rs6000_sdata_name, "default"))                  \
221         rs6000_sdata = (TARGET_EABI) ? SDATA_EABI : SDATA_SYSV;         \
222       else if (!strcmp (rs6000_sdata_name, "sysv"))                     \
223         rs6000_sdata = SDATA_SYSV;                                      \
224       else if (!strcmp (rs6000_sdata_name, "eabi"))                     \
225         rs6000_sdata = SDATA_EABI;                                      \
226       else                                                              \
227         error ("bad value for -msdata=%s", rs6000_sdata_name);          \
228     }                                                                   \
229   else if (DEFAULT_ABI == ABI_V4)                                       \
230     {                                                                   \
231       rs6000_sdata = SDATA_DATA;                                        \
232       rs6000_sdata_name = "data";                                       \
233     }                                                                   \
234   else                                                                  \
235     {                                                                   \
236       rs6000_sdata = SDATA_NONE;                                        \
237       rs6000_sdata_name = "none";                                       \
238     }                                                                   \
239                                                                         \
240   if (TARGET_RELOCATABLE &&                                             \
241       (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV))       \
242     {                                                                   \
243       rs6000_sdata = SDATA_DATA;                                        \
244       error ("-mrelocatable and -msdata=%s are incompatible",           \
245              rs6000_sdata_name);                                        \
246     }                                                                   \
247                                                                         \
248   else if (flag_pic &&                                                  \
249            (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV))  \
250     {                                                                   \
251       rs6000_sdata = SDATA_DATA;                                        \
252       error ("-f%s and -msdata=%s are incompatible",                    \
253              (flag_pic > 1) ? "PIC" : "pic",                            \
254              rs6000_sdata_name);                                        \
255     }                                                                   \
256                                                                         \
257   if (rs6000_sdata != SDATA_NONE && DEFAULT_ABI != ABI_V4)              \
258     {                                                                   \
259       rs6000_sdata = SDATA_NONE;                                        \
260       error ("-msdata=%s and -mcall-%s are incompatible",               \
261              rs6000_sdata_name, rs6000_abi_name);                       \
262     }                                                                   \
263                                                                         \
264   targetm.have_srodata_section = rs6000_sdata == SDATA_EABI;            \
265                                                                         \
266   if (TARGET_RELOCATABLE && !TARGET_MINIMAL_TOC)                        \
267     {                                                                   \
268       target_flags |= MASK_MINIMAL_TOC;                                 \
269       error ("-mrelocatable and -mno-minimal-toc are incompatible");    \
270     }                                                                   \
271                                                                         \
272   if (TARGET_RELOCATABLE && rs6000_current_abi == ABI_AIX)              \
273     {                                                                   \
274       target_flags &= ~MASK_RELOCATABLE;                                \
275       error ("-mrelocatable and -mcall-%s are incompatible",            \
276              rs6000_abi_name);                                          \
277     }                                                                   \
278                                                                         \
279   if (flag_pic > 1 && rs6000_current_abi == ABI_AIX)                    \
280     {                                                                   \
281       flag_pic = 0;                                                     \
282       error ("-fPIC and -mcall-%s are incompatible",                    \
283              rs6000_abi_name);                                          \
284     }                                                                   \
285                                                                         \
286   if (rs6000_current_abi == ABI_AIX && TARGET_LITTLE_ENDIAN)            \
287     {                                                                   \
288       target_flags &= ~MASK_LITTLE_ENDIAN;                              \
289       error ("-mcall-aixdesc must be big endian");                      \
290     }                                                                   \
291                                                                         \
292   /* Treat -fPIC the same as -mrelocatable.  */                         \
293   if (flag_pic > 1)                                                     \
294     target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC; \
295                                                                         \
296   else if (TARGET_RELOCATABLE)                                          \
297     flag_pic = 2;                                                       \
298                                                                         \
299 } while (0)
300
301
302 /* Override rs6000.h definition.  */
303 #undef  TARGET_DEFAULT
304 #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS)
305
306 /* Override rs6000.h definition.  */
307 #undef  PROCESSOR_DEFAULT
308 #define PROCESSOR_DEFAULT PROCESSOR_PPC750
309
310 #define FIXED_R2 1
311 /* System V.4 uses register 13 as a pointer to the small data area,
312    so it is not available to the normal user.  */
313 #define FIXED_R13 1
314
315 /* Size of the V.4 varargs area if needed.  */
316 /* Override rs6000.h definition.  */
317 #undef  RS6000_VARARGS_AREA
318 #define RS6000_VARARGS_AREA ((cfun->machine->sysv_varargs_p) ? RS6000_VARARGS_SIZE : 0)
319
320 /* Override default big endianism definitions in rs6000.h.  */
321 #undef  BYTES_BIG_ENDIAN
322 #undef  WORDS_BIG_ENDIAN
323 #define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN)
324 #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN)
325
326 /* Define this to set the endianness to use in libgcc2.c, which can
327    not depend on target_flags.  */
328 #if !defined(_LITTLE_ENDIAN) && !defined(__sun__)
329 #define LIBGCC2_WORDS_BIG_ENDIAN 1
330 #else
331 #define LIBGCC2_WORDS_BIG_ENDIAN 0
332 #endif
333
334 /* Define cutoff for using external functions to save floating point.
335    Currently on V.4, always use inline stores.  */
336 #define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 64)
337
338 /* Put jump tables in read-only memory, rather than in .text.  */
339 #define JUMP_TABLES_IN_TEXT_SECTION 0
340
341 /* Prefix and suffix to use to saving floating point.  */
342 #define SAVE_FP_PREFIX "_savefpr_"
343 #define SAVE_FP_SUFFIX "_l"
344
345 /* Prefix and suffix to use to restoring floating point.  */
346 #define RESTORE_FP_PREFIX "_restfpr_"
347 #define RESTORE_FP_SUFFIX "_l"
348
349 /* Type used for ptrdiff_t, as a string used in a declaration.  */
350 #define PTRDIFF_TYPE "int"
351
352 /* Type used for wchar_t, as a string used in a declaration.  */
353 /* Override svr4.h definition.  */
354 #undef  WCHAR_TYPE
355 #define WCHAR_TYPE "long int"
356
357 /* Width of wchar_t in bits.  */
358 /* Override svr4.h definition.  */
359 #undef  WCHAR_TYPE_SIZE
360 #define WCHAR_TYPE_SIZE 32
361
362 /* Make int foo : 8 not cause structures to be aligned to an int boundary.  */
363 /* Override elfos.h definition.  */
364 #undef  PCC_BITFIELD_TYPE_MATTERS
365 #define PCC_BITFIELD_TYPE_MATTERS (TARGET_BITFIELD_TYPE)
366
367 #undef  BITFIELD_NBYTES_LIMITED
368 #define BITFIELD_NBYTES_LIMITED (TARGET_NO_BITFIELD_WORD)
369
370 /* Define this macro to be the value 1 if instructions will fail to
371    work if given data not on the nominal alignment.  If instructions
372    will merely go slower in that case, define this macro as 0.  */
373 #undef  STRICT_ALIGNMENT
374 #define STRICT_ALIGNMENT (TARGET_STRICT_ALIGN)
375
376 /* Alignment in bits of the stack boundary.  Note, in order to allow building
377    one set of libraries with -mno-eabi instead of eabi libraries and non-eabi
378    versions, just use 64 as the stack boundary.  */
379 #undef  STACK_BOUNDARY
380 #define STACK_BOUNDARY  (TARGET_ALTIVEC_ABI ? 128 : 64)
381
382 /* Real stack boundary as mandated by the appropriate ABI.  */
383 #define ABI_STACK_BOUNDARY ((TARGET_EABI && !TARGET_ALTIVEC_ABI) ? 64 : 128)
384
385 /* An expression for the alignment of a structure field FIELD if the
386    alignment computed in the usual way is COMPUTED.  */
387 #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED)                                   \
388         ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)     \
389          ? 128 : COMPUTED)
390
391 /* Define this macro as an expression for the alignment of a type
392    (given by TYPE as a tree node) if the alignment computed in the
393    usual way is COMPUTED and the alignment explicitly specified was
394    SPECIFIED.  */
395 #define ROUND_TYPE_ALIGN(TYPE, COMPUTED, SPECIFIED)                     \
396         ((TARGET_ALTIVEC  && TREE_CODE (TYPE) == VECTOR_TYPE)           \
397          ? MAX (MAX ((COMPUTED), (SPECIFIED)), 128)                     \
398          : MAX (COMPUTED, SPECIFIED))
399
400 #undef  BIGGEST_FIELD_ALIGNMENT
401
402 /* Use ELF style section commands.  */
403
404 #define TEXT_SECTION_ASM_OP     "\t.section\t\".text\""
405
406 #define DATA_SECTION_ASM_OP     "\t.section\t\".data\""
407
408 #define BSS_SECTION_ASM_OP      "\t.section\t\".bss\""
409
410 /* Override elfos.h definition.  */
411 #undef  INIT_SECTION_ASM_OP
412 #define INIT_SECTION_ASM_OP "\t.section\t\".init\",\"ax\""
413
414 /* Override elfos.h definition.  */
415 #undef  FINI_SECTION_ASM_OP
416 #define FINI_SECTION_ASM_OP "\t.section\t\".fini\",\"ax\""
417
418 #define TOC_SECTION_ASM_OP "\t.section\t\".got\",\"aw\""
419
420 /* Put PC relative got entries in .got2.  */
421 #define MINIMAL_TOC_SECTION_ASM_OP \
422   ((TARGET_RELOCATABLE || flag_pic) ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"")
423
424 #define SDATA_SECTION_ASM_OP "\t.section\t\".sdata\",\"aw\""
425 #define SDATA2_SECTION_ASM_OP "\t.section\t\".sdata2\",\"a\""
426 #define SBSS_SECTION_ASM_OP "\t.section\t\".sbss\",\"aw\",@nobits"
427
428 /* Besides the usual ELF sections, we need a toc section.  */
429 /* Override elfos.h definition.  */
430 #undef  EXTRA_SECTIONS
431 #define EXTRA_SECTIONS in_toc, in_sdata, in_sdata2, in_sbss, in_init, in_fini
432
433 /* Override elfos.h definition.  */
434 #undef  EXTRA_SECTION_FUNCTIONS
435 #define EXTRA_SECTION_FUNCTIONS                                         \
436   TOC_SECTION_FUNCTION                                                  \
437   SDATA_SECTION_FUNCTION                                                \
438   SDATA2_SECTION_FUNCTION                                               \
439   SBSS_SECTION_FUNCTION                                                 \
440   INIT_SECTION_FUNCTION                                                 \
441   FINI_SECTION_FUNCTION
442
443 #define TOC_SECTION_FUNCTION                                            \
444 void                                                                    \
445 toc_section ()                                                          \
446 {                                                                       \
447   if (in_section != in_toc)                                             \
448     {                                                                   \
449       in_section = in_toc;                                              \
450       if (DEFAULT_ABI == ABI_AIX                                        \
451           && TARGET_MINIMAL_TOC                                         \
452           && !TARGET_RELOCATABLE)                                       \
453         {                                                               \
454           if (! toc_initialized)                                        \
455             {                                                           \
456               toc_initialized = 1;                                      \
457               fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP);       \
458               ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LCTOC", 0);     \
459               fprintf (asm_out_file, "\t.tc ");                         \
460               ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1[TC],"); \
461               ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
462               fprintf (asm_out_file, "\n");                             \
463                                                                         \
464               fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
465               ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
466               fprintf (asm_out_file, " = .+32768\n");                   \
467             }                                                           \
468           else                                                          \
469             fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
470         }                                                               \
471       else if (DEFAULT_ABI == ABI_AIX && !TARGET_RELOCATABLE)           \
472         fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP);             \
473       else                                                              \
474         {                                                               \
475           fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);   \
476           if (! toc_initialized)                                        \
477             {                                                           \
478               ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
479               fprintf (asm_out_file, " = .+32768\n");                   \
480               toc_initialized = 1;                                      \
481             }                                                           \
482         }                                                               \
483     }                                                                   \
484 }                                                                       \
485                                                                         \
486 extern int in_toc_section PARAMS ((void));                              \
487 int in_toc_section ()                                                   \
488 {                                                                       \
489   return in_section == in_toc;                                          \
490 }
491
492 #define SDATA_SECTION_FUNCTION                                          \
493 void                                                                    \
494 sdata_section ()                                                        \
495 {                                                                       \
496   if (in_section != in_sdata)                                           \
497     {                                                                   \
498       in_section = in_sdata;                                            \
499       fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP);             \
500     }                                                                   \
501 }
502
503 #define SDATA2_SECTION_FUNCTION                                         \
504 void                                                                    \
505 sdata2_section ()                                                       \
506 {                                                                       \
507   if (in_section != in_sdata2)                                          \
508     {                                                                   \
509       in_section = in_sdata2;                                           \
510       fprintf (asm_out_file, "%s\n", SDATA2_SECTION_ASM_OP);            \
511     }                                                                   \
512 }
513
514 #define SBSS_SECTION_FUNCTION                                           \
515 void                                                                    \
516 sbss_section ()                                                         \
517 {                                                                       \
518   if (in_section != in_sbss)                                            \
519     {                                                                   \
520       in_section = in_sbss;                                             \
521       fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP);              \
522     }                                                                   \
523 }
524
525 #define INIT_SECTION_FUNCTION                                           \
526 void                                                                    \
527 init_section ()                                                         \
528 {                                                                       \
529   if (in_section != in_init)                                            \
530     {                                                                   \
531       in_section = in_init;                                             \
532       fprintf (asm_out_file, "%s\n", INIT_SECTION_ASM_OP);              \
533     }                                                                   \
534 }
535
536 #define FINI_SECTION_FUNCTION                                           \
537 void                                                                    \
538 fini_section ()                                                         \
539 {                                                                       \
540   if (in_section != in_fini)                                            \
541     {                                                                   \
542       in_section = in_fini;                                             \
543       fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP);              \
544     }                                                                   \
545 }
546
547 /* Override default elf definitions.  */
548 #undef  TARGET_ASM_SELECT_RTX_SECTION
549 #define TARGET_ASM_SELECT_RTX_SECTION rs6000_elf_select_rtx_section
550 #undef  TARGET_ASM_SELECT_SECTION
551 #define TARGET_ASM_SELECT_SECTION  rs6000_elf_select_section
552 #define TARGET_ASM_UNIQUE_SECTION  rs6000_elf_unique_section
553
554 /* Return nonzero if this entry is to be written into the constant pool
555    in a special way.  We do so if this is a SYMBOL_REF, LABEL_REF or a CONST
556    containing one of them.  If -mfp-in-toc (the default), we also do
557    this for floating-point constants.  We actually can only do this
558    if the FP formats of the target and host machines are the same, but
559    we can't check that since not every file that uses
560    GO_IF_LEGITIMATE_ADDRESS_P includes real.h.
561
562    Unlike AIX, we don't key off of -mminimal-toc, but instead do not
563    allow floating point constants in the TOC if -mrelocatable.  */
564
565 #undef  ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
566 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE)                        \
567   (TARGET_TOC                                                           \
568    && (GET_CODE (X) == SYMBOL_REF                                       \
569        || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS      \
570            && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF)           \
571        || GET_CODE (X) == LABEL_REF                                     \
572        || (GET_CODE (X) == CONST_INT                                    \
573            && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode))      \
574        || (!TARGET_NO_FP_IN_TOC                                         \
575            && !TARGET_RELOCATABLE                                       \
576            && GET_CODE (X) == CONST_DOUBLE                              \
577            && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT               \
578            && BITS_PER_WORD == HOST_BITS_PER_INT)))
579
580 /* These macros generate the special .type and .size directives which
581    are used to set the corresponding fields of the linker symbol table
582    entries in an ELF object file under SVR4.  These macros also output
583    the starting labels for the relevant functions/objects.  */
584
585 /* Write the extra assembler code needed to declare a function properly.
586    Some svr4 assemblers need to also have something extra said about the
587    function's return value.  We allow for that here.  */
588
589 extern int rs6000_pic_labelno;
590
591 /* Override elfos.h definition.  */
592 #undef  ASM_DECLARE_FUNCTION_NAME
593 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)                     \
594   do {                                                                  \
595     const char *const init_ptr = (TARGET_64BIT) ? ".quad" : ".long";    \
596                                                                         \
597     if (TARGET_RELOCATABLE                                              \
598         && (get_pool_size () != 0 || current_function_profile)          \
599         && uses_TOC())                                                  \
600       {                                                                 \
601         char buf[256];                                                  \
602                                                                         \
603         ASM_OUTPUT_INTERNAL_LABEL (FILE, "LCL", rs6000_pic_labelno);    \
604                                                                         \
605         ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1);                  \
606         fprintf (FILE, "\t%s ", init_ptr);                              \
607         assemble_name (FILE, buf);                                      \
608         putc ('-', FILE);                                               \
609         ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno);   \
610         assemble_name (FILE, buf);                                      \
611         putc ('\n', FILE);                                              \
612       }                                                                 \
613                                                                         \
614     ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function");                 \
615     ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL));                      \
616                                                                         \
617     if (DEFAULT_ABI == ABI_AIX)                                         \
618       {                                                                 \
619         const char *desc_name, *orig_name;                              \
620                                                                         \
621         orig_name = (*targetm.strip_name_encoding) (NAME);              \
622         desc_name = orig_name;                                          \
623         while (*desc_name == '.')                                       \
624           desc_name++;                                                  \
625                                                                         \
626         if (TREE_PUBLIC (DECL))                                         \
627           fprintf (FILE, "\t.globl %s\n", desc_name);                   \
628                                                                         \
629         fprintf (FILE, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);             \
630         fprintf (FILE, "%s:\n", desc_name);                             \
631         fprintf (FILE, "\t%s %s\n", init_ptr, orig_name);               \
632         fprintf (FILE, "\t%s _GLOBAL_OFFSET_TABLE_\n", init_ptr);       \
633         if (DEFAULT_ABI == ABI_AIX)                                     \
634           fprintf (FILE, "\t%s 0\n", init_ptr);                         \
635         fprintf (FILE, "\t.previous\n");                                \
636       }                                                                 \
637     ASM_OUTPUT_LABEL (FILE, NAME);                                      \
638   } while (0)
639
640 /* A C compound statement that outputs the assembler code for a thunk function,
641     used to implement C++ virtual function calls with multiple inheritance.  The
642     thunk acts as a wrapper around a virtual function, adjusting the implicit
643     object parameter before handing control off to the real function.
644
645     First, emit code to add the integer DELTA to the location that contains the
646     incoming first argument.  Assume that this argument contains a pointer, and
647     is the one used to pass the this' pointer in C++.  This is the incoming
648     argument *before* the function prologue, e.g. %o0' on a sparc.  The
649     addition must preserve the values of all other incoming arguments.
650
651     After the addition, emit code to jump to FUNCTION, which is a
652     FUNCTION_DECL'.  This is a direct pure jump, not a call, and does not touch
653     the return address.  Hence returning from FUNCTION will return to whoever
654     called the current thunk'.
655
656     The effect must be as if FUNCTION had been called directly with the adjusted
657     first argument.  This macro is responsible for emitting all of the code for
658     a thunk function; FUNCTION_PROLOGUE' and FUNCTION_EPILOGUE' are not
659     invoked.
660
661     The THUNK_FNDECL is redundant.  (DELTA and FUNCTION have already been
662     extracted from it.)  It might possibly be useful on some targets, but
663     probably not.
664
665     If you do not define this macro, the target-independent code in the C++
666     frontend will generate a less efficient heavyweight thunk that calls
667     FUNCTION instead of jumping to it.  The generic approach does not support
668     varargs.  */
669
670 #define TARGET_ASM_OUTPUT_MI_THUNK output_mi_thunk
671
672 /* The USER_LABEL_PREFIX stuff is affected by the -fleading-underscore
673    flag.  The LOCAL_LABEL_PREFIX variable is used by dbxelf.h.  */
674
675 #define LOCAL_LABEL_PREFIX "."
676 #define USER_LABEL_PREFIX ""
677
678 /* svr4.h overrides ASM_OUTPUT_INTERNAL_LABEL.  */
679
680 #define ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX)   \
681   asm_fprintf (FILE, "%L%s", PREFIX)
682
683 /* Globalizing directive for a label.  */
684 #define GLOBAL_ASM_OP "\t.globl "
685
686 /* This says how to output assembler code to declare an
687    uninitialized internal linkage data object.  Under SVR4,
688    the linker seems to want the alignment of data objects
689    to depend on their types.  We do exactly that here.  */
690
691 #define LOCAL_ASM_OP    "\t.local\t"
692
693 #define LCOMM_ASM_OP    "\t.lcomm\t"
694
695 /* Override elfos.h definition.  */
696 #undef  ASM_OUTPUT_ALIGNED_LOCAL
697 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN)               \
698 do {                                                                    \
699   if (rs6000_sdata != SDATA_NONE && (SIZE) > 0                          \
700       && (SIZE) <= g_switch_value)                                      \
701     {                                                                   \
702       sbss_section ();                                                  \
703       ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT));      \
704       ASM_OUTPUT_LABEL (FILE, NAME);                                    \
705       ASM_OUTPUT_SKIP (FILE, SIZE);                                     \
706       if (!flag_inhibit_size_directive && (SIZE) > 0)                   \
707         ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, SIZE);                   \
708     }                                                                   \
709   else                                                                  \
710     {                                                                   \
711       fprintf (FILE, "%s", LCOMM_ASM_OP);                               \
712       assemble_name ((FILE), (NAME));                                   \
713       fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT);    \
714     }                                                                   \
715 } while (0)
716
717 /* Describe how to emit uninitialized external linkage items.  */
718 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN)           \
719 do {                                                                    \
720   (*targetm.asm_out.globalize_label) (FILE, NAME);                      \
721   ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN);                   \
722 } while (0)
723
724 /* This is how to output code to push a register on the stack.
725    It need not be very fast code.
726
727    On the rs6000, we must keep the backchain up to date.  In order
728    to simplify things, always allocate 16 bytes for a push (System V
729    wants to keep stack aligned to a 16 byte boundary).  */
730
731 #define ASM_OUTPUT_REG_PUSH(FILE, REGNO)                                \
732 do {                                                                    \
733   if (DEFAULT_ABI == ABI_V4)                                            \
734     asm_fprintf (FILE,                                                  \
735                  "\t{stu|stwu} %s,-16(%s)\n\t{st|stw} %s,12(%s)\n",     \
736                  reg_names[1], reg_names[1], reg_names[REGNO],          \
737                  reg_names[1]);                                         \
738 } while (0)
739
740 /* This is how to output an insn to pop a register from the stack.
741    It need not be very fast code.  */
742
743 #define ASM_OUTPUT_REG_POP(FILE, REGNO)                                 \
744 do {                                                                    \
745   if (DEFAULT_ABI == ABI_V4)                                            \
746     asm_fprintf (FILE,                                                  \
747                  "\t{l|lwz} %s,12(%s)\n\t{ai|addic} %s,%s,16\n",        \
748                  reg_names[REGNO], reg_names[1], reg_names[1],          \
749                  reg_names[1]);                                         \
750 } while (0)
751
752 /* Switch  Recognition by gcc.c.  Add -G xx support.  */
753
754 /* Override svr4.h definition.  */
755 #undef  SWITCH_TAKES_ARG
756 #define SWITCH_TAKES_ARG(CHAR)                                          \
757   ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o'                      \
758    || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u'                   \
759    || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x'                   \
760    || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V'                   \
761    || (CHAR) == 'B' || (CHAR) == 'b' || (CHAR) == 'G')
762
763 /* Output .file.  */
764 /* Override elfos.h definition.  */
765 #undef  ASM_FILE_START
766 #define ASM_FILE_START(FILE)                                            \
767 do {                                                                    \
768   output_file_directive ((FILE), main_input_filename);                  \
769   rs6000_file_start (FILE, TARGET_CPU_DEFAULT);                         \
770 } while (0)
771
772
773 extern int fixuplabelno;
774
775 /* Handle constructors specially for -mrelocatable.  */
776 #define TARGET_ASM_CONSTRUCTOR  rs6000_elf_asm_out_constructor
777 #define TARGET_ASM_DESTRUCTOR   rs6000_elf_asm_out_destructor
778
779 /* This is the end of what might become sysv4.h.  */
780
781 /* Use DWARF 2 debugging information by default.  */
782 #undef  PREFERRED_DEBUGGING_TYPE
783 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
784
785 /* Historically we have also supported stabs debugging.  */
786 #define DBX_DEBUGGING_INFO 1
787
788 #define TARGET_ENCODE_SECTION_INFO  rs6000_elf_encode_section_info
789 #define TARGET_STRIP_NAME_ENCODING  rs6000_elf_strip_name_encoding
790 #define TARGET_IN_SMALL_DATA_P  rs6000_elf_in_small_data_p
791 #define TARGET_SECTION_TYPE_FLAGS  rs6000_elf_section_type_flags
792
793 /* The ELF version doesn't encode [DS] or whatever at the end of symbols.  */
794
795 #define RS6000_OUTPUT_BASENAME(FILE, NAME)      \
796     assemble_name (FILE, NAME)
797
798 /* This is how to output a reference to a user-level label named NAME.
799    `assemble_name' uses this.  */
800
801 /* Override elfos.h definition.  */
802 #undef  ASM_OUTPUT_LABELREF
803 #define ASM_OUTPUT_LABELREF(FILE,NAME)          \
804 do {                                            \
805   const char *_name = NAME;                     \
806   if (*_name == '@')                            \
807     _name++;                                    \
808                                                 \
809   if (*_name == '*')                            \
810     fprintf (FILE, "%s", _name + 1);            \
811   else                                          \
812     asm_fprintf (FILE, "%U%s", _name);          \
813 } while (0)
814
815 /* But, to make this work, we have to output the stabs for the function
816    name *first*...  */
817
818 #define DBX_FUNCTION_FIRST
819
820 /* This is the end of what might become sysv4dbx.h.  */
821
822 #ifndef TARGET_VERSION
823 #define TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)");
824 #endif
825 \f
826 #ifndef TARGET_OS_CPP_BUILTINS
827 #define TARGET_OS_CPP_BUILTINS()          \
828   do                                      \
829     {                                     \
830       builtin_define_std ("PPC");         \
831       builtin_define_std ("unix");        \
832       builtin_define ("__svr4__");        \
833       builtin_assert ("system=unix");     \
834       builtin_assert ("system=svr4");     \
835       builtin_assert ("cpu=powerpc");     \
836       builtin_assert ("machine=powerpc"); \
837     }                                     \
838   while (0)
839 #endif
840
841 /* Pass various options to the assembler.  */
842 /* Override svr4.h definition.  */
843 #undef  ASM_SPEC
844 #define ASM_SPEC "%(asm_cpu) \
845 %{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \
846 %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
847 %{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \
848 %{memb} %{!memb: %{msdata: -memb} %{msdata=eabi: -memb}} \
849 %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian} \
850 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
851     %{mcall-freebsd: -mbig} \
852     %{mcall-i960-old: -mlittle} \
853     %{mcall-linux: -mbig} \
854     %{mcall-gnu: -mbig} \
855     %{mcall-netbsd: -mbig} \
856 }}}}"
857
858 #define CC1_ENDIAN_BIG_SPEC ""
859
860 #define CC1_ENDIAN_LITTLE_SPEC "\
861 %{!mstrict-align: %{!mno-strict-align: \
862     %{!mcall-i960-old: \
863         -mstrict-align \
864     } \
865 }}"
866
867 #define CC1_ENDIAN_DEFAULT_SPEC "%(cc1_endian_big)"
868
869 /* Pass -G xxx to the compiler and set correct endian mode.  */
870 #define CC1_SPEC "%{G*} \
871 %{mlittle: %(cc1_endian_little)} %{!mlittle: %{mlittle-endian: %(cc1_endian_little)}} \
872 %{mbig: %(cc1_endian_big)} %{!mbig: %{mbig-endian: %(cc1_endian_big)}} \
873 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
874     %{mcall-aixdesc: -mbig %(cc1_endian_big) } \
875     %{mcall-freebsd: -mbig %(cc1_endian_big) } \
876     %{mcall-i960-old: -mlittle %(cc1_endian_little) } \
877     %{mcall-linux: -mbig %(cc1_endian_big) } \
878     %{mcall-gnu: -mbig %(cc1_endian_big) } \
879     %{mcall-netbsd: -mbig %(cc1_endian_big) } \
880     %{!mcall-aixdesc: %{!mcall-freebsd: %{!mcall-i960-old: %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd: \
881             %(cc1_endian_default) \
882     }}}}}} \
883 }}}} \
884 %{mno-sdata: -msdata=none } \
885 %{meabi: %{!mcall-*: -mcall-sysv }} \
886 %{!meabi: %{!mno-eabi: \
887     %{mrelocatable: -meabi } \
888     %{mcall-freebsd: -mno-eabi } \
889     %{mcall-i960-old: -meabi } \
890     %{mcall-linux: -mno-eabi } \
891     %{mcall-gnu: -mno-eabi } \
892     %{mcall-netbsd: -mno-eabi }}} \
893 %{msdata: -msdata=default} \
894 %{mno-sdata: -msdata=none} \
895 %{profile: -p}"
896
897 /* Don't put -Y P,<path> for cross compilers.  */
898 #ifndef CROSS_COMPILE
899 #define LINK_PATH_SPEC "\
900 %{!R*:%{L*:-R %*}} \
901 %{!nostdlib: %{!YP,*: \
902     %{compat-bsd: \
903         %{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
904         %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}} \
905         %{!R*: %{!L*: -R /usr/ucblib}} \
906     %{!compat-bsd: \
907         %{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
908         %{!p:-Y P,/usr/ccs/lib:/usr/lib}}}}"
909
910 #else
911 #define LINK_PATH_SPEC ""
912 #endif
913
914 /* Default starting address if specified.  */
915 #define LINK_START_SPEC "\
916 %{mads: %(link_start_ads) } \
917 %{myellowknife: %(link_start_yellowknife) } \
918 %{mmvme: %(link_start_mvme) } \
919 %{msim: %(link_start_sim) } \
920 %{mwindiss: %(link_start_windiss) } \
921 %{mcall-freebsd: %(link_start_freebsd) } \
922 %{mcall-linux: %(link_start_linux) } \
923 %{mcall-gnu: %(link_start_gnu) } \
924 %{mcall-netbsd: %(link_start_netbsd) } \
925 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
926          %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd:   \
927          %{!mcall-freebsd: %(link_start_default) }}}}}}}}}"
928
929 #define LINK_START_DEFAULT_SPEC ""
930
931 /* Override svr4.h definition.  */
932 #undef  LINK_SPEC
933 #define LINK_SPEC "\
934 %{h*} %{v:-V} %{!msdata=none:%{G*}} %{msdata=none:-G0} \
935 %{YP,*} %{R*} \
936 %{Qy:} %{!Qn:-Qy} \
937 %(link_shlib) \
938 %{!Wl,-T*: %{!T*: %(link_start) }} \
939 %(link_target) \
940 %(link_os)"
941
942 /* For now, turn off shared libraries by default.  */
943 #ifndef SHARED_LIB_SUPPORT
944 #define NO_SHARED_LIB_SUPPORT
945 #endif
946
947 #ifndef NO_SHARED_LIB_SUPPORT
948 /* Shared libraries are default.  */
949 #define LINK_SHLIB_SPEC "\
950 %{!static: %(link_path) %{!R*:%{L*:-R %*}}} \
951 %{mshlib: } \
952 %{static:-dn -Bstatic} \
953 %{shared:-G -dy -z text} \
954 %{symbolic:-Bsymbolic -G -dy -z text}"
955
956 #else
957 /* Shared libraries are not default.  */
958 #define LINK_SHLIB_SPEC "\
959 %{mshlib: %(link_path) } \
960 %{!mshlib: %{!shared: %{!symbolic: -dn -Bstatic}}} \
961 %{static: } \
962 %{shared:-G -dy -z text %(link_path) } \
963 %{symbolic:-Bsymbolic -G -dy -z text %(link_path) }"
964 #endif
965
966 /* Override the default target of the linker.  */
967 #define LINK_TARGET_SPEC "\
968 %{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } \
969 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
970     %{mcall-i960-old: --oformat elf32-powerpcle} \
971   }}}}"
972
973 /* Any specific OS flags.  */
974 #define LINK_OS_SPEC "\
975 %{mads: %(link_os_ads) } \
976 %{myellowknife: %(link_os_yellowknife) } \
977 %{mmvme: %(link_os_mvme) } \
978 %{msim: %(link_os_sim) } \
979 %{mwindiss: %(link_os_windiss) } \
980 %{mcall-freebsd: %(link_os_freebsd) } \
981 %{mcall-linux: %(link_os_linux) } \
982 %{mcall-gnu: %(link_os_gnu) } \
983 %{mcall-netbsd: %(link_os_netbsd) } \
984 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
985          %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
986          %{!mcall-netbsd: %(link_os_default) }}}}}}}}}"
987
988 #define LINK_OS_DEFAULT_SPEC ""
989
990 #define CPP_SYSV_SPEC \
991 "%{mrelocatable*: -D_RELOCATABLE} \
992 %{fpic: -D__PIC__=1 -D__pic__=1} \
993 %{!fpic: %{fPIC: -D__PIC__=2 -D__pic__=2}}"
994
995 /* Override rs6000.h definition.  */
996 #undef  CPP_SPEC
997 #define CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_sysv) \
998 %{mads: %(cpp_os_ads) } \
999 %{myellowknife: %(cpp_os_yellowknife) } \
1000 %{mmvme: %(cpp_os_mvme) } \
1001 %{msim: %(cpp_os_sim) } \
1002 %{mwindiss: %(cpp_os_windiss) } \
1003 %{mcall-freebsd: %(cpp_os_freebsd) } \
1004 %{mcall-linux: %(cpp_os_linux) } \
1005 %{mcall-gnu: %(cpp_os_gnu) } \
1006 %{mcall-netbsd: %(cpp_os_netbsd) } \
1007 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
1008          %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
1009          %{!mcall-netbsd: %(cpp_os_default) }}}}}}}}}"
1010
1011 #define CPP_OS_DEFAULT_SPEC ""
1012
1013 /* Override svr4.h definition.  */
1014 #undef  STARTFILE_SPEC
1015 #define STARTFILE_SPEC "\
1016 %{mads: %(startfile_ads) } \
1017 %{myellowknife: %(startfile_yellowknife) } \
1018 %{mmvme: %(startfile_mvme) } \
1019 %{msim: %(startfile_sim) } \
1020 %{mwindiss: %(startfile_windiss) } \
1021 %{mcall-freebsd: %(startfile_freebsd) } \
1022 %{mcall-linux: %(startfile_linux) } \
1023 %{mcall-gnu: %(startfile_gnu) } \
1024 %{mcall-netbsd: %(startfile_netbsd) } \
1025 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
1026          %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
1027          %{!mcall-netbsd: %(startfile_default) }}}}}}}}}"
1028
1029 #define STARTFILE_DEFAULT_SPEC ""
1030
1031 /* Override svr4.h definition.  */
1032 #undef  LIB_SPEC
1033 #define LIB_SPEC "\
1034 %{mads: %(lib_ads) } \
1035 %{myellowknife: %(lib_yellowknife) } \
1036 %{mmvme: %(lib_mvme) } \
1037 %{msim: %(lib_sim) } \
1038 %{mwindiss: %(lib_windiss) } \
1039 %{mcall-freebsd: %(lib_freebsd) } \
1040 %{mcall-linux: %(lib_linux) } \
1041 %{mcall-gnu: %(lib_gnu) } \
1042 %{mcall-netbsd: %(lib_netbsd) } \
1043 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
1044          %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
1045          %{!mcall-netbsd: %(lib_default) }}}}}}}}}"
1046
1047 #define LIB_DEFAULT_SPEC ""
1048
1049 /* Override svr4.h definition.  */
1050 #undef  ENDFILE_SPEC
1051 #define ENDFILE_SPEC "\
1052 %{mads: crtsavres.o%s %(endfile_ads)} \
1053 %{myellowknife: crtsavres.o%s %(endfile_yellowknife)} \
1054 %{mmvme: crtsavres.o%s %(endfile_mvme)} \
1055 %{msim: crtsavres.o%s %(endfile_sim)} \
1056 %{mwindiss: %(endfile_windiss)} \
1057 %{mcall-freebsd: crtsavres.o%s %(endfile_freebsd) } \
1058 %{mcall-linux: crtsavres.o%s %(endfile_linux) } \
1059 %{mcall-gnu: crtsavres.o%s %(endfile_gnu) } \
1060 %{mcall-netbsd: crtsavres.o%s %(endfile_netbsd) } \
1061 %{mvxworks: crtsavres.o%s %(endfile_vxworks) } \
1062 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
1063          %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
1064          %{!mcall-netbsd: %{!mvxworks: %(crtsavres_default) \
1065                                        %(endfile_default) }}}}}}}}}}"
1066
1067 #define CRTSAVRES_DEFAULT_SPEC "crtsavres.o%s"
1068
1069 #define ENDFILE_DEFAULT_SPEC ""
1070
1071 /* Motorola ADS support.  */
1072 #define LIB_ADS_SPEC "--start-group -lads -lc --end-group"
1073
1074 #define STARTFILE_ADS_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
1075
1076 #define ENDFILE_ADS_SPEC "crtend.o%s ecrtn.o%s"
1077
1078 #define LINK_START_ADS_SPEC "-T ads.ld%s"
1079
1080 #define LINK_OS_ADS_SPEC ""
1081
1082 #define CPP_OS_ADS_SPEC ""
1083
1084 /* Motorola Yellowknife support.  */
1085 #define LIB_YELLOWKNIFE_SPEC "--start-group -lyk -lc --end-group"
1086
1087 #define STARTFILE_YELLOWKNIFE_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
1088
1089 #define ENDFILE_YELLOWKNIFE_SPEC "crtend.o%s ecrtn.o%s"
1090
1091 #define LINK_START_YELLOWKNIFE_SPEC "-T yellowknife.ld%s"
1092
1093 #define LINK_OS_YELLOWKNIFE_SPEC ""
1094
1095 #define CPP_OS_YELLOWKNIFE_SPEC ""
1096
1097 /* Motorola MVME support.  */
1098 #define LIB_MVME_SPEC "--start-group -lmvme -lc --end-group"
1099
1100 #define STARTFILE_MVME_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
1101
1102 #define ENDFILE_MVME_SPEC "crtend.o%s ecrtn.o%s"
1103
1104 #define LINK_START_MVME_SPEC "-Ttext 0x40000"
1105
1106 #define LINK_OS_MVME_SPEC ""
1107
1108 #define CPP_OS_MVME_SPEC ""
1109
1110 /* PowerPC simulator based on netbsd system calls support.  */
1111 #define LIB_SIM_SPEC "--start-group -lsim -lc --end-group"
1112
1113 #define STARTFILE_SIM_SPEC "ecrti.o%s sim-crt0.o%s crtbegin.o%s"
1114
1115 #define ENDFILE_SIM_SPEC "crtend.o%s ecrtn.o%s"
1116
1117 #define LINK_START_SIM_SPEC ""
1118
1119 #define LINK_OS_SIM_SPEC "-m elf32ppcsim"
1120
1121 #define CPP_OS_SIM_SPEC ""
1122
1123 /* FreeBSD support.  */
1124
1125 #define CPP_OS_FREEBSD_SPEC     "\
1126   -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ \
1127   -Acpu=powerpc -Amachine=powerpc"
1128
1129 #define STARTFILE_FREEBSD_SPEC  FBSD_STARTFILE_SPEC
1130 #define ENDFILE_FREEBSD_SPEC    FBSD_ENDFILE_SPEC
1131 #define LIB_FREEBSD_SPEC        FBSD_LIB_SPEC
1132 #define LINK_START_FREEBSD_SPEC ""
1133
1134 #define LINK_OS_FREEBSD_SPEC "\
1135   %{symbolic:-Bsymbolic}"
1136
1137 /* GNU/Linux support.  */
1138 #ifdef USE_GNULIBC_1
1139 #define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
1140 %{!mnewlib: -lc }"
1141 #else
1142 #define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
1143 %{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } \
1144 %{profile:-lc_p} %{!profile:-lc}}}"
1145 #endif
1146
1147 #ifdef USE_GNULIBC_1
1148 #define STARTFILE_LINUX_SPEC "\
1149 %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
1150 %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \
1151 %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
1152 #else
1153 #define STARTFILE_LINUX_SPEC "\
1154 %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
1155 %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \
1156 %{static:crtbeginT.o%s} \
1157 %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
1158 #endif
1159
1160 #define ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
1161 %{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}"
1162
1163 #define LINK_START_LINUX_SPEC ""
1164
1165 #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
1166   %{rdynamic:-export-dynamic} \
1167   %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
1168
1169 #if !defined(USE_GNULIBC_1) && defined(HAVE_LD_EH_FRAME_HDR)
1170 # define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
1171 #endif
1172
1173 #ifdef USE_GNULIBC_1
1174 #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
1175 %{!undef:                                                         \
1176   %{!ansi:                                                        \
1177     %{!std=*:-Dunix -D__unix -Dlinux -D__linux}                   \
1178     %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}}               \
1179 -Asystem=unix -Asystem=posix"
1180 #else
1181 #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
1182 %{!undef:                                                         \
1183   %{!ansi:                                                        \
1184     %{!std=*:-Dunix -D__unix -Dlinux -D__linux}                   \
1185     %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}}               \
1186 -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
1187 #endif
1188
1189 /* GNU/Hurd support.  */
1190 #define LIB_GNU_SPEC "%{mnewlib: --start-group -lgnu -lc --end-group } \
1191 %{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } \
1192 %{profile:-lc_p} %{!profile:-lc}}}"
1193
1194 #define STARTFILE_GNU_SPEC "\
1195 %{!shared: %{!static: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}} \
1196 %{static: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} \
1197 %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \
1198 %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
1199
1200 #define ENDFILE_GNU_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
1201 %{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}"
1202
1203 #define LINK_START_GNU_SPEC ""
1204
1205 #define LINK_OS_GNU_SPEC "-m elf32ppclinux %{!shared: %{!static: \
1206   %{rdynamic:-export-dynamic} \
1207   %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
1208
1209 #define CPP_OS_GNU_SPEC "-D__unix__ -D__gnu_hurd__ -D__GNU__    \
1210 %{!undef:                                                       \
1211   %{!ansi: -Dunix -D__unix}}                                    \
1212 -Asystem=gnu -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
1213
1214 /* NetBSD support.  */
1215 #define LIB_NETBSD_SPEC "\
1216 %{profile:-lgmon -lc_p} %{!profile:-lc}"
1217
1218 #define STARTFILE_NETBSD_SPEC "\
1219 ncrti.o%s crt0.o%s \
1220 %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
1221
1222 #define ENDFILE_NETBSD_SPEC "\
1223 %{!shared:crtend.o%s} %{shared:crtendS.o%s} \
1224 ncrtn.o%s"
1225
1226 #define LINK_START_NETBSD_SPEC "\
1227 "
1228
1229 #define LINK_OS_NETBSD_SPEC "\
1230 %{!shared: %{!static: \
1231   %{rdynamic:-export-dynamic} \
1232   %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}}}"
1233
1234 #define CPP_OS_NETBSD_SPEC "\
1235 -D__powerpc__ -D__NetBSD__ -D__ELF__ -D__KPRINTF_ATTRIBUTE__"
1236
1237 /* VxWorks support.  */
1238 /* VxWorks does all the library stuff itself.  */
1239 #define LIB_VXWORKS_SPEC ""
1240
1241 /* VxWorks provides the functionality of crt0.o and friends itself.  */
1242
1243 #define STARTFILE_VXWORKS_SPEC ""
1244
1245 #define ENDFILE_VXWORKS_SPEC ""
1246
1247 /* Because it uses ld -r, vxworks has no start/end files, nor starting
1248    address.  */
1249
1250 #define LINK_START_VXWORKS_SPEC ""
1251
1252 #define LINK_OS_VXWORKS_SPEC "-r"
1253
1254 #define CPP_OS_VXWORKS_SPEC "\
1255 -DCPU_FAMILY=PPC \
1256 %{!mcpu*: \
1257   %{mpowerpc*: -DCPU=PPC603} \
1258   %{!mno-powerpc: -DCPU=PPC603}} \
1259 %{mcpu=powerpc: -DCPU=PPC603} \
1260 %{mcpu=401: -DCPU=PPC403} \
1261 %{mcpu=403: -DCPU=PPC403} \
1262 %{mcpu=405: -DCPU=PPC405} \
1263 %{mcpu=601: -DCPU=PPC601} \
1264 %{mcpu=602: -DCPU=PPC603} \
1265 %{mcpu=603: -DCPU=PPC603} \
1266 %{mcpu=603e: -DCPU=PPC603} \
1267 %{mcpu=ec603e: -DCPU=PPC603} \
1268 %{mcpu=604: -DCPU=PPC604} \
1269 %{mcpu=604e: -DCPU=PPC604} \
1270 %{mcpu=620: -DCPU=PPC604} \
1271 %{mcpu=740: -DCPU=PPC603} \
1272 %{mcpu=7450: -DCPU=PPC603} \
1273 %{mcpu=750: -DCPU=PPC603} \
1274 %{mcpu=801: -DCPU=PPC603} \
1275 %{mcpu=821: -DCPU=PPC603} \
1276 %{mcpu=823: -DCPU=PPC603} \
1277 %{mcpu=860: -DCPU=PPC603}"
1278
1279 /* WindISS support.  */
1280
1281 #define LIB_WINDISS_SPEC "--start-group -li -lcfp -lwindiss -lram -limpl -limpfp --end-group"
1282
1283 #define CPP_OS_WINDISS_SPEC "\
1284 -D__rtasim \
1285 -D__EABI__ \
1286 -D__ppc \
1287 %{!msoft-float: -D__hardfp} \
1288 "
1289
1290 #define STARTFILE_WINDISS_SPEC "crt0.o%s crtbegin.o%s"
1291
1292 #define ENDFILE_WINDISS_SPEC "crtend.o%s"
1293
1294 #define LINK_START_WINDISS_SPEC ""
1295
1296 #define LINK_OS_WINDISS_SPEC ""
1297
1298 /* Define any extra SPECS that the compiler needs to generate.  */
1299 /* Override rs6000.h definition.  */
1300 #undef  SUBTARGET_EXTRA_SPECS
1301 #define SUBTARGET_EXTRA_SPECS                                           \
1302   { "cpp_sysv",                 CPP_SYSV_SPEC },                        \
1303   { "crtsavres_default",        CRTSAVRES_DEFAULT_SPEC },              \
1304   { "lib_ads",                  LIB_ADS_SPEC },                         \
1305   { "lib_yellowknife",          LIB_YELLOWKNIFE_SPEC },                 \
1306   { "lib_mvme",                 LIB_MVME_SPEC },                        \
1307   { "lib_sim",                  LIB_SIM_SPEC },                         \
1308   { "lib_freebsd",              LIB_FREEBSD_SPEC },                     \
1309   { "lib_gnu",                  LIB_GNU_SPEC },                         \
1310   { "lib_linux",                LIB_LINUX_SPEC },                       \
1311   { "lib_netbsd",               LIB_NETBSD_SPEC },                      \
1312   { "lib_vxworks",              LIB_VXWORKS_SPEC },                     \
1313   { "lib_windiss",              LIB_WINDISS_SPEC },                     \
1314   { "lib_default",              LIB_DEFAULT_SPEC },                     \
1315   { "startfile_ads",            STARTFILE_ADS_SPEC },                   \
1316   { "startfile_yellowknife",    STARTFILE_YELLOWKNIFE_SPEC },           \
1317   { "startfile_mvme",           STARTFILE_MVME_SPEC },                  \
1318   { "startfile_sim",            STARTFILE_SIM_SPEC },                   \
1319   { "startfile_freebsd",        STARTFILE_FREEBSD_SPEC },               \
1320   { "startfile_gnu",            STARTFILE_GNU_SPEC },                   \
1321   { "startfile_linux",          STARTFILE_LINUX_SPEC },                 \
1322   { "startfile_netbsd",         STARTFILE_NETBSD_SPEC },                \
1323   { "startfile_vxworks",        STARTFILE_VXWORKS_SPEC },               \
1324   { "startfile_windiss",        STARTFILE_WINDISS_SPEC },               \
1325   { "startfile_default",        STARTFILE_DEFAULT_SPEC },               \
1326   { "endfile_ads",              ENDFILE_ADS_SPEC },                     \
1327   { "endfile_yellowknife",      ENDFILE_YELLOWKNIFE_SPEC },             \
1328   { "endfile_mvme",             ENDFILE_MVME_SPEC },                    \
1329   { "endfile_sim",              ENDFILE_SIM_SPEC },                     \
1330   { "endfile_freebsd",          ENDFILE_FREEBSD_SPEC },                 \
1331   { "endfile_gnu",              ENDFILE_GNU_SPEC },                     \
1332   { "endfile_linux",            ENDFILE_LINUX_SPEC },                   \
1333   { "endfile_netbsd",           ENDFILE_NETBSD_SPEC },                  \
1334   { "endfile_vxworks",          ENDFILE_VXWORKS_SPEC },                 \
1335   { "endfile_windiss",          ENDFILE_WINDISS_SPEC },                 \
1336   { "endfile_default",          ENDFILE_DEFAULT_SPEC },                 \
1337   { "link_path",                LINK_PATH_SPEC },                       \
1338   { "link_shlib",               LINK_SHLIB_SPEC },                      \
1339   { "link_target",              LINK_TARGET_SPEC },                     \
1340   { "link_start",               LINK_START_SPEC },                      \
1341   { "link_start_ads",           LINK_START_ADS_SPEC },                  \
1342   { "link_start_yellowknife",   LINK_START_YELLOWKNIFE_SPEC },          \
1343   { "link_start_mvme",          LINK_START_MVME_SPEC },                 \
1344   { "link_start_sim",           LINK_START_SIM_SPEC },                  \
1345   { "link_start_freebsd",       LINK_START_FREEBSD_SPEC },              \
1346   { "link_start_gnu",           LINK_START_GNU_SPEC },                  \
1347   { "link_start_linux",         LINK_START_LINUX_SPEC },                \
1348   { "link_start_netbsd",        LINK_START_NETBSD_SPEC },               \
1349   { "link_start_vxworks",       LINK_START_VXWORKS_SPEC },              \
1350   { "link_start_windiss",       LINK_START_WINDISS_SPEC },              \
1351   { "link_start_default",       LINK_START_DEFAULT_SPEC },              \
1352   { "link_os",                  LINK_OS_SPEC },                         \
1353   { "link_os_ads",              LINK_OS_ADS_SPEC },                     \
1354   { "link_os_yellowknife",      LINK_OS_YELLOWKNIFE_SPEC },             \
1355   { "link_os_mvme",             LINK_OS_MVME_SPEC },                    \
1356   { "link_os_sim",              LINK_OS_SIM_SPEC },                     \
1357   { "link_os_freebsd",          LINK_OS_FREEBSD_SPEC },                 \
1358   { "link_os_linux",            LINK_OS_LINUX_SPEC },                   \
1359   { "link_os_gnu",              LINK_OS_GNU_SPEC },                     \
1360   { "link_os_netbsd",           LINK_OS_NETBSD_SPEC },                  \
1361   { "link_os_vxworks",          LINK_OS_VXWORKS_SPEC },                 \
1362   { "link_os_windiss",          LINK_OS_WINDISS_SPEC },                 \
1363   { "link_os_default",          LINK_OS_DEFAULT_SPEC },                 \
1364   { "cc1_endian_big",           CC1_ENDIAN_BIG_SPEC },                  \
1365   { "cc1_endian_little",        CC1_ENDIAN_LITTLE_SPEC },               \
1366   { "cc1_endian_default",       CC1_ENDIAN_DEFAULT_SPEC },              \
1367   { "cpp_os_ads",               CPP_OS_ADS_SPEC },                      \
1368   { "cpp_os_yellowknife",       CPP_OS_YELLOWKNIFE_SPEC },              \
1369   { "cpp_os_mvme",              CPP_OS_MVME_SPEC },                     \
1370   { "cpp_os_sim",               CPP_OS_SIM_SPEC },                      \
1371   { "cpp_os_freebsd",           CPP_OS_FREEBSD_SPEC },                  \
1372   { "cpp_os_gnu",               CPP_OS_GNU_SPEC },                      \
1373   { "cpp_os_linux",             CPP_OS_LINUX_SPEC },                    \
1374   { "cpp_os_netbsd",            CPP_OS_NETBSD_SPEC },                   \
1375   { "cpp_os_vxworks",           CPP_OS_VXWORKS_SPEC },                  \
1376   { "cpp_os_windiss",           CPP_OS_WINDISS_SPEC },                  \
1377   { "cpp_os_default",           CPP_OS_DEFAULT_SPEC },
1378
1379 /* Define this macro as a C expression for the initializer of an
1380    array of string to tell the driver program which options are
1381    defaults for this target and thus do not need to be handled
1382    specially when using `MULTILIB_OPTIONS'.
1383
1384    Do not define this macro if `MULTILIB_OPTIONS' is not defined in
1385    the target makefile fragment or if none of the options listed in
1386    `MULTILIB_OPTIONS' are set by default.  *Note Target Fragment::.  */
1387
1388 #define MULTILIB_DEFAULTS { "mbig", "mcall-sysv" }
1389
1390 /* Define this macro if the code for function profiling should come
1391    before the function prologue.  Normally, the profiling code comes
1392    after.  */
1393 #define PROFILE_BEFORE_PROLOGUE 1
1394
1395 /* Function name to call to do profiling.  */
1396 #define RS6000_MCOUNT "_mcount"
1397
1398 /* Define this macro (to a value of 1) if you want to support the
1399    Win32 style pragmas #pragma pack(push,<n>)' and #pragma
1400    pack(pop)'.  The pack(push,<n>) pragma specifies the maximum
1401    alignment (in bytes) of fields within a structure, in much the
1402    same way as the __aligned__' and __packed__' __attribute__'s
1403    do.  A pack value of zero resets the behavior to the default.
1404    Successive invocations of this pragma cause the previous values to
1405    be stacked, so that invocations of #pragma pack(pop)' will return
1406    to the previous value.  */
1407
1408 #define HANDLE_PRAGMA_PACK_PUSH_POP 1
1409
1410 /* Define library calls for quad FP operations.  These are all part of the
1411    PowerPC 32bit ABI.  */
1412 #define ADDTF3_LIBCALL "_q_add"
1413 #define DIVTF3_LIBCALL "_q_div"
1414 #define EXTENDDFTF2_LIBCALL "_q_dtoq"
1415 #define EQTF2_LIBCALL "_q_feq"
1416 #define GETF2_LIBCALL "_q_fge"
1417 #define GTTF2_LIBCALL "_q_fgt"
1418 #define LETF2_LIBCALL "_q_fle"
1419 #define LTTF2_LIBCALL "_q_flt"
1420 #define NETF2_LIBCALL "_q_fne"
1421 #define FLOATSITF2_LIBCALL "_q_itoq"
1422 #define MULTF3_LIBCALL "_q_mul"
1423 #define NEGTF2_LIBCALL "_q_neg"
1424 #define TRUNCTFDF2_LIBCALL "_q_qtod"
1425 #define FIX_TRUNCTFSI2_LIBCALL "_q_qtoi"
1426 #define TRUNCTFSF2_LIBCALL "_q_qtos"
1427 #define FIXUNS_TRUNCTFSI2_LIBCALL "_q_qtou"
1428 #define SQRTTF_LIBCALL "_q_sqrt"
1429 #define EXTENDSFTF2_LIBCALL "_q_stoq"
1430 #define SUBTF3_LIBCALL "_q_sub"
1431 #define FLOATUNSSITF2_LIBCALL "_q_utoq"
1432
1433 #define INIT_TARGET_OPTABS                                              \
1434   do {                                                                  \
1435     if (TARGET_HARD_FLOAT)                                              \
1436       {                                                                 \
1437         add_optab->handlers[(int) TFmode].libfunc                       \
1438           = init_one_libfunc (ADDTF3_LIBCALL);                          \
1439         sub_optab->handlers[(int) TFmode].libfunc                       \
1440           = init_one_libfunc (SUBTF3_LIBCALL);                          \
1441         neg_optab->handlers[(int) TFmode].libfunc                       \
1442           = init_one_libfunc (NEGTF2_LIBCALL);                          \
1443         smul_optab->handlers[(int) TFmode].libfunc                      \
1444           = init_one_libfunc (MULTF3_LIBCALL);                          \
1445         sdiv_optab->handlers[(int) TFmode].libfunc                      \
1446           = init_one_libfunc (DIVTF3_LIBCALL);                          \
1447         eqtf2_libfunc = init_one_libfunc (EQTF2_LIBCALL);               \
1448         netf2_libfunc = init_one_libfunc (NETF2_LIBCALL);               \
1449         gttf2_libfunc = init_one_libfunc (GTTF2_LIBCALL);               \
1450         getf2_libfunc = init_one_libfunc (GETF2_LIBCALL);               \
1451         lttf2_libfunc = init_one_libfunc (LTTF2_LIBCALL);               \
1452         letf2_libfunc = init_one_libfunc (LETF2_LIBCALL);               \
1453         trunctfsf2_libfunc = init_one_libfunc (TRUNCTFSF2_LIBCALL);     \
1454         trunctfdf2_libfunc = init_one_libfunc (TRUNCTFDF2_LIBCALL);     \
1455         extendsftf2_libfunc = init_one_libfunc (EXTENDSFTF2_LIBCALL);   \
1456         extenddftf2_libfunc = init_one_libfunc (EXTENDDFTF2_LIBCALL);   \
1457         floatsitf_libfunc = init_one_libfunc (FLOATSITF2_LIBCALL);      \
1458         fixtfsi_libfunc = init_one_libfunc (FIX_TRUNCTFSI2_LIBCALL);    \
1459         fixunstfsi_libfunc                                              \
1460           = init_one_libfunc (FIXUNS_TRUNCTFSI2_LIBCALL);               \
1461         if (TARGET_PPC_GPOPT || TARGET_POWER2)                          \
1462           sqrt_optab->handlers[(int) TFmode].libfunc                    \
1463             = init_one_libfunc (SQRTTF_LIBCALL);                        \
1464       }                                                                 \
1465   } while (0)
1466
1467 /* Select a format to encode pointers in exception handling data.  CODE
1468    is 0 for data, 1 for code labels, 2 for function pointers.  GLOBAL is
1469    true if the symbol may be affected by dynamic relocations.  */
1470 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)                            \
1471   ((flag_pic || TARGET_RELOCATABLE)                                          \
1472    ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
1473    : DW_EH_PE_absptr)
1474
1475 #define TARGET_ASM_EXCEPTION_SECTION readonly_data_section
1476
1477 #define DOUBLE_INT_ASM_OP "\t.quad\t"
1478
1479 /* Generate entries in .fixup for relocatable addresses.  */
1480 #define RELOCATABLE_NEEDS_FIXUP