OSDN Git Service

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