OSDN Git Service

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