OSDN Git Service

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