OSDN Git Service

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