OSDN Git Service

4fda7fd06e3e392076f97dc6a9e7e0d23a2391f9
[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, 2003,
3    2004, 2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
4    Contributed by Cygnus Support.
5
6    This file is part of GCC.
7
8    GCC is free software; you can redistribute it and/or modify it
9    under the terms of the GNU General Public License as published
10    by the Free Software Foundation; either version 3, or (at your
11    option) any later version.
12
13    GCC is distributed in the hope that it will be useful, but WITHOUT
14    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
16    License for more details.
17
18    Under Section 7 of GPL version 3, you are granted additional
19    permissions described in the GCC Runtime Library Exception, version
20    3.1, as published by the Free Software Foundation.
21
22    You should have received a copy of the GNU General Public License and
23    a copy of the GCC Runtime Library Exception along with this program;
24    see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
25    <http://www.gnu.org/licenses/>.  */
26
27 /* Header files should be C++ aware in general.  */
28 #undef  NO_IMPLICIT_EXTERN_C
29 #define NO_IMPLICIT_EXTERN_C
30
31 /* Yes!  We are ELF.  */
32 #define TARGET_OBJECT_FORMAT OBJECT_ELF
33
34 /* Default ABI to compile code for.  */
35 #define DEFAULT_ABI rs6000_current_abi
36
37 /* Default ABI to use.  */
38 #define RS6000_ABI_NAME "sysv"
39
40 /* Override rs6000.h definition.  */
41 #undef  ASM_DEFAULT_SPEC
42 #define ASM_DEFAULT_SPEC "-mppc"
43
44 /* Small data support types.  */
45 enum rs6000_sdata_type {
46   SDATA_NONE,                   /* No small data support.  */
47   SDATA_DATA,                   /* Just put data in .sbss/.sdata, don't use relocs.  */
48   SDATA_SYSV,                   /* Use r13 to point to .sdata/.sbss.  */
49   SDATA_EABI                    /* Use r13 like above, r2 points to .sdata2/.sbss2.  */
50 };
51
52 extern enum rs6000_sdata_type rs6000_sdata;
53
54 #define TARGET_TOC              ((target_flags & MASK_64BIT)            \
55                                  || ((target_flags & (MASK_RELOCATABLE  \
56                                                       | MASK_MINIMAL_TOC)) \
57                                      && flag_pic > 1)                   \
58                                  || DEFAULT_ABI == ABI_AIX)
59
60 #define TARGET_BITFIELD_TYPE    (! TARGET_NO_BITFIELD_TYPE)
61 #define TARGET_BIG_ENDIAN       (! TARGET_LITTLE_ENDIAN)
62 #define TARGET_PROTOTYPE        target_prototype
63 #define TARGET_NO_PROTOTYPE     (! TARGET_PROTOTYPE)
64 #define TARGET_NO_TOC           (! TARGET_TOC)
65 #define TARGET_NO_EABI          (! TARGET_EABI)
66 #define TARGET_REGNAMES         rs6000_regnames
67
68 #ifdef HAVE_AS_REL16
69 #undef TARGET_SECURE_PLT
70 #define TARGET_SECURE_PLT       secure_plt
71 #endif
72
73 extern const char *rs6000_abi_name;
74 extern const char *rs6000_sdata_name;
75 extern const char *rs6000_tls_size_string; /* For -mtls-size= */
76
77 #define SDATA_DEFAULT_SIZE 8
78
79 /* The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to
80    get control in TARGET_OPTION_OVERRIDE.  */
81
82 #define SUBTARGET_OVERRIDE_OPTIONS                                      \
83 do {                                                                    \
84   if (!global_options_set.x_g_switch_value)                             \
85     g_switch_value = SDATA_DEFAULT_SIZE;                                \
86                                                                         \
87   if (rs6000_abi_name == NULL)                                          \
88     rs6000_abi_name = RS6000_ABI_NAME;                                  \
89                                                                         \
90   if (!strcmp (rs6000_abi_name, "sysv"))                                \
91     rs6000_current_abi = ABI_V4;                                        \
92   else if (!strcmp (rs6000_abi_name, "sysv-noeabi"))                    \
93     {                                                                   \
94       rs6000_current_abi = ABI_V4;                                      \
95       target_flags &= ~ MASK_EABI;                                      \
96     }                                                                   \
97   else if (!strcmp (rs6000_abi_name, "sysv-eabi")                       \
98            || !strcmp (rs6000_abi_name, "eabi"))                        \
99     {                                                                   \
100       rs6000_current_abi = ABI_V4;                                      \
101       target_flags |= MASK_EABI;                                        \
102     }                                                                   \
103   else if (!strcmp (rs6000_abi_name, "aixdesc"))                        \
104     rs6000_current_abi = ABI_AIX;                                       \
105   else if (!strcmp (rs6000_abi_name, "freebsd"))                        \
106     rs6000_current_abi = ABI_V4;                                        \
107   else if (!strcmp (rs6000_abi_name, "linux"))                          \
108     {                                                                   \
109       if (TARGET_64BIT)                                                 \
110         rs6000_current_abi = ABI_AIX;                                   \
111       else                                                              \
112         rs6000_current_abi = ABI_V4;                                    \
113     }                                                                   \
114   else if (!strcmp (rs6000_abi_name, "gnu"))                            \
115     rs6000_current_abi = ABI_V4;                                        \
116   else if (!strcmp (rs6000_abi_name, "netbsd"))                         \
117     rs6000_current_abi = ABI_V4;                                        \
118   else if (!strcmp (rs6000_abi_name, "openbsd"))                        \
119     rs6000_current_abi = ABI_V4;                                        \
120   else if (!strcmp (rs6000_abi_name, "i960-old"))                       \
121     {                                                                   \
122       rs6000_current_abi = ABI_V4;                                      \
123       target_flags |= (MASK_LITTLE_ENDIAN | MASK_EABI);                 \
124       target_flags &= ~MASK_STRICT_ALIGN;                               \
125       TARGET_NO_BITFIELD_WORD = 1;                                      \
126     }                                                                   \
127   else                                                                  \
128     {                                                                   \
129       rs6000_current_abi = ABI_V4;                                      \
130       error ("bad value for -mcall-%s", rs6000_abi_name);               \
131     }                                                                   \
132                                                                         \
133   if (rs6000_sdata_name)                                                \
134     {                                                                   \
135       if (!strcmp (rs6000_sdata_name, "none"))                          \
136         rs6000_sdata = SDATA_NONE;                                      \
137       else if (!strcmp (rs6000_sdata_name, "data"))                     \
138         rs6000_sdata = SDATA_DATA;                                      \
139       else if (!strcmp (rs6000_sdata_name, "default"))                  \
140         rs6000_sdata = (TARGET_EABI) ? SDATA_EABI : SDATA_SYSV;         \
141       else if (!strcmp (rs6000_sdata_name, "sysv"))                     \
142         rs6000_sdata = SDATA_SYSV;                                      \
143       else if (!strcmp (rs6000_sdata_name, "eabi"))                     \
144         rs6000_sdata = SDATA_EABI;                                      \
145       else                                                              \
146         error ("bad value for -msdata=%s", rs6000_sdata_name);          \
147     }                                                                   \
148   else if (DEFAULT_ABI == ABI_V4)                                       \
149     {                                                                   \
150       rs6000_sdata = SDATA_DATA;                                        \
151       rs6000_sdata_name = "data";                                       \
152     }                                                                   \
153   else                                                                  \
154     {                                                                   \
155       rs6000_sdata = SDATA_NONE;                                        \
156       rs6000_sdata_name = "none";                                       \
157     }                                                                   \
158                                                                         \
159   if (TARGET_RELOCATABLE &&                                             \
160       (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV))       \
161     {                                                                   \
162       rs6000_sdata = SDATA_DATA;                                        \
163       error ("-mrelocatable and -msdata=%s are incompatible",           \
164              rs6000_sdata_name);                                        \
165     }                                                                   \
166                                                                         \
167   else if (flag_pic && DEFAULT_ABI != ABI_AIX                           \
168            && (rs6000_sdata == SDATA_EABI                               \
169                || rs6000_sdata == SDATA_SYSV))                          \
170     {                                                                   \
171       rs6000_sdata = SDATA_DATA;                                        \
172       error ("-f%s and -msdata=%s are incompatible",                    \
173              (flag_pic > 1) ? "PIC" : "pic",                            \
174              rs6000_sdata_name);                                        \
175     }                                                                   \
176                                                                         \
177   if ((rs6000_sdata != SDATA_NONE && DEFAULT_ABI != ABI_V4)             \
178       || (rs6000_sdata == SDATA_EABI && !TARGET_EABI))                  \
179     {                                                                   \
180       rs6000_sdata = SDATA_NONE;                                        \
181       error ("-msdata=%s and -mcall-%s are incompatible",               \
182              rs6000_sdata_name, rs6000_abi_name);                       \
183     }                                                                   \
184                                                                         \
185   targetm.have_srodata_section = rs6000_sdata == SDATA_EABI;            \
186                                                                         \
187   if (TARGET_RELOCATABLE && !TARGET_MINIMAL_TOC)                        \
188     {                                                                   \
189       target_flags |= MASK_MINIMAL_TOC;                                 \
190       error ("-mrelocatable and -mno-minimal-toc are incompatible");    \
191     }                                                                   \
192                                                                         \
193   if (TARGET_RELOCATABLE && rs6000_current_abi == ABI_AIX)              \
194     {                                                                   \
195       target_flags &= ~MASK_RELOCATABLE;                                \
196       error ("-mrelocatable and -mcall-%s are incompatible",            \
197              rs6000_abi_name);                                          \
198     }                                                                   \
199                                                                         \
200   if (!TARGET_64BIT && flag_pic > 1 && rs6000_current_abi == ABI_AIX)   \
201     {                                                                   \
202       flag_pic = 0;                                                     \
203       error ("-fPIC and -mcall-%s are incompatible",                    \
204              rs6000_abi_name);                                          \
205     }                                                                   \
206                                                                         \
207   if (rs6000_current_abi == ABI_AIX && TARGET_LITTLE_ENDIAN)            \
208     {                                                                   \
209       target_flags &= ~MASK_LITTLE_ENDIAN;                              \
210       error ("-mcall-aixdesc must be big endian");                      \
211     }                                                                   \
212                                                                         \
213   if (TARGET_SECURE_PLT != secure_plt)                                  \
214     {                                                                   \
215       error ("-msecure-plt not supported by your assembler");           \
216     }                                                                   \
217                                                                         \
218   /* Treat -fPIC the same as -mrelocatable.  */                         \
219   if (flag_pic > 1 && DEFAULT_ABI != ABI_AIX)                           \
220     {                                                                   \
221       target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC;              \
222       TARGET_NO_FP_IN_TOC = 1;                                          \
223     }                                                                   \
224                                                                         \
225   else if (TARGET_RELOCATABLE)                                          \
226     flag_pic = 2;                                                       \
227 } while (0)
228
229 #ifndef RS6000_BI_ARCH
230 # define SUBSUBTARGET_OVERRIDE_OPTIONS                                  \
231 do {                                                                    \
232   if ((TARGET_DEFAULT ^ target_flags) & MASK_64BIT)                     \
233     error ("-m%s not supported in this configuration",                  \
234            (target_flags & MASK_64BIT) ? "64" : "32");                  \
235 } while (0)
236 #endif
237
238 /* Override rs6000.h definition.  */
239 #undef  TARGET_DEFAULT
240 #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS)
241
242 /* Override rs6000.h definition.  */
243 #undef  PROCESSOR_DEFAULT
244 #define PROCESSOR_DEFAULT PROCESSOR_PPC750
245
246 /* SVR4 only defined for PowerPC, so short-circuit POWER patterns.  */
247 #undef  TARGET_POWER
248 #define TARGET_POWER 0
249
250 #define FIXED_R2 1
251 /* System V.4 uses register 13 as a pointer to the small data area,
252    so it is not available to the normal user.  */
253 #define FIXED_R13 1
254
255 /* Override default big endianism definitions in rs6000.h.  */
256 #undef  BYTES_BIG_ENDIAN
257 #undef  WORDS_BIG_ENDIAN
258 #define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN)
259 #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN)
260
261 /* Define cutoff for using external functions to save floating point.
262    When optimizing for size, use external functions when profitable.  */
263 #define FP_SAVE_INLINE(FIRST_REG) (optimize_size                        \
264                                    ? ((FIRST_REG) == 62                 \
265                                       || (FIRST_REG) == 63)             \
266                                    : (FIRST_REG) < 64)
267 /* And similarly for general purpose registers.  */
268 #define GP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 32     \
269                                    && !optimize_size)
270
271 /* Put jump tables in read-only memory, rather than in .text.  */
272 #define JUMP_TABLES_IN_TEXT_SECTION 0
273
274 /* Prefix and suffix to use to saving floating point.  */
275 #define SAVE_FP_PREFIX "_savefpr_"
276 #define SAVE_FP_SUFFIX ""
277
278 /* Prefix and suffix to use to restoring floating point.  */
279 #define RESTORE_FP_PREFIX "_restfpr_"
280 #define RESTORE_FP_SUFFIX ""
281
282 /* Type used for ptrdiff_t, as a string used in a declaration.  */
283 #define PTRDIFF_TYPE "int"
284
285 /* Type used for wchar_t, as a string used in a declaration.  */
286 /* Override svr4.h definition.  */
287 #undef  WCHAR_TYPE
288 #define WCHAR_TYPE "long int"
289
290 /* Width of wchar_t in bits.  */
291 /* Override svr4.h definition.  */
292 #undef  WCHAR_TYPE_SIZE
293 #define WCHAR_TYPE_SIZE 32
294
295 /* Make int foo : 8 not cause structures to be aligned to an int boundary.  */
296 /* Override elfos.h definition.  */
297 #undef  PCC_BITFIELD_TYPE_MATTERS
298 #define PCC_BITFIELD_TYPE_MATTERS (TARGET_BITFIELD_TYPE)
299
300 #undef  BITFIELD_NBYTES_LIMITED
301 #define BITFIELD_NBYTES_LIMITED (TARGET_NO_BITFIELD_WORD)
302
303 /* Define this macro to be the value 1 if instructions will fail to
304    work if given data not on the nominal alignment.  If instructions
305    will merely go slower in that case, define this macro as 0.  */
306 #undef  STRICT_ALIGNMENT
307 #define STRICT_ALIGNMENT (TARGET_STRICT_ALIGN)
308
309 /* Define this macro if you wish to preserve a certain alignment for
310    the stack pointer, greater than what the hardware enforces.  The
311    definition is a C expression for the desired alignment (measured
312    in bits).  This macro must evaluate to a value equal to or larger
313    than STACK_BOUNDARY.
314    For the SYSV ABI and variants the alignment of the stack pointer
315    is usually controlled manually in rs6000.c. However, to maintain
316    alignment across alloca () in all circumstances,
317    PREFERRED_STACK_BOUNDARY needs to be set as well.
318    This has the additional advantage of allowing a bigger maximum
319    alignment of user objects on the stack.  */
320
321 #undef PREFERRED_STACK_BOUNDARY
322 #define PREFERRED_STACK_BOUNDARY 128
323
324 /* Real stack boundary as mandated by the appropriate ABI.  */
325 #define ABI_STACK_BOUNDARY \
326   ((TARGET_EABI && !TARGET_ALTIVEC && !TARGET_ALTIVEC_ABI) ? 64 : 128)
327
328 /* An expression for the alignment of a structure field FIELD if the
329    alignment computed in the usual way is COMPUTED.  */
330 #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED)                                   \
331         ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)     \
332          ? 128 : COMPUTED)
333
334 #undef  BIGGEST_FIELD_ALIGNMENT
335
336 /* Use ELF style section commands.  */
337
338 #define TEXT_SECTION_ASM_OP     "\t.section\t\".text\""
339
340 #define DATA_SECTION_ASM_OP     "\t.section\t\".data\""
341
342 #define BSS_SECTION_ASM_OP      "\t.section\t\".bss\""
343
344 /* Override elfos.h definition.  */
345 #undef  INIT_SECTION_ASM_OP
346 #define INIT_SECTION_ASM_OP "\t.section\t\".init\",\"ax\""
347
348 /* Override elfos.h definition.  */
349 #undef  FINI_SECTION_ASM_OP
350 #define FINI_SECTION_ASM_OP "\t.section\t\".fini\",\"ax\""
351
352 #define TOC_SECTION_ASM_OP "\t.section\t\".got\",\"aw\""
353
354 /* Put PC relative got entries in .got2.  */
355 #define MINIMAL_TOC_SECTION_ASM_OP \
356   (TARGET_RELOCATABLE || (flag_pic && DEFAULT_ABI != ABI_AIX)           \
357    ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"")
358
359 #define SDATA_SECTION_ASM_OP "\t.section\t\".sdata\",\"aw\""
360 #define SDATA2_SECTION_ASM_OP "\t.section\t\".sdata2\",\"a\""
361 #define SBSS_SECTION_ASM_OP "\t.section\t\".sbss\",\"aw\",@nobits"
362
363 /* Override default elf definitions.  */
364 #define TARGET_ASM_INIT_SECTIONS rs6000_elf_asm_init_sections
365 #undef  TARGET_ASM_RELOC_RW_MASK
366 #define TARGET_ASM_RELOC_RW_MASK rs6000_elf_reloc_rw_mask
367 #undef  TARGET_ASM_SELECT_RTX_SECTION
368 #define TARGET_ASM_SELECT_RTX_SECTION rs6000_elf_select_rtx_section
369
370 /* Return nonzero if this entry is to be written into the constant pool
371    in a special way.  We do so if this is a SYMBOL_REF, LABEL_REF or a CONST
372    containing one of them.  If -mfp-in-toc (the default), we also do
373    this for floating-point constants.  We actually can only do this
374    if the FP formats of the target and host machines are the same, but
375    we can't check that since not every file that uses these target macros
376    includes real.h.
377
378    Unlike AIX, we don't key off of -mminimal-toc, but instead do not
379    allow floating point constants in the TOC if -mrelocatable.  */
380
381 #undef  ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
382 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE)                        \
383   (TARGET_TOC                                                           \
384    && (GET_CODE (X) == SYMBOL_REF                                       \
385        || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS      \
386            && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF)           \
387        || GET_CODE (X) == LABEL_REF                                     \
388        || (GET_CODE (X) == CONST_INT                                    \
389            && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode))      \
390        || (!TARGET_NO_FP_IN_TOC                                         \
391            && !TARGET_RELOCATABLE                                       \
392            && GET_CODE (X) == CONST_DOUBLE                              \
393            && SCALAR_FLOAT_MODE_P (GET_MODE (X))                        \
394            && BITS_PER_WORD == HOST_BITS_PER_INT)))
395
396 /* These macros generate the special .type and .size directives which
397    are used to set the corresponding fields of the linker symbol table
398    entries in an ELF object file under SVR4.  These macros also output
399    the starting labels for the relevant functions/objects.  */
400
401 /* Write the extra assembler code needed to declare a function properly.
402    Some svr4 assemblers need to also have something extra said about the
403    function's return value.  We allow for that here.  */
404
405 /* Override elfos.h definition.  */
406 #undef  ASM_DECLARE_FUNCTION_NAME
407 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)                     \
408   rs6000_elf_declare_function_name ((FILE), (NAME), (DECL))
409
410 /* The USER_LABEL_PREFIX stuff is affected by the -fleading-underscore
411    flag.  The LOCAL_LABEL_PREFIX variable is used by dbxelf.h.  */
412
413 #define LOCAL_LABEL_PREFIX "."
414 #define USER_LABEL_PREFIX ""
415
416 /* svr4.h overrides (*targetm.asm_out.internal_label).  */
417
418 #define ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX)   \
419   asm_fprintf (FILE, "%L%s", PREFIX)
420
421 /* Globalizing directive for a label.  */
422 #define GLOBAL_ASM_OP "\t.globl "
423
424 /* This says how to output assembler code to declare an
425    uninitialized internal linkage data object.  Under SVR4,
426    the linker seems to want the alignment of data objects
427    to depend on their types.  We do exactly that here.  */
428
429 #define LOCAL_ASM_OP    "\t.local\t"
430
431 #define LCOMM_ASM_OP    "\t.lcomm\t"
432
433 /* Describe how to emit uninitialized local items.  */
434 #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN)    \
435 do {                                                                    \
436   if ((DECL) && rs6000_elf_in_small_data_p (DECL))                      \
437     {                                                                   \
438       switch_to_section (sbss_section);                                 \
439       ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT));      \
440       ASM_OUTPUT_LABEL (FILE, NAME);                                    \
441       ASM_OUTPUT_SKIP (FILE, SIZE);                                     \
442       if (!flag_inhibit_size_directive && (SIZE) > 0)                   \
443         ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, SIZE);                   \
444     }                                                                   \
445   else                                                                  \
446     {                                                                   \
447       fprintf (FILE, "%s", LCOMM_ASM_OP);                               \
448       assemble_name ((FILE), (NAME));                                   \
449       fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n",          \
450                (SIZE), (ALIGN) / BITS_PER_UNIT);                        \
451     }                                                                   \
452   ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object");                     \
453 } while (0)
454
455 /* Describe how to emit uninitialized external linkage items.  */
456 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN)           \
457 do {                                                                    \
458   ASM_OUTPUT_ALIGNED_DECL_LOCAL (FILE, DECL, NAME, SIZE, ALIGN);        \
459 } while (0)
460
461 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
462 /* To support -falign-* switches we need to use .p2align so
463    that alignment directives in code sections will be padded
464    with no-op instructions, rather than zeroes.  */
465 #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)                    \
466   if ((LOG) != 0)                                                       \
467     {                                                                   \
468       if ((MAX_SKIP) == 0)                                              \
469         fprintf ((FILE), "\t.p2align %d\n", (LOG));                     \
470       else                                                              \
471         fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));     \
472     }
473 #endif
474
475 /* This is how to output code to push a register on the stack.
476    It need not be very fast code.
477
478    On the rs6000, we must keep the backchain up to date.  In order
479    to simplify things, always allocate 16 bytes for a push (System V
480    wants to keep stack aligned to a 16 byte boundary).  */
481
482 #define ASM_OUTPUT_REG_PUSH(FILE, REGNO)                                \
483 do {                                                                    \
484   if (DEFAULT_ABI == ABI_V4)                                            \
485     asm_fprintf (FILE,                                                  \
486                  "\t{stu|stwu} %s,-16(%s)\n\t{st|stw} %s,12(%s)\n",     \
487                  reg_names[1], reg_names[1], reg_names[REGNO],          \
488                  reg_names[1]);                                         \
489 } while (0)
490
491 /* This is how to output an insn to pop a register from the stack.
492    It need not be very fast code.  */
493
494 #define ASM_OUTPUT_REG_POP(FILE, REGNO)                                 \
495 do {                                                                    \
496   if (DEFAULT_ABI == ABI_V4)                                            \
497     asm_fprintf (FILE,                                                  \
498                  "\t{l|lwz} %s,12(%s)\n\t{ai|addic} %s,%s,16\n",        \
499                  reg_names[REGNO], reg_names[1], reg_names[1],          \
500                  reg_names[1]);                                         \
501 } while (0)
502
503 extern int fixuplabelno;
504
505 /* Handle constructors specially for -mrelocatable.  */
506 #define TARGET_ASM_CONSTRUCTOR  rs6000_elf_asm_out_constructor
507 #define TARGET_ASM_DESTRUCTOR   rs6000_elf_asm_out_destructor
508
509 /* This is the end of what might become sysv4.h.  */
510
511 /* Use DWARF 2 debugging information by default.  */
512 #undef  PREFERRED_DEBUGGING_TYPE
513 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
514
515 /* Historically we have also supported stabs debugging.  */
516 #define DBX_DEBUGGING_INFO 1
517
518 #define TARGET_ENCODE_SECTION_INFO  rs6000_elf_encode_section_info
519 #define TARGET_IN_SMALL_DATA_P  rs6000_elf_in_small_data_p
520
521 /* The ELF version doesn't encode [DS] or whatever at the end of symbols.  */
522
523 #define RS6000_OUTPUT_BASENAME(FILE, NAME)      \
524     assemble_name (FILE, NAME)
525
526 /* We have to output the stabs for the function name *first*, before
527    outputting its label.  */
528
529 #define DBX_FUNCTION_FIRST
530
531 /* This is the end of what might become sysv4dbx.h.  */
532
533 #ifndef TARGET_VERSION
534 #define TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)");
535 #endif
536 \f
537 #define TARGET_OS_SYSV_CPP_BUILTINS()           \
538   do                                            \
539     {                                           \
540       if (target_flags_explicit                 \
541           & MASK_RELOCATABLE)                   \
542         builtin_define ("_RELOCATABLE");        \
543     }                                           \
544   while (0)
545
546 #ifndef TARGET_OS_CPP_BUILTINS
547 #define TARGET_OS_CPP_BUILTINS()                \
548   do                                            \
549     {                                           \
550       builtin_define_std ("PPC");               \
551       builtin_define_std ("unix");              \
552       builtin_define ("__svr4__");              \
553       builtin_assert ("system=unix");           \
554       builtin_assert ("system=svr4");           \
555       builtin_assert ("cpu=powerpc");           \
556       builtin_assert ("machine=powerpc");       \
557       TARGET_OS_SYSV_CPP_BUILTINS ();           \
558     }                                           \
559   while (0)
560 #endif
561
562 /* Pass various options to the assembler.  */
563 /* Override svr4.h definition.  */
564 #undef  ASM_SPEC
565 #define ASM_SPEC "%(asm_cpu) \
566 %{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}}" \
567 SVR4_ASM_SPEC \
568 "%{mrelocatable} %{mrelocatable-lib} %{fpic|fpie|fPIC|fPIE:-K PIC} \
569 %{memb|msdata=eabi: -memb} \
570 %{mlittle|mlittle-endian:-mlittle; \
571   mbig|mbig-endian      :-mbig;    \
572   mcall-aixdesc |                  \
573   mcall-freebsd |                  \
574   mcall-netbsd  |                  \
575   mcall-openbsd |                  \
576   mcall-linux   |                  \
577   mcall-gnu             :-mbig;    \
578   mcall-i960-old        :-mlittle}"
579
580 #define CC1_ENDIAN_BIG_SPEC ""
581
582 #define CC1_ENDIAN_LITTLE_SPEC "\
583 %{!mstrict-align: %{!mno-strict-align: \
584     %{!mcall-i960-old: \
585         -mstrict-align \
586     } \
587 }}"
588
589 #define CC1_ENDIAN_DEFAULT_SPEC "%(cc1_endian_big)"
590
591 #ifndef CC1_SECURE_PLT_DEFAULT_SPEC
592 #define CC1_SECURE_PLT_DEFAULT_SPEC ""
593 #endif
594
595 /* Pass -G xxx to the compiler and set correct endian mode.  */
596 #define CC1_SPEC "%{G*} %(cc1_cpu) \
597 %{mlittle|mlittle-endian: %(cc1_endian_little);           \
598   mbig   |mbig-endian   : %(cc1_endian_big);              \
599   mcall-aixdesc |                                         \
600   mcall-freebsd |                                         \
601   mcall-netbsd  |                                         \
602   mcall-openbsd |                                         \
603   mcall-linux   |                                         \
604   mcall-gnu             : -mbig %(cc1_endian_big);        \
605   mcall-i960-old        : -mlittle %(cc1_endian_little);  \
606                         : %(cc1_endian_default)}          \
607 %{meabi: %{!mcall-*: -mcall-sysv }} \
608 %{!meabi: %{!mno-eabi: \
609     %{mrelocatable: -meabi } \
610     %{mcall-freebsd: -mno-eabi } \
611     %{mcall-i960-old: -meabi } \
612     %{mcall-linux: -mno-eabi } \
613     %{mcall-gnu: -mno-eabi } \
614     %{mcall-netbsd: -mno-eabi } \
615     %{mcall-openbsd: -mno-eabi }}} \
616 %{msdata: -msdata=default} \
617 %{mno-sdata: -msdata=none} \
618 %{!mbss-plt: %{!msecure-plt: %(cc1_secure_plt_default)}} \
619 %{profile: -p}"
620
621 /* Don't put -Y P,<path> for cross compilers.  */
622 #ifndef CROSS_DIRECTORY_STRUCTURE
623 #define LINK_PATH_SPEC "\
624 %{!R*:%{L*:-R %*}} \
625 %{!nostdlib: %{!YP,*: \
626     %{compat-bsd: \
627         %{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
628         %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}} \
629         %{!R*: %{!L*: -R /usr/ucblib}} \
630     %{!compat-bsd: \
631         %{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
632         %{!p:-Y P,/usr/ccs/lib:/usr/lib}}}}"
633
634 #else
635 #define LINK_PATH_SPEC ""
636 #endif
637
638 /* Default starting address if specified.  */
639 #define LINK_START_SPEC "\
640 %{mads         : %(link_start_ads)         ; \
641   myellowknife : %(link_start_yellowknife) ; \
642   mmvme        : %(link_start_mvme)        ; \
643   msim         : %(link_start_sim)         ; \
644   mcall-freebsd: %(link_start_freebsd)     ; \
645   mcall-linux  : %(link_start_linux)       ; \
646   mcall-gnu    : %(link_start_gnu)         ; \
647   mcall-netbsd : %(link_start_netbsd)      ; \
648   mcall-openbsd: %(link_start_openbsd)     ; \
649                : %(link_start_default)     }"
650
651 #define LINK_START_DEFAULT_SPEC ""
652
653 /* Override svr4.h definition.  */
654 #undef  LINK_SPEC
655 #define LINK_SPEC "\
656 %{h*} %{v:-V} %{!msdata=none:%{G*}} %{msdata=none:-G0} \
657 %{YP,*} %{R*} \
658 %{Qy:} %{!Qn:-Qy} \
659 %(link_shlib) \
660 %{!Wl,-T*: %{!T*: %(link_start) }} \
661 %(link_target) \
662 %(link_os)"
663
664 /* For now, turn off shared libraries by default.  */
665 #ifndef SHARED_LIB_SUPPORT
666 #define NO_SHARED_LIB_SUPPORT
667 #endif
668
669 #ifndef NO_SHARED_LIB_SUPPORT
670 /* Shared libraries are default.  */
671 #define LINK_SHLIB_SPEC "\
672 %{!static: %(link_path) %{!R*:%{L*:-R %*}}} \
673 %{mshlib: } \
674 %{static:-dn -Bstatic} \
675 %{shared:-G -dy -z text} \
676 %{symbolic:-Bsymbolic -G -dy -z text}"
677
678 #else
679 /* Shared libraries are not default.  */
680 #define LINK_SHLIB_SPEC "\
681 %{mshlib: %(link_path) } \
682 %{!mshlib: %{!shared: %{!symbolic: -dn -Bstatic}}} \
683 %{static: } \
684 %{shared:-G -dy -z text %(link_path) } \
685 %{symbolic:-Bsymbolic -G -dy -z text %(link_path) }"
686 #endif
687
688 /* Override the default target of the linker.  */
689 #define LINK_TARGET_SPEC "\
690 %{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } \
691 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
692     %{mcall-i960-old: --oformat elf32-powerpcle} \
693   }}}}"
694
695 /* Any specific OS flags.  */
696 #define LINK_OS_SPEC "\
697 %{mads         : %(link_os_ads)         ; \
698   myellowknife : %(link_os_yellowknife) ; \
699   mmvme        : %(link_os_mvme)        ; \
700   msim         : %(link_os_sim)         ; \
701   mcall-freebsd: %(link_os_freebsd)     ; \
702   mcall-linux  : %(link_os_linux)       ; \
703   mcall-gnu    : %(link_os_gnu)         ; \
704   mcall-netbsd : %(link_os_netbsd)      ; \
705   mcall-openbsd: %(link_os_openbsd)     ; \
706                : %(link_os_default)     }"
707
708 #define LINK_OS_DEFAULT_SPEC ""
709
710 #define DRIVER_SELF_SPECS "%{mfpu=none: %<mfpu=* \
711         %<msingle-float %<mdouble-float}"
712
713 /* Override rs6000.h definition.  */
714 #undef  CPP_SPEC
715 #define CPP_SPEC "%{posix: -D_POSIX_SOURCE} \
716 %{mads         : %(cpp_os_ads)         ; \
717   myellowknife : %(cpp_os_yellowknife) ; \
718   mmvme        : %(cpp_os_mvme)        ; \
719   msim         : %(cpp_os_sim)         ; \
720   mcall-freebsd: %(cpp_os_freebsd)     ; \
721   mcall-linux  : %(cpp_os_linux)       ; \
722   mcall-gnu    : %(cpp_os_gnu)         ; \
723   mcall-netbsd : %(cpp_os_netbsd)      ; \
724   mcall-openbsd: %(cpp_os_openbsd)     ; \
725                : %(cpp_os_default)     }"
726
727 #define CPP_OS_DEFAULT_SPEC ""
728
729 /* Override svr4.h definition.  */
730 #undef  STARTFILE_SPEC
731 #define STARTFILE_SPEC "\
732 %{mads         : %(startfile_ads)         ; \
733   myellowknife : %(startfile_yellowknife) ; \
734   mmvme        : %(startfile_mvme)        ; \
735   msim         : %(startfile_sim)         ; \
736   mcall-freebsd: %(startfile_freebsd)     ; \
737   mcall-linux  : %(startfile_linux)       ; \
738   mcall-gnu    : %(startfile_gnu)         ; \
739   mcall-netbsd : %(startfile_netbsd)      ; \
740   mcall-openbsd: %(startfile_openbsd)     ; \
741                : %(startfile_default)     }"
742
743 #define STARTFILE_DEFAULT_SPEC "ecrti.o%s crtbegin.o%s"
744
745 /* Override svr4.h definition.  */
746 #undef  LIB_SPEC
747 #define LIB_SPEC "\
748 %{mads         : %(lib_ads)         ; \
749   myellowknife : %(lib_yellowknife) ; \
750   mmvme        : %(lib_mvme)        ; \
751   msim         : %(lib_sim)         ; \
752   mcall-freebsd: %(lib_freebsd)     ; \
753   mcall-linux  : %(lib_linux)       ; \
754   mcall-gnu    : %(lib_gnu)         ; \
755   mcall-netbsd : %(lib_netbsd)      ; \
756   mcall-openbsd: %(lib_openbsd)     ; \
757                : %(lib_default)     }"
758
759 #define LIB_DEFAULT_SPEC "-lc"
760
761 /* Override svr4.h definition.  */
762 #undef  ENDFILE_SPEC
763 #define ENDFILE_SPEC "\
764 %{mads         : %(endfile_ads)         ; \
765   myellowknife : %(endfile_yellowknife) ; \
766   mmvme        : %(endfile_mvme)        ; \
767   msim         : %(endfile_sim)         ; \
768   mcall-freebsd: %(endfile_freebsd)     ; \
769   mcall-linux  : %(endfile_linux)       ; \
770   mcall-gnu    : %(endfile_gnu)         ; \
771   mcall-netbsd : %(endfile_netbsd)      ; \
772   mcall-openbsd: %(endfile_openbsd)     ; \
773                : %(crtsavres_default) %(endfile_default)     }"
774
775 #define CRTSAVRES_DEFAULT_SPEC ""
776
777 #define ENDFILE_DEFAULT_SPEC "crtend.o%s ecrtn.o%s"
778
779 /* Motorola ADS support.  */
780 #define LIB_ADS_SPEC "--start-group -lads -lc --end-group"
781
782 #define STARTFILE_ADS_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
783
784 #define ENDFILE_ADS_SPEC "crtend.o%s ecrtn.o%s"
785
786 #define LINK_START_ADS_SPEC "-T ads.ld%s"
787
788 #define LINK_OS_ADS_SPEC ""
789
790 #define CPP_OS_ADS_SPEC ""
791
792 /* Motorola Yellowknife support.  */
793 #define LIB_YELLOWKNIFE_SPEC "--start-group -lyk -lc --end-group"
794
795 #define STARTFILE_YELLOWKNIFE_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
796
797 #define ENDFILE_YELLOWKNIFE_SPEC "crtend.o%s ecrtn.o%s"
798
799 #define LINK_START_YELLOWKNIFE_SPEC "-T yellowknife.ld%s"
800
801 #define LINK_OS_YELLOWKNIFE_SPEC ""
802
803 #define CPP_OS_YELLOWKNIFE_SPEC ""
804
805 /* Motorola MVME support.  */
806 #define LIB_MVME_SPEC "--start-group -lmvme -lc --end-group"
807
808 #define STARTFILE_MVME_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
809
810 #define ENDFILE_MVME_SPEC "crtend.o%s ecrtn.o%s"
811
812 #define LINK_START_MVME_SPEC "-Ttext 0x40000"
813
814 #define LINK_OS_MVME_SPEC ""
815
816 #define CPP_OS_MVME_SPEC ""
817
818 /* PowerPC simulator based on netbsd system calls support.  */
819 #define LIB_SIM_SPEC "--start-group -lsim -lc --end-group"
820
821 #define STARTFILE_SIM_SPEC "ecrti.o%s sim-crt0.o%s crtbegin.o%s"
822
823 #define ENDFILE_SIM_SPEC "crtend.o%s ecrtn.o%s"
824
825 #define LINK_START_SIM_SPEC ""
826
827 #define LINK_OS_SIM_SPEC "-m elf32ppcsim"
828
829 #define CPP_OS_SIM_SPEC ""
830
831 /* FreeBSD support.  */
832
833 #define CPP_OS_FREEBSD_SPEC     "\
834   -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ \
835   -Acpu=powerpc -Amachine=powerpc"
836
837 #define STARTFILE_FREEBSD_SPEC  FBSD_STARTFILE_SPEC
838 #define ENDFILE_FREEBSD_SPEC    FBSD_ENDFILE_SPEC
839 #define LIB_FREEBSD_SPEC        FBSD_LIB_SPEC
840 #define LINK_START_FREEBSD_SPEC ""
841
842 #define LINK_OS_FREEBSD_SPEC "\
843   %{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \
844   %{v:-V} \
845   %{assert*} %{R*} %{rpath*} %{defsym*} \
846   %{shared:-Bshareable %{h*} %{soname*}} \
847   %{!shared: \
848     %{!static: \
849       %{rdynamic: -export-dynamic} \
850       %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} \
851     %{static:-Bstatic}} \
852   %{symbolic:-Bsymbolic}"
853
854 /* GNU/Linux support.  */
855 #define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
856 %{!mnewlib: %{pthread:-lpthread} %{shared:-lc} \
857 %{!shared: %{profile:-lc_p} %{!profile:-lc}}}"
858
859 #ifdef HAVE_LD_PIE
860 #define STARTFILE_LINUX_SPEC "\
861 %{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
862 %{mnewlib:ecrti.o%s;:crti.o%s} \
863 %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
864 #else
865 #define STARTFILE_LINUX_SPEC "\
866 %{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
867 %{mnewlib:ecrti.o%s;:crti.o%s} \
868 %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
869 #endif
870
871 #define ENDFILE_LINUX_SPEC "\
872 %{shared|pie:crtendS.o%s;:crtend.o%s} \
873 %{mnewlib:ecrtn.o%s;:crtn.o%s}"
874
875 #define LINK_START_LINUX_SPEC ""
876
877 #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
878 #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
879 #if DEFAULT_LIBC == LIBC_UCLIBC
880 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
881 #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
882 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
883 #else
884 #error "Unsupported DEFAULT_LIBC"
885 #endif
886 #define LINUX_DYNAMIC_LINKER \
887   CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
888
889 #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
890   %{rdynamic:-export-dynamic} \
891   %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}}}"
892
893 #if defined(HAVE_LD_EH_FRAME_HDR)
894 # define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
895 #endif
896
897 #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
898 %{!undef:                                                         \
899   %{!ansi:                                                        \
900     %{!std=*:-Dunix -D__unix -Dlinux -D__linux}                   \
901     %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}}               \
902 -Asystem=linux -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
903
904 /* GNU/Hurd support.  */
905 #define LIB_GNU_SPEC "%{mnewlib: --start-group -lgnu -lc --end-group } \
906 %{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } \
907 %{profile:-lc_p} %{!profile:-lc}}}"
908
909 #define STARTFILE_GNU_SPEC "\
910 %{!shared: %{!static: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}} \
911 %{static: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} \
912 %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \
913 %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
914
915 #define ENDFILE_GNU_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
916 %{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}"
917
918 #define LINK_START_GNU_SPEC ""
919
920 #define LINK_OS_GNU_SPEC "-m elf32ppclinux %{!shared: %{!static: \
921   %{rdynamic:-export-dynamic} \
922   %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
923
924 #define CPP_OS_GNU_SPEC "-D__unix__ -D__gnu_hurd__ -D__GNU__    \
925 %{!undef:                                                       \
926   %{!ansi: -Dunix -D__unix}}                                    \
927 -Asystem=gnu -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
928
929 /* NetBSD support.  */
930 #define LIB_NETBSD_SPEC "\
931 %{profile:-lgmon -lc_p} %{!profile:-lc}"
932
933 #define STARTFILE_NETBSD_SPEC "\
934 ncrti.o%s crt0.o%s \
935 %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
936
937 #define ENDFILE_NETBSD_SPEC "\
938 %{!shared:crtend.o%s} %{shared:crtendS.o%s} \
939 ncrtn.o%s"
940
941 #define LINK_START_NETBSD_SPEC "\
942 "
943
944 #define LINK_OS_NETBSD_SPEC "\
945 %{!shared: %{!static: \
946   %{rdynamic:-export-dynamic} \
947   %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}}}"
948
949 #define CPP_OS_NETBSD_SPEC "\
950 -D__powerpc__ -D__NetBSD__ -D__KPRINTF_ATTRIBUTE__"
951
952 /* OpenBSD support.  */
953 #ifndef LIB_OPENBSD_SPEC
954 #define LIB_OPENBSD_SPEC "%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}"
955 #endif
956
957 #ifndef STARTFILE_OPENBSD_SPEC
958 #define STARTFILE_OPENBSD_SPEC "\
959 %{!shared: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} \
960 %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
961 #endif
962
963 #ifndef ENDFILE_OPENBSD_SPEC
964 #define ENDFILE_OPENBSD_SPEC "\
965 %{!shared:crtend.o%s} %{shared:crtendS.o%s}"
966 #endif
967
968 #ifndef LINK_START_OPENBSD_SPEC
969 #define LINK_START_OPENBSD_SPEC "-Ttext 0x400074"
970 #endif
971
972 #ifndef LINK_OS_OPENBSD_SPEC
973 #define LINK_OS_OPENBSD_SPEC ""
974 #endif
975
976 #ifndef CPP_OS_OPENBSD_SPEC
977 #define CPP_OS_OPENBSD_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
978 #endif
979
980 /* Define any extra SPECS that the compiler needs to generate.  */
981 /* Override rs6000.h definition.  */
982 #undef  SUBTARGET_EXTRA_SPECS
983 #define SUBTARGET_EXTRA_SPECS                                           \
984   { "crtsavres_default",        CRTSAVRES_DEFAULT_SPEC },               \
985   { "lib_ads",                  LIB_ADS_SPEC },                         \
986   { "lib_yellowknife",          LIB_YELLOWKNIFE_SPEC },                 \
987   { "lib_mvme",                 LIB_MVME_SPEC },                        \
988   { "lib_sim",                  LIB_SIM_SPEC },                         \
989   { "lib_freebsd",              LIB_FREEBSD_SPEC },                     \
990   { "lib_gnu",                  LIB_GNU_SPEC },                         \
991   { "lib_linux",                LIB_LINUX_SPEC },                       \
992   { "lib_netbsd",               LIB_NETBSD_SPEC },                      \
993   { "lib_openbsd",              LIB_OPENBSD_SPEC },                     \
994   { "lib_default",              LIB_DEFAULT_SPEC },                     \
995   { "startfile_ads",            STARTFILE_ADS_SPEC },                   \
996   { "startfile_yellowknife",    STARTFILE_YELLOWKNIFE_SPEC },           \
997   { "startfile_mvme",           STARTFILE_MVME_SPEC },                  \
998   { "startfile_sim",            STARTFILE_SIM_SPEC },                   \
999   { "startfile_freebsd",        STARTFILE_FREEBSD_SPEC },               \
1000   { "startfile_gnu",            STARTFILE_GNU_SPEC },                   \
1001   { "startfile_linux",          STARTFILE_LINUX_SPEC },                 \
1002   { "startfile_netbsd",         STARTFILE_NETBSD_SPEC },                \
1003   { "startfile_openbsd",        STARTFILE_OPENBSD_SPEC },               \
1004   { "startfile_default",        STARTFILE_DEFAULT_SPEC },               \
1005   { "endfile_ads",              ENDFILE_ADS_SPEC },                     \
1006   { "endfile_yellowknife",      ENDFILE_YELLOWKNIFE_SPEC },             \
1007   { "endfile_mvme",             ENDFILE_MVME_SPEC },                    \
1008   { "endfile_sim",              ENDFILE_SIM_SPEC },                     \
1009   { "endfile_freebsd",          ENDFILE_FREEBSD_SPEC },                 \
1010   { "endfile_gnu",              ENDFILE_GNU_SPEC },                     \
1011   { "endfile_linux",            ENDFILE_LINUX_SPEC },                   \
1012   { "endfile_netbsd",           ENDFILE_NETBSD_SPEC },                  \
1013   { "endfile_openbsd",          ENDFILE_OPENBSD_SPEC },                 \
1014   { "endfile_default",          ENDFILE_DEFAULT_SPEC },                 \
1015   { "link_path",                LINK_PATH_SPEC },                       \
1016   { "link_shlib",               LINK_SHLIB_SPEC },                      \
1017   { "link_target",              LINK_TARGET_SPEC },                     \
1018   { "link_start",               LINK_START_SPEC },                      \
1019   { "link_start_ads",           LINK_START_ADS_SPEC },                  \
1020   { "link_start_yellowknife",   LINK_START_YELLOWKNIFE_SPEC },          \
1021   { "link_start_mvme",          LINK_START_MVME_SPEC },                 \
1022   { "link_start_sim",           LINK_START_SIM_SPEC },                  \
1023   { "link_start_freebsd",       LINK_START_FREEBSD_SPEC },              \
1024   { "link_start_gnu",           LINK_START_GNU_SPEC },                  \
1025   { "link_start_linux",         LINK_START_LINUX_SPEC },                \
1026   { "link_start_netbsd",        LINK_START_NETBSD_SPEC },               \
1027   { "link_start_openbsd",       LINK_START_OPENBSD_SPEC },              \
1028   { "link_start_default",       LINK_START_DEFAULT_SPEC },              \
1029   { "link_os",                  LINK_OS_SPEC },                         \
1030   { "link_os_ads",              LINK_OS_ADS_SPEC },                     \
1031   { "link_os_yellowknife",      LINK_OS_YELLOWKNIFE_SPEC },             \
1032   { "link_os_mvme",             LINK_OS_MVME_SPEC },                    \
1033   { "link_os_sim",              LINK_OS_SIM_SPEC },                     \
1034   { "link_os_freebsd",          LINK_OS_FREEBSD_SPEC },                 \
1035   { "link_os_linux",            LINK_OS_LINUX_SPEC },                   \
1036   { "link_os_gnu",              LINK_OS_GNU_SPEC },                     \
1037   { "link_os_netbsd",           LINK_OS_NETBSD_SPEC },                  \
1038   { "link_os_openbsd",          LINK_OS_OPENBSD_SPEC },                 \
1039   { "link_os_default",          LINK_OS_DEFAULT_SPEC },                 \
1040   { "cc1_endian_big",           CC1_ENDIAN_BIG_SPEC },                  \
1041   { "cc1_endian_little",        CC1_ENDIAN_LITTLE_SPEC },               \
1042   { "cc1_endian_default",       CC1_ENDIAN_DEFAULT_SPEC },              \
1043   { "cc1_secure_plt_default",   CC1_SECURE_PLT_DEFAULT_SPEC },          \
1044   { "cpp_os_ads",               CPP_OS_ADS_SPEC },                      \
1045   { "cpp_os_yellowknife",       CPP_OS_YELLOWKNIFE_SPEC },              \
1046   { "cpp_os_mvme",              CPP_OS_MVME_SPEC },                     \
1047   { "cpp_os_sim",               CPP_OS_SIM_SPEC },                      \
1048   { "cpp_os_freebsd",           CPP_OS_FREEBSD_SPEC },                  \
1049   { "cpp_os_gnu",               CPP_OS_GNU_SPEC },                      \
1050   { "cpp_os_linux",             CPP_OS_LINUX_SPEC },                    \
1051   { "cpp_os_netbsd",            CPP_OS_NETBSD_SPEC },                   \
1052   { "cpp_os_openbsd",           CPP_OS_OPENBSD_SPEC },                  \
1053   { "cpp_os_default",           CPP_OS_DEFAULT_SPEC },                  \
1054   { "fbsd_dynamic_linker",      FBSD_DYNAMIC_LINKER },                  \
1055   SUBSUBTARGET_EXTRA_SPECS
1056
1057 #define SUBSUBTARGET_EXTRA_SPECS
1058
1059 /* Define this macro as a C expression for the initializer of an
1060    array of string to tell the driver program which options are
1061    defaults for this target and thus do not need to be handled
1062    specially when using `MULTILIB_OPTIONS'.
1063
1064    Do not define this macro if `MULTILIB_OPTIONS' is not defined in
1065    the target makefile fragment or if none of the options listed in
1066    `MULTILIB_OPTIONS' are set by default.  *Note Target Fragment::.  */
1067
1068 #define MULTILIB_DEFAULTS { "mbig", "mcall-sysv" }
1069
1070 /* Define this macro if the code for function profiling should come
1071    before the function prologue.  Normally, the profiling code comes
1072    after.  */
1073 #define PROFILE_BEFORE_PROLOGUE 1
1074
1075 /* Function name to call to do profiling.  */
1076 #define RS6000_MCOUNT "_mcount"
1077
1078 /* Define this macro (to a value of 1) if you want to support the
1079    Win32 style pragmas #pragma pack(push,<n>)' and #pragma
1080    pack(pop)'.  The pack(push,<n>) pragma specifies the maximum
1081    alignment (in bytes) of fields within a structure, in much the
1082    same way as the __aligned__' and __packed__' __attribute__'s
1083    do.  A pack value of zero resets the behavior to the default.
1084    Successive invocations of this pragma cause the previous values to
1085    be stacked, so that invocations of #pragma pack(pop)' will return
1086    to the previous value.  */
1087
1088 #define HANDLE_PRAGMA_PACK_PUSH_POP 1
1089
1090 /* Select a format to encode pointers in exception handling data.  CODE
1091    is 0 for data, 1 for code labels, 2 for function pointers.  GLOBAL is
1092    true if the symbol may be affected by dynamic relocations.  */
1093 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)                            \
1094   ((flag_pic || TARGET_RELOCATABLE)                                          \
1095    ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
1096    : DW_EH_PE_absptr)
1097
1098 #define DOUBLE_INT_ASM_OP "\t.quad\t"
1099
1100 /* Generate entries in .fixup for relocatable addresses.  */
1101 #define RELOCATABLE_NEEDS_FIXUP 1
1102
1103 /* This target uses the sysv4.opt file.  */
1104 #define TARGET_USES_SYSV4_OPT 1