OSDN Git Service

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