1 /* Target definitions for GNU compiler for PowerPC running System V.4
2 Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
3 Contributed by Cygnus Support.
5 This file is part of GNU CC.
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 /* Small data support types */
23 enum rs6000_sdata_type
{
24 SDATA_NONE
, /* no small data support */
25 SDATA_DATA
, /* just put data in .sbss/.sdata, don't use relocs */
26 SDATA_SYSV
, /* Use r13 to point to .sdata/.sbss */
27 SDATA_EABI
/* Use r13 like above, r2 points to .sdata2/.sbss2 */
30 extern enum rs6000_sdata_type rs6000_sdata
;
32 /* V.4/eabi switches */
33 #define MASK_NO_BITFIELD_TYPE 0x40000000 /* Set PCC_BITFIELD_TYPE_MATTERS to 0 */
34 #define MASK_STRICT_ALIGN 0x20000000 /* Set STRICT_ALIGNMENT to 1. */
35 #define MASK_RELOCATABLE 0x10000000 /* GOT pointers are PC relative */
36 #define MASK_EABI 0x08000000 /* Adhere to eabi, not System V spec */
37 #define MASK_LITTLE_ENDIAN 0x04000000 /* target is little endian */
38 #define MASK_REGNAMES 0x02000000 /* use alternate register names. */
39 #define MASK_PROTOTYPE 0x01000000 /* Only prototyped fcns pass variable args */
41 #define TARGET_NO_BITFIELD_TYPE (target_flags & MASK_NO_BITFIELD_TYPE)
42 #define TARGET_STRICT_ALIGN (target_flags & MASK_STRICT_ALIGN)
43 #define TARGET_RELOCATABLE (target_flags & MASK_RELOCATABLE)
44 #define TARGET_EABI (target_flags & MASK_EABI)
45 #define TARGET_LITTLE_ENDIAN (target_flags & MASK_LITTLE_ENDIAN)
46 #define TARGET_REGNAMES (target_flags & MASK_REGNAMES)
47 #define TARGET_PROTOTYPE (target_flags & MASK_PROTOTYPE)
48 #define TARGET_TOC ((target_flags & MASK_64BIT) \
49 || ((target_flags & (MASK_RELOCATABLE \
50 | MASK_MINIMAL_TOC)) \
52 || DEFAULT_ABI == ABI_AIX \
53 || DEFAULT_ABI == ABI_NT)
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)
61 /* Pseudo target to indicate whether the object format is ELF
62 (to get around not having conditional compilation in the md file) */
65 /* Note, V.4 no longer uses a normal TOC, so make -mfull-toc, be just
66 the same as -mminimal-toc. */
67 #undef SUBTARGET_SWITCHES
68 #define SUBTARGET_SWITCHES \
69 { "bit-align", -MASK_NO_BITFIELD_TYPE }, \
70 { "no-bit-align", MASK_NO_BITFIELD_TYPE }, \
71 { "strict-align", MASK_STRICT_ALIGN }, \
72 { "no-strict-align", -MASK_STRICT_ALIGN }, \
73 { "relocatable", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC }, \
74 { "no-relocatable", -MASK_RELOCATABLE }, \
75 { "relocatable-lib", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC }, \
76 { "no-relocatable-lib", -MASK_RELOCATABLE }, \
77 { "little-endian", MASK_LITTLE_ENDIAN }, \
78 { "little", MASK_LITTLE_ENDIAN }, \
79 { "big-endian", -MASK_LITTLE_ENDIAN }, \
80 { "big", -MASK_LITTLE_ENDIAN }, \
82 { "toc", MASK_MINIMAL_TOC }, \
83 { "full-toc", MASK_MINIMAL_TOC }, \
84 { "prototype", MASK_PROTOTYPE }, \
85 { "no-prototype", -MASK_PROTOTYPE }, \
86 { "no-traceback", 0 }, \
87 { "eabi", MASK_EABI }, \
88 { "no-eabi", -MASK_EABI }, \
89 { "regnames", MASK_REGNAMES }, \
90 { "no-regnames", -MASK_REGNAMES }, \
95 { "yellowknife", 0 }, \
98 { "solaris-cclib", 0 }, \
100 EXTRA_SUBTARGET_SWITCHES \
103 /* This is meant to be redefined in the host dependent files */
104 #define EXTRA_SUBTARGET_SWITCHES
106 /* Default ABI to use */
107 #define RS6000_ABI_NAME "sysv"
109 /* Strings provided by SUBTARGET_OPTIONS */
110 extern char *rs6000_abi_name
;
111 extern char *rs6000_sdata_name
;
113 #define SUBTARGET_OPTIONS \
114 { "call-", &rs6000_abi_name}, \
115 { "sdata=", &rs6000_sdata_name}
117 /* Max # of bytes for variables to automatically be put into the .sdata
118 or .sdata2 sections. */
119 extern int g_switch_value
; /* value of the -G xx switch */
120 extern int g_switch_set
; /* whether -G xx was passed. */
122 #ifndef SDATA_DEFAULT_SIZE
123 #define SDATA_DEFAULT_SIZE 8
126 /* Sometimes certain combinations of command options do not make sense
127 on a particular target machine. You can define a macro
128 `OVERRIDE_OPTIONS' to take account of this. This macro, if
129 defined, is executed once just after all the command options have
132 The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to
135 #define SUBTARGET_OVERRIDE_OPTIONS \
138 g_switch_value = SDATA_DEFAULT_SIZE; \
140 if (!strcmp (rs6000_abi_name, "sysv")) \
141 rs6000_current_abi = ABI_V4; \
142 else if (!strcmp (rs6000_abi_name, "sysv-noeabi")) \
144 rs6000_current_abi = ABI_V4; \
145 target_flags &= ~ MASK_EABI; \
147 else if (!strcmp (rs6000_abi_name, "sysv-eabi") \
148 || !strcmp (rs6000_abi_name, "eabi")) \
150 rs6000_current_abi = ABI_V4; \
151 target_flags |= MASK_EABI; \
153 else if (!strcmp (rs6000_abi_name, "aix")) \
155 rs6000_current_abi = ABI_AIX_NODESC; \
156 target_flags |= MASK_EABI; \
158 else if (!strcmp (rs6000_abi_name, "aixdesc")) \
159 rs6000_current_abi = ABI_AIX; \
160 else if (!strcmp (rs6000_abi_name, "nt")) \
161 rs6000_current_abi = ABI_NT; \
162 else if (!strcmp (rs6000_abi_name, "linux")) \
163 rs6000_current_abi = ABI_V4; \
164 else if (!strcmp (rs6000_abi_name, "solaris")) \
165 rs6000_current_abi = ABI_SOLARIS; \
168 rs6000_current_abi = ABI_V4; \
169 error ("Bad value for -mcall-%s", rs6000_abi_name); \
172 if (rs6000_sdata_name) \
174 if (!strcmp (rs6000_sdata_name, "none")) \
175 rs6000_sdata = SDATA_NONE; \
176 else if (!strcmp (rs6000_sdata_name, "data")) \
177 rs6000_sdata = SDATA_DATA; \
178 else if (!strcmp (rs6000_sdata_name, "default")) \
179 rs6000_sdata = (TARGET_EABI) ? SDATA_EABI : SDATA_SYSV; \
180 else if (!strcmp (rs6000_sdata_name, "sysv")) \
181 rs6000_sdata = SDATA_SYSV; \
182 else if (!strcmp (rs6000_sdata_name, "eabi")) \
183 rs6000_sdata = SDATA_EABI; \
185 error ("Bad value for -msdata=%s", rs6000_sdata_name); \
187 else if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS) \
189 rs6000_sdata = SDATA_DATA; \
190 rs6000_sdata_name = "data"; \
194 rs6000_sdata = SDATA_NONE; \
195 rs6000_sdata_name = "none"; \
198 if (TARGET_RELOCATABLE && \
199 (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV)) \
201 rs6000_sdata = SDATA_DATA; \
202 error ("-mrelocatable and -msdata=%s are incompatible.", \
203 rs6000_sdata_name); \
206 else if (flag_pic && \
207 (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV)) \
209 rs6000_sdata = SDATA_DATA; \
210 error ("-f%s and -msdata=%s are incompatible.", \
211 (flag_pic > 1) ? "PIC" : "pic", \
212 rs6000_sdata_name); \
215 if (rs6000_sdata != SDATA_NONE && DEFAULT_ABI != ABI_V4 \
216 && DEFAULT_ABI != ABI_SOLARIS) \
218 rs6000_sdata = SDATA_NONE; \
219 error ("-msdata=%s and -mcall-%s are incompatible.", \
220 rs6000_sdata_name, rs6000_abi_name); \
223 if (TARGET_RELOCATABLE && !TARGET_MINIMAL_TOC) \
225 target_flags |= MASK_MINIMAL_TOC; \
226 error ("-mrelocatable and -mno-minimal-toc are incompatible."); \
229 if (TARGET_RELOCATABLE && \
230 (rs6000_current_abi == ABI_AIX || rs6000_current_abi == ABI_NT)) \
232 target_flags &= ~MASK_RELOCATABLE; \
233 error ("-mrelocatable and -mcall-%s are incompatible.", \
237 if (flag_pic > 1 && \
238 (rs6000_current_abi == ABI_AIX || rs6000_current_abi == ABI_NT)) \
241 error ("-fPIC and -mcall-%s are incompatible.", \
245 if (rs6000_current_abi == ABI_AIX && TARGET_LITTLE_ENDIAN) \
247 target_flags &= ~MASK_LITTLE_ENDIAN; \
248 error ("-mcall-aixdesc must be big endian"); \
251 if (rs6000_current_abi == ABI_NT && TARGET_BIG_ENDIAN) \
253 target_flags |= MASK_LITTLE_ENDIAN; \
254 error ("-mcall-nt must be little endian"); \
257 /* Treat -fPIC the same as -mrelocatable */ \
259 target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC; \
261 else if (TARGET_RELOCATABLE) \
266 /* Default ABI to compile code for */
267 #define DEFAULT_ABI rs6000_current_abi
269 #define CPP_DEFAULT_SPEC "-D_ARCH_PPC"
271 #define ASM_DEFAULT_SPEC "-mppc"
273 #include "rs6000/rs6000.h"
275 #undef TARGET_DEFAULT
276 #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS)
278 #undef PROCESSOR_DEFAULT
279 #define PROCESSOR_DEFAULT PROCESSOR_PPC601
281 /* System V.4 uses register 13 as a pointer to the small data area,
282 so it is not available to the normal user. */
287 /* System V.4 passes the first 8 floating arguments in registers,
288 instead of the first 13 like AIX does. */
289 #undef FP_ARG_MAX_REG
290 #define FP_ARG_MAX_REG ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_AIX_NODESC) \
291 ? FP_ARG_AIX_MAX_REG : FP_ARG_V4_MAX_REG)
293 /* Size of the V.4 varargs area if needed */
294 #undef RS6000_VARARGS_AREA
295 #define RS6000_VARARGS_AREA ((rs6000_sysv_varargs_p) ? RS6000_VARARGS_SIZE : 0)
297 /* Override default big endianism */
298 #undef BYTES_BIG_ENDIAN
299 #undef WORDS_BIG_ENDIAN
300 #define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN)
301 #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN)
303 /* Define this to set the endianness to use in libgcc2.c, which can
304 not depend on target_flags. */
305 #if !defined(_LITTLE_ENDIAN) && !defined(__sun__)
306 #define LIBGCC2_WORDS_BIG_ENDIAN 1
308 #define LIBGCC2_WORDS_BIG_ENDIAN 0
311 /* Size of the outgoing register save area */
312 #undef RS6000_REG_SAVE
313 #define RS6000_REG_SAVE ((DEFAULT_ABI == ABI_AIX \
314 || DEFAULT_ABI == ABI_AIX_NODESC) \
315 ? (TARGET_64BIT ? 64 : 32) \
318 /* Size of the fixed area on the stack. For AIX, use the standard 6 word
319 area, otherwise use 2 words to store back chain & LR. */
320 #undef RS6000_SAVE_AREA
321 #define RS6000_SAVE_AREA \
322 (((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_AIX_NODESC) ? 24 : 8) << (TARGET_64BIT ? 1 : 0))
324 /* Define cutoff for using external functions to save floating point.
325 Currently on V.4, always use inline stores */
326 #undef FP_SAVE_INLINE
327 #define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 64)
329 /* Don't generate XCOFF debugging information. */
331 #undef XCOFF_DEBUGGING_INFO
333 /* Don't use the COFF object file format. */
335 #undef OBJECT_FORMAT_COFF
337 /* Don't bother to output .extern pseudo-ops. They are not needed by
340 #undef ASM_OUTPUT_EXTERNAL
342 /* Put jump tables in read-only memory, rather than in .text. */
343 #undef JUMP_TABLES_IN_TEXT_SECTION
344 #define JUMP_TABLES_IN_TEXT_SECTION 0
346 /* Disable AIX-ism that disables turning -B into -L if the argument specifies a
347 relative file name. This breaks setting GCC_EXEC_PREFIX to D:\path under
349 #undef RELATIVE_PREFIX_NOT_LINKDIR
351 /* Undefine some things which are defined by the generic svr4.h. */
354 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
355 #undef READONLY_DATA_SECTION
356 #undef SELECT_SECTION
357 #undef ASM_DECLARE_FUNCTION_NAME
358 #undef ASM_OUTPUT_CONSTRUCTOR
359 #undef ASM_OUTPUT_DESTRUCTOR
361 /* Use the regular svr4 definitions. */
365 /* Prefix and suffix to use to saving floating point */
366 #undef SAVE_FP_PREFIX
367 #undef SAVE_FP_SUFFIX
368 #define SAVE_FP_PREFIX "_savefpr_"
369 #define SAVE_FP_SUFFIX "_l"
371 /* Prefix and suffix to use to restoring floating point */
372 #undef RESTORE_FP_PREFIX
373 #undef RESTORE_FP_SUFFIX
374 #define RESTORE_FP_PREFIX "_restfpr_"
375 #define RESTORE_FP_SUFFIX "_l"
377 /* Type used for ptrdiff_t, as a string used in a declaration. */
379 #define PTRDIFF_TYPE "int"
381 /* Type used for wchar_t, as a string used in a declaration. */
383 #define WCHAR_TYPE "long int"
385 /* Width of wchar_t in bits. */
386 #undef WCHAR_TYPE_SIZE
387 #define WCHAR_TYPE_SIZE 32
389 /* Make int foo : 8 not cause structures to be aligned to an int boundary */
391 #undef PCC_BITFIELD_TYPE_MATTERS
392 #define PCC_BITFIELD_TYPE_MATTERS (TARGET_BITFIELD_TYPE)
394 /* Define this macro to be the value 1 if instructions will fail to
395 work if given data not on the nominal alignment. If instructions
396 will merely go slower in that case, define this macro as 0. */
397 #undef STRICT_ALIGNMENT
398 #define STRICT_ALIGNMENT (TARGET_STRICT_ALIGN)
400 /* Alignment in bits of the stack boundary. Note, in order to allow building
401 one set of libraries with -mno-eabi instead of eabi libraries and non-eabi
402 versions, just use 64 as the stack boundary. */
403 #undef STACK_BOUNDARY
404 #define STACK_BOUNDARY 64
406 /* Real stack boundary as mandated by the appropriate ABI */
407 #define ABI_STACK_BOUNDARY ((TARGET_EABI) ? 64 : 128)
409 /* No data type wants to be aligned rounder than this. */
410 #undef BIGGEST_ALIGNMENT
411 #define BIGGEST_ALIGNMENT ((TARGET_EABI) ? 64 : 128)
413 #undef BIGGEST_FIELD_ALIGNMENT
414 #undef ADJUST_FIELD_ALIGN
415 #undef ROUND_TYPE_ALIGN
417 /* Use ELF style section commands. */
419 #undef TEXT_SECTION_ASM_OP
420 #define TEXT_SECTION_ASM_OP "\t.section\t\".text\""
422 #undef DATA_SECTION_ASM_OP
423 #define DATA_SECTION_ASM_OP "\t.section\t\".data\""
425 #undef BSS_SECTION_ASM_OP
426 #define BSS_SECTION_ASM_OP "\t.section\t\".bss\""
428 #undef INIT_SECTION_ASM_OP
429 #define INIT_SECTION_ASM_OP "\t.section\t\".init\",\"ax\""
431 #undef FINI_SECTION_ASM_OP
432 #define FINI_SECTION_ASM_OP "\t.section\t\".fini\",\"ax\""
434 #define TOC_SECTION_ASM_OP "\t.section\t\".got\",\"aw\""
436 /* Put PC relative got entries in .got2 */
437 #define MINIMAL_TOC_SECTION_ASM_OP \
438 ((TARGET_RELOCATABLE || flag_pic) ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"")
440 /* Put relocatable data in .data, not .rodata so initialized pointers can be updated */
441 #undef CONST_SECTION_ASM_OP
442 #define CONST_SECTION_ASM_OP \
443 ((TARGET_RELOCATABLE || flag_pic) ? "\t.section\t\".data\"\t# .rodata" : "\t.section\t\".rodata\"")
446 #define SDATA_SECTION_ASM_OP "\t.section\t\".sdata\",\"aw\""
447 #define SDATA2_SECTION_ASM_OP "\t.section\t\".sdata2\",\"a\""
448 #define SBSS_SECTION_ASM_OP \
449 ((DEFAULT_ABI == ABI_SOLARIS) ? "\t.section\t\".sbss\",\"aw\"" : "\t.section\t\".sbss\",\"aw\",@nobits")
452 /* Besides the usual ELF sections, we need a toc section. */
453 #undef EXTRA_SECTIONS
454 #define EXTRA_SECTIONS in_const, in_ctors, in_dtors, in_toc, in_sdata, in_sdata2, in_sbss, in_init, in_fini
456 #undef EXTRA_SECTION_FUNCTIONS
457 #define EXTRA_SECTION_FUNCTIONS \
458 CONST_SECTION_FUNCTION \
459 CTORS_SECTION_FUNCTION \
460 DTORS_SECTION_FUNCTION \
461 TOC_SECTION_FUNCTION \
462 SDATA_SECTION_FUNCTION \
463 SDATA2_SECTION_FUNCTION \
464 SBSS_SECTION_FUNCTION \
465 INIT_SECTION_FUNCTION \
466 FINI_SECTION_FUNCTION
468 extern void toc_section (), sdata_section (), sdata2_section ();
469 extern void sbss_section ();
471 #define TOC_SECTION_FUNCTION \
475 if (in_section != in_toc) \
477 in_section = in_toc; \
478 if ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT) \
479 && TARGET_MINIMAL_TOC \
480 && !TARGET_RELOCATABLE) \
482 if (! toc_initialized) \
484 toc_initialized = 1; \
485 fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \
486 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LCTOC", 0); \
487 fprintf (asm_out_file, "\t.tc "); \
488 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1[TC],"); \
489 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
490 fprintf (asm_out_file, "\n"); \
492 fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
493 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
494 fprintf (asm_out_file, " = .+32768\n"); \
497 fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
499 else if ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT) \
500 && !TARGET_RELOCATABLE) \
501 fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \
504 fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
505 if (! toc_initialized) \
507 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
508 fprintf (asm_out_file, " = .+32768\n"); \
509 toc_initialized = 1; \
515 #define SDATA_SECTION_FUNCTION \
519 if (in_section != in_sdata) \
521 in_section = in_sdata; \
522 fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \
526 #define SDATA2_SECTION_FUNCTION \
530 if (in_section != in_sdata2) \
532 in_section = in_sdata2; \
533 fprintf (asm_out_file, "%s\n", SDATA2_SECTION_ASM_OP); \
537 #define SBSS_SECTION_FUNCTION \
541 if (in_section != in_sbss) \
543 in_section = in_sbss; \
544 fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP); \
548 #define INIT_SECTION_FUNCTION \
552 if (in_section != in_init) \
554 in_section = in_init; \
555 fprintf (asm_out_file, "%s\n", INIT_SECTION_ASM_OP); \
559 #define FINI_SECTION_FUNCTION \
563 if (in_section != in_fini) \
565 in_section = in_fini; \
566 fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP); \
570 /* A C statement or statements to switch to the appropriate section
571 for output of RTX in mode MODE. You can assume that RTX is some
572 kind of constant in RTL. The argument MODE is redundant except in
573 the case of a `const_int' rtx. Select the section by calling
574 `text_section' or one of the alternatives for other sections.
576 Do not define this macro if you put all constants in the read-only
579 extern void rs6000_select_rtx_section (), rs6000_select_section ();
581 #undef SELECT_RTX_SECTION
582 #define SELECT_RTX_SECTION(MODE, X) rs6000_select_rtx_section (MODE, X)
584 /* A C statement or statements to switch to the appropriate
585 section for output of DECL. DECL is either a `VAR_DECL' node
586 or a constant of some sort. RELOC indicates whether forming
587 the initial value of DECL requires link-time relocations. */
589 #undef SELECT_SECTION
590 #define SELECT_SECTION(DECL,RELOC) rs6000_select_section (DECL, RELOC)
592 /* Return non-zero if this entry is to be written into the constant pool
593 in a special way. We do so if this is a SYMBOL_REF, LABEL_REF or a CONST
594 containing one of them. If -mfp-in-toc (the default), we also do
595 this for floating-point constants. We actually can only do this
596 if the FP formats of the target and host machines are the same, but
597 we can't check that since not every file that uses
598 GO_IF_LEGITIMATE_ADDRESS_P includes real.h.
600 Unlike AIX, we don't key off of -mminimal-toc, but instead do not
601 allow floating point constants in the TOC if -mrelocatable. */
603 #undef ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
604 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X) \
606 && (GET_CODE (X) == SYMBOL_REF \
607 || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \
608 && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \
609 || GET_CODE (X) == LABEL_REF \
610 || (!TARGET_NO_FP_IN_TOC \
611 && !TARGET_RELOCATABLE \
612 && GET_CODE (X) == CONST_DOUBLE \
613 && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
614 && BITS_PER_WORD == HOST_BITS_PER_INT)))
616 /* These macros generate the special .type and .size directives which
617 are used to set the corresponding fields of the linker symbol table
618 entries in an ELF object file under SVR4. These macros also output
619 the starting labels for the relevant functions/objects. */
621 /* Write the extra assembler code needed to declare a function properly.
622 Some svr4 assemblers need to also have something extra said about the
623 function's return value. We allow for that here. */
625 extern int rs6000_pic_labelno
;
627 #undef ASM_DECLARE_FUNCTION_NAME
628 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
631 char *init_ptr = (TARGET_64BIT) ? ".quad" : ".long"; \
632 STRIP_NAME_ENCODING (orig_name, NAME); \
634 if (TARGET_RELOCATABLE && (get_pool_size () != 0 || profile_flag)) \
636 char buf[256], *buf_ptr; \
638 ASM_OUTPUT_INTERNAL_LABEL (FILE, "LCL", rs6000_pic_labelno); \
640 ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1); \
641 STRIP_NAME_ENCODING (buf_ptr, buf); \
642 fprintf (FILE, "\t%s %s-", init_ptr, buf_ptr); \
644 ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); \
645 fprintf (FILE, "%s\n", buf_ptr); \
648 fprintf (FILE, "\t%s\t %s,", TYPE_ASM_OP, orig_name); \
649 fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
651 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
653 if (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT) \
655 char *desc_name = orig_name; \
657 while (*desc_name == '.') \
660 if (TREE_PUBLIC (DECL)) \
661 fprintf (FILE, "\t.globl %s\n", desc_name); \
663 fprintf (FILE, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
664 fprintf (FILE, "%s:\n", desc_name); \
665 fprintf (FILE, "\t%s %s\n", init_ptr, orig_name); \
666 fprintf (FILE, "\t%s _GLOBAL_OFFSET_TABLE_\n", init_ptr); \
667 if (DEFAULT_ABI == ABI_AIX) \
668 fprintf (FILE, "\t%s 0\n", init_ptr); \
669 fprintf (FILE, "\t.previous\n"); \
671 fprintf (FILE, "%s:\n", orig_name); \
674 /* How to renumber registers for dbx and gdb. */
676 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
678 /* svr4.h overrides ASM_OUTPUT_INTERNAL_LABEL. */
680 #undef ASM_OUTPUT_INTERNAL_LABEL_PREFIX
681 #define ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX) \
682 fprintf (FILE, ".%s", PREFIX)
684 /* This is how to allocate empty space in some section. Use .space
685 instead of .zero because the Solaris PowerPC assembler doesn't
686 like it, and gas accepts either syntax. */
689 #define SKIP_ASM_OP ".space"
691 /* This says how to output assembler code to declare an
692 uninitialized internal linkage data object. Under SVR4,
693 the linker seems to want the alignment of data objects
694 to depend on their types. We do exactly that here. */
697 #define LOCAL_ASM_OP ".local"
701 #define LCOMM_ASM_OP ".lcomm"
704 #undef ASM_OUTPUT_ALIGNED_LOCAL
705 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
707 if (rs6000_sdata != SDATA_NONE && (SIZE) > 0 \
708 && (SIZE) <= g_switch_value) \
711 ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT)); \
712 ASM_OUTPUT_LABEL (FILE, NAME); \
713 ASM_OUTPUT_SKIP (FILE, SIZE); \
714 if (!flag_inhibit_size_directive && (SIZE) > 0) \
716 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
717 assemble_name (FILE, NAME); \
718 fprintf (FILE, ",%d\n", SIZE); \
723 fprintf (FILE, "\t%s\t", LCOMM_ASM_OP); \
724 assemble_name ((FILE), (NAME)); \
725 fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
729 /* Describe how to emit uninitialized external linkage items */
730 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
732 ASM_GLOBALIZE_LABEL (FILE, NAME); \
733 ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \
736 /* Switch Recognition by gcc.c. Add -G xx support */
738 #undef SWITCH_TAKES_ARG
739 #define SWITCH_TAKES_ARG(CHAR) \
740 ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o' \
741 || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \
742 || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x' \
743 || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V' \
744 || (CHAR) == 'B' || (CHAR) == 'b' || (CHAR) == 'G')
747 #undef ASM_FILE_START
748 #define ASM_FILE_START(FILE) \
750 output_file_directive ((FILE), main_input_filename); \
751 rs6000_file_start (FILE, TARGET_CPU_DEFAULT); \
755 /* This is how to output an assembler line defining an `int' constant.
756 For -mrelocatable, we mark all addresses that need to be fixed up
757 in the .fixup section. */
758 #undef ASM_OUTPUT_INT
759 #define ASM_OUTPUT_INT(FILE,VALUE) \
761 static int recurse = 0; \
762 if ((TARGET_RELOCATABLE || flag_pic) \
763 && in_section != in_toc \
764 && in_section != in_text \
765 && in_section != in_ctors \
766 && in_section != in_dtors \
768 && GET_CODE (VALUE) != CONST_INT \
769 && GET_CODE (VALUE) != CONST_DOUBLE \
770 && CONSTANT_P (VALUE)) \
772 static int labelno = 0; \
776 ASM_GENERATE_INTERNAL_LABEL (buf, "LCP", labelno++); \
777 STRIP_NAME_ENCODING (p, buf); \
778 fprintf (FILE, "%s:\n", p); \
779 fprintf (FILE, "\t.long ("); \
780 output_addr_const (FILE, (VALUE)); \
781 fprintf (FILE, ")@fixup\n"); \
782 fprintf (FILE, "\t.section\t\".fixup\",\"aw\"\n"); \
783 ASM_OUTPUT_ALIGN (FILE, 2); \
784 fprintf (FILE, "\t.long\t%s\n", p); \
785 fprintf (FILE, "\t.previous\n"); \
788 /* Remove initial .'s to turn a -mcall-aixdesc or -mcall-nt function \
789 address into the address of the descriptor, not the function \
791 else if (GET_CODE (VALUE) == SYMBOL_REF \
792 && XSTR (VALUE, 0)[0] == '.' \
793 && (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT)) \
795 char *name = XSTR (VALUE, 0); \
796 while (*name == '.') \
799 fprintf (FILE, "\t.long %s\n", name); \
803 fprintf (FILE, "\t.long "); \
804 output_addr_const (FILE, (VALUE)); \
805 fprintf (FILE, "\n"); \
809 /* This is the end of what might become sysv4.h. */
811 /* Allow stabs and dwarf, for now, make stabs the default debugging type,
812 not dwarf since G++ doesn't support dwarf. */
813 #undef PREFERRED_DEBUGGING_TYPE
814 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
816 #define DBX_DEBUGGING_INFO
817 #define DWARF_DEBUGGING_INFO
819 /* If we are referencing a function that is static or is known to be
820 in this file, make the SYMBOL_REF special. We can use this to indicate
821 that we can branch to this function without emitting a no-op after the
822 call. For real AIX and NT calling sequences, we also replace the
823 function name with the real name (1 or 2 leading .'s), rather than
824 the function descriptor name. This saves a lot of overriding code
825 to readd the prefixes. */
827 #undef ENCODE_SECTION_INFO
828 #define ENCODE_SECTION_INFO(DECL) rs6000_encode_section_info (DECL)
830 extern void rs6000_encode_section_info ();
832 /* This macro gets just the user-specified name
833 out of the string in a SYMBOL_REF. Discard
835 #undef STRIP_NAME_ENCODING
836 #define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
838 char *_name = SYMBOL_NAME; \
839 while (*_name == '*' || *_name == '@') \
844 /* This is how to output a reference to a user-level label named NAME.
845 `assemble_name' uses this. */
847 #undef ASM_OUTPUT_LABELREF
848 #define ASM_OUTPUT_LABELREF(FILE,NAME) \
850 char *_name = NAME; \
851 while (*_name == '*' || *_name == '@') \
853 fputs (_name, FILE); \
857 * Switch into a generic section.
859 * We make the section read-only and executable for a function decl,
860 * read-only for a const data decl, and writable for a non-const data decl.
862 * If the section has already been defined, we must not
863 * emit the attributes here. The SVR4 assembler does not
864 * recognize section redefinitions.
865 * If DECL is NULL, no attributes are emitted.
867 * Note, Solaris as doesn't like @nobits, and gas can handle .sbss without
871 #undef ASM_OUTPUT_SECTION_NAME
872 #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
874 static struct section_info \
876 struct section_info *next; \
878 enum sect_enum {SECT_RW, SECT_RO, SECT_EXEC} type; \
880 struct section_info *s; \
882 enum sect_enum type; \
884 for (s = sections; s; s = s->next) \
885 if (!strcmp (NAME, s->name)) \
888 if (DECL && TREE_CODE (DECL) == FUNCTION_DECL) \
889 type = SECT_EXEC, mode = "ax"; \
890 else if (DECL && DECL_READONLY_SECTION (DECL, RELOC) && !TARGET_RELOCATABLE && !flag_pic) \
891 type = SECT_RO, mode = "a"; \
893 type = SECT_RW, mode = "aw"; \
897 s = (struct section_info *) xmalloc (sizeof (struct section_info)); \
898 s->name = xmalloc ((strlen (NAME) + 1) * sizeof (*NAME)); \
899 strcpy (s->name, NAME); \
901 s->next = sections; \
903 fprintf (FILE, "\t.section\t\"%s\",\"%s\"\n", NAME, mode); \
907 if (DECL && s->type != type) \
908 error_with_decl (DECL, "%s causes a section type conflict"); \
910 fprintf (FILE, "\t.section\t\"%s\"\n", NAME); \
914 #undef ASM_OUTPUT_CONSTRUCTOR
915 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
917 if (DEFAULT_ABI != ABI_SOLARIS) \
920 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
921 assemble_name (FILE, NAME); \
926 fputs ("\tbl ", FILE); \
927 assemble_name (FILE, NAME); \
929 fputs ("\n", FILE); \
932 /* A C statement (sans semicolon) to output an element in the table of
933 global destructors. */
934 #undef ASM_OUTPUT_DESTRUCTOR
935 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
937 if (DEFAULT_ABI != ABI_SOLARIS) \
940 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
941 assemble_name (FILE, NAME); \
946 fputs ("\tbl ", FILE); \
947 assemble_name (FILE, NAME); \
949 fputs ("\n", FILE); \
952 /* But, to make this work, we have to output the stabs for the function
955 #define DBX_FUNCTION_FIRST
957 /* This is the end of what might become sysv4dbx.h. */
959 #undef TARGET_VERSION
960 #define TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)");
962 #undef CPP_PREDEFINES
963 #define CPP_PREDEFINES \
964 "-DPPC -Dunix -D__svr4__ -Asystem(unix) -Asystem(svr4) -Acpu(powerpc) -Amachine(powerpc)"
966 /* Pass various options to the assembler */
968 #define ASM_SPEC "%(asm_cpu) \
969 %{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \
970 %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
971 %{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \
972 %{memb} %{!memb: %{msdata: -memb} %{msdata=eabi: -memb}} \
973 %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian} \
974 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
975 %{mcall-solaris: -mlittle -msolaris} \
976 %{mcall-linux: -mbig} }}}}"
978 #ifndef CC1_ENDIAN_BIG_SPEC
979 #define CC1_ENDIAN_BIG_SPEC ""
982 #ifndef CC1_ENDIAN_LITTLE_SPEC
983 #define CC1_ENDIAN_LITTLE_SPEC "\
984 %{!mstrict-align: %{!mno-strict-align: \
989 #ifndef CC1_ENDIAN_DEFAULT_SPEC
990 #define CC1_ENDIAN_DEFAULT_SPEC "%(cc1_endian_big_spec)"
994 /* Pass -G xxx to the compiler and set correct endian mode */
995 #define CC1_SPEC "%{G*} \
996 %{mlittle: %(cc1_endian_little)} %{!mlittle: %{mlittle-endian: %(cc1_endian_little)}} \
997 %{mbig: %(cc1_endian_big)} %{!mbig: %{mbig-endian: %(cc1_endian_big)}} \
998 %{mcall-nt: -mlittle %{cc1_endian_little} } \
999 %{mcall-aixdesc: -mbig %{cc1_endian_big} } \
1000 %{mcall-solaris: -mlittle %{cc1_endian_little} } \
1001 %{mcall-linux: -mbig %{cc1_endian_big} } \
1002 %{!mcall-nt: %{!mcall-aixdesc: %{!mcall-solaris: %{!mcall-linux: \
1003 %(cc1_endian_default) \
1005 %{mcall-solaris: -mregnames } \
1006 %{mno-sdata: -msdata=none } \
1007 %{meabi: %{!mcall-*: -mcall-sysv }} \
1008 %{!meabi: %{!mno-eabi: \
1009 %{mrelocatable: -meabi } \
1010 %{mcall-solaris: -mno-eabi } \
1011 %{mcall-linux: -mno-eabi }}} \
1012 %{msdata: -msdata=default} \
1013 %{mno-sdata: -msdata=none}"
1015 /* Don't put -Y P,<path> for cross compilers */
1016 #undef LINK_PATH_SPEC
1017 #ifndef CROSS_COMPILE
1018 #define LINK_PATH_SPEC "\
1019 %{!R*:%{L*:-R %*}} \
1020 %{!nostdlib: %{!YP,*: \
1022 %{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
1023 %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}} \
1024 %{!R*: %{!L*: -R /usr/ucblib}} \
1026 %{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
1027 %{!p:-Y P,/usr/ccs/lib:/usr/lib}}}}"
1030 #define LINK_PATH_SPEC ""
1033 /* Default starting address if specified */
1034 #ifndef LINK_START_SPEC
1035 #define LINK_START_SPEC "\
1036 %{mads: %(link_start_ads) } \
1037 %{myellowknife: %(link_start_yellowknife) } \
1038 %{mmvme: %(link_start_mvme) } \
1039 %{msim: %(link_start_sim) } \
1040 %{mcall-linux: %(link_start_linux) } \
1041 %{mcall-solaris: %(link_start_solaris) } \
1042 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(link_start_default) }}}}}}"
1045 #ifndef LINK_START_DEFAULT_SPEC
1046 #define LINK_START_DEFAULT_SPEC ""
1050 #define LINK_SPEC "\
1051 %{h*} %{v:-V} %{G*} \
1052 %{Wl,*:%*} %{YP,*} %{R*} \
1055 %{!Ttext*: %(link_start) } \
1059 /* For now, turn off shared libraries by default. */
1060 #ifndef SHARED_LIB_SUPPORT
1061 #define NO_SHARED_LIB_SUPPORT
1064 #undef LINK_SHLIB_SPEC
1065 #ifndef NO_SHARED_LIB_SUPPORT
1066 /* Shared libraries are default. */
1067 #define LINK_SHLIB_SPEC "\
1068 %{!static: %(link_path) %{!R*:%{L*:-R %*}}} \
1070 %{static:-dn -Bstatic} \
1071 %{shared:-G -dy -z text} \
1072 %{symbolic:-Bsymbolic -G -dy -z text}"
1075 /* Shared libraries are not default. */
1076 #define LINK_SHLIB_SPEC "\
1077 %{mshlib: %(link_path) } \
1078 %{!mshlib: %{!shared: %{!symbolic: -dn -Bstatic}}} \
1080 %{shared:-G -dy -z text %(link_path) } \
1081 %{symbolic:-Bsymbolic -G -dy -z text %(link_path) }"
1084 /* Override the default target of the linker. */
1085 #undef LINK_TARGET_SPEC
1086 #define LINK_TARGET_SPEC "\
1087 %{mlittle: -oformat elf32-powerpcle } %{mlittle-endian: -oformat elf32-powerpcle } \
1088 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: %{mcall-solaris: -oformat elf32-powerpcle}}}}}"
1090 /* Any specific OS flags */
1091 #ifndef LINK_OS_SPEC
1092 #define LINK_OS_SPEC "\
1093 %{mads: %(link_os_ads) } \
1094 %{myellowknife: %(link_os_yellowknife) } \
1095 %{mmvme: %(link_os_mvme) } \
1096 %{msim: %(link_os_sim) } \
1097 %{mcall-linux: %(link_os_linux) } \
1098 %{mcall-solaris: %(link_os_solaris) } \
1099 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(link_os_default) }}}}}}"
1102 #ifndef LINK_OS_DEFAULT_SPEC
1103 #define LINK_OS_DEFAULT_SPEC ""
1106 #undef CPP_SYSV_SPEC
1107 #define CPP_SYSV_SPEC \
1108 "%{mrelocatable*: -D_RELOCATABLE} \
1109 %{fpic: -D__PIC__=1 -D__pic__=1} \
1110 %{fPIC: -D__PIC__=2 -D__pic__=2} \
1111 %{mcall-sysv: -D_CALL_SYSV} %{mcall-nt: -D_CALL_NT} \
1112 %{mcall-aix: -D_CALL_AIX} %{mcall-aixdesc: -D_CALL_AIX -D_CALL_AIXDESC} \
1113 %{!mcall-sysv: %{!mcall-aix: %{!mcall-aixdesc: %{!mcall-nt: %(cpp_sysv_default) }}}} \
1114 %{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT}"
1116 #undef CPP_SYSV_DEFAULT_SPEC
1117 #define CPP_SYSV_DEFAULT_SPEC "-D_CALL_SYSV"
1119 #ifndef CPP_ENDIAN_BIG_SPEC
1120 #define CPP_ENDIAN_BIG_SPEC "-D_BIG_ENDIAN -D__BIG_ENDIAN__ -Amachine(bigendian)"
1123 #ifndef CPP_ENDIAN_LITTLE_SPEC
1124 #define CPP_ENDIAN_LITTLE_SPEC "-D_LITTLE_ENDIAN -D__LITTLE_ENDIAN__ -Amachine(littleendian)"
1127 #ifndef CPP_ENDIAN_SOLARIS_SPEC
1128 #define CPP_ENDIAN_SOLARIS_SPEC "-D__LITTLE_ENDIAN__ -Amachine(littleendian)"
1131 /* For solaris, don't define _LITTLE_ENDIAN, it conflicts with a header file. */
1132 #undef CPP_ENDIAN_SPEC
1133 #define CPP_ENDIAN_SPEC \
1134 "%{mlittle: %(cpp_endian_little) } \
1135 %{mlittle-endian: %(cpp_endian_little) } \
1136 %{mbig: %(cpp_endian_big) } \
1137 %{mbig-endian: %(cpp_endian_big) } \
1138 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
1139 %{mcall-solaris: %(cpp_endian_solaris) } \
1140 %{mcall-nt: %(cpp_endian_little) } \
1141 %{mcall-linux: %(cpp_endian_big) } \
1142 %{mcall-aixdesc: %(cpp_endian_big) } \
1143 %{!mcall-solaris: %{!mcall-linux: %{!mcall-nt: %{!mcall-aixdesc: %(cpp_endian_default) }}}}}}}}"
1145 #undef CPP_ENDIAN_DEFAULT_SPEC
1146 #define CPP_ENDIAN_DEFAULT_SPEC "%(cpp_endian_big)"
1149 #define CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_sysv) %(cpp_endian) %(cpp_cpu) \
1150 %{mads: %(cpp_os_ads) } \
1151 %{myellowknife: %(cpp_os_yellowknife) } \
1152 %{mmvme: %(cpp_os_mvme) } \
1153 %{msim: %(cpp_os_sim) } \
1154 %{mcall-linux: %(cpp_os_linux) } \
1155 %{mcall-solaris: %(cpp_os_solaris) } \
1156 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(cpp_os_default) }}}}}}"
1158 #ifndef CPP_OS_DEFAULT_SPEC
1159 #define CPP_OS_DEFAULT_SPEC ""
1162 #undef STARTFILE_SPEC
1163 #define STARTFILE_SPEC "\
1164 %{mads: %(startfile_ads) } \
1165 %{myellowknife: %(startfile_yellowknife) } \
1166 %{mmvme: %(startfile_mvme) } \
1167 %{msim: %(startfile_sim) } \
1168 %{mcall-linux: %(startfile_linux) } \
1169 %{mcall-solaris: %(startfile_solaris) } \
1170 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(startfile_default) }}}}}}"
1172 #undef STARTFILE_DEFAULT_SPEC
1173 #define STARTFILE_DEFAULT_SPEC ""
1177 %{mads: %(lib_ads) } \
1178 %{myellowknife: %(lib_yellowknife) } \
1179 %{mmvme: %(lib_mvme) } \
1180 %{msim: %(lib_sim) } \
1181 %{mcall-linux: %(lib_linux) } \
1182 %{mcall-solaris: %(lib_solaris) } \
1183 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(lib_default) }}}}}}"
1186 #define LIBGCC_SPEC "libgcc.a%s"
1188 #ifndef LIB_DEFAULT_SPEC
1189 #define LIB_DEFAULT_SPEC ""
1193 #define ENDFILE_SPEC "\
1194 %{mads: ecrtn.o%s} \
1195 %{myellowknife: ecrtn.o%s} \
1196 %{mmvme: ecrtn.o%s} \
1197 %{msim: ecrtn.o%s} \
1198 %{mcall-linux: %(endfile_linux) } \
1199 %{mcall-solaris: scrtn.o%s} \
1200 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(endfile_default) }}}}}}"
1202 #undef ENDFILE_DEFAULT_SPEC
1203 #define ENDFILE_DEFAULT_SPEC ""
1205 /* Motorola ADS support. */
1206 #ifndef LIB_ADS_SPEC
1207 #define LIB_ADS_SPEC "--start-group -lads -lc --end-group"
1210 #ifndef STARTFILE_ADS_SPEC
1211 #define STARTFILE_ADS_SPEC "ecrti.o%s crt0.o%s"
1214 #ifndef ENDFILE_ADS_SPEC
1215 #define ENDFILE_ADS_SPEC "ecrtn.o%s"
1218 #ifndef LINK_START_ADS_SPEC
1219 #define LINK_START_ADS_SPEC "-T ads.ld%s"
1222 #ifndef LINK_OS_ADS_SPEC
1223 #define LINK_OS_ADS_SPEC ""
1226 #ifndef CPP_OS_ADS_SPEC
1227 #define CPP_OS_ADS_SPEC ""
1230 /* Motorola Yellowknife support. */
1231 #ifndef LIB_YELLOWKNIFE_SPEC
1232 #define LIB_YELLOWKNIFE_SPEC "--start-group -lyk -lc --end-group"
1235 #ifndef STARTFILE_YELLOWKNIFE_SPEC
1236 #define STARTFILE_YELLOWKNIFE_SPEC "ecrti.o%s crt0.o%s"
1239 #ifndef ENDFILE_YELLOWKNIFE_SPEC
1240 #define ENDFILE_YELLOWKNIFE_SPEC "ecrtn.o%s"
1243 #ifndef LINK_START_YELLOWKNIFE_SPEC
1244 #define LINK_START_YELLOWKNIFE_SPEC "-T yellowknife.ld%s"
1247 #ifndef LINK_OS_YELLOWKNIFE_SPEC
1248 #define LINK_OS_YELLOWKNIFE_SPEC ""
1251 #ifndef CPP_OS_YELLOWKNIFE_SPEC
1252 #define CPP_OS_YELLOWKNIFE_SPEC ""
1255 /* Motorola MVME support. */
1256 #ifndef LIB_MVME_SPEC
1257 #define LIB_MVME_SPEC "--start-group -lmvme -lc --end-group"
1260 #ifndef STARTFILE_MVME_SPEC
1261 #define STARTFILE_MVME_SPEC "ecrti.o%s crt0.o%s"
1264 #ifndef ENDFILE_MVME_SPEC
1265 #define ENDFILE_MVME_SPEC "ecrtn.o%s"
1268 #ifndef LINK_START_MVME_SPEC
1269 #define LINK_START_MVME_SPEC "%{!Wl,-T*: %{!T*: -Ttext 0x40000}}"
1272 #ifndef LINK_OS_MVME_SPEC
1273 #define LINK_OS_MVME_SPEC ""
1276 #ifndef CPP_OS_MVME_SPEC
1277 #define CPP_OS_MVME_SPEC ""
1280 /* PowerPC simulator based on netbsd system calls support. */
1281 #ifndef LIB_SIM_SPEC
1282 #define LIB_SIM_SPEC "--start-group -lsim -lc --end-group"
1285 #ifndef STARTFILE_SIM_SPEC
1286 #define STARTFILE_SIM_SPEC "ecrti.o%s sim-crt0.o%s"
1289 #ifndef ENDFILE_SIM_SPEC
1290 #define ENDFILE_SIM_SPEC "ecrtn.o%s"
1293 #ifndef LINK_START_SIM_SPEC
1294 #define LINK_START_SIM_SPEC "-Ttext 0x10000074"
1297 #ifndef LINK_OS_SIM_SPEC
1298 #define LINK_OS_SIM_SPEC ""
1301 #ifndef CPP_OS_SIM_SPEC
1302 #define CPP_OS_SIM_SPEC ""
1305 /* GNU/Linux support. */
1306 #ifndef LIB_LINUX_SPEC
1307 #define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } %{!mnewlib: -lc }"
1310 #ifndef STARTFILE_LINUX_SPEC
1311 #define STARTFILE_LINUX_SPEC "\
1312 %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
1313 %{mnewlib: ecrti.o%s} \
1314 %{!mnewlib: crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
1317 #ifndef ENDFILE_LINUX_SPEC
1318 #define ENDFILE_LINUX_SPEC "\
1319 %{mnewlib: ecrtn.o%s} \
1320 %{!mnewlib: %{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s}"
1323 #ifndef LINK_START_LINUX_SPEC
1324 #define LINK_START_LINUX_SPEC "-Ttext 0x400074"
1327 #ifndef LINK_OS_LINUX_SPEC
1328 #define LINK_OS_LINUX_SPEC ""
1331 #ifndef CPP_OS_LINUX_SPEC
1332 #define CPP_OS_LINUX_SPEC "-D__unix__ -D__linux__ \
1333 %{!ansi: -Dunix -Dlinux } \
1334 -Asystem(unix) -Asystem(linux)"
1337 #ifndef CPP_OS_LINUX_SPEC
1338 #define CPP_OS_LINUX_SPEC ""
1341 /* Solaris support. */
1342 /* For Solaris, Gcc automatically adds in one of the files
1343 /usr/ccs/lib/values-Xc.o, /usr/ccs/lib/values-Xa.o, or
1344 /usr/ccs/lib/values-Xt.o for each final link step (depending upon the other
1345 gcc options selected, such as -traditional and -ansi). These files each
1346 contain one (initialized) copy of a special variable called `_lib_version'.
1347 Each one of these files has `_lib_version' initialized to a different (enum)
1348 value. The SVR4 library routines query the value of `_lib_version' at run
1349 to decide how they should behave. Specifically, they decide (based upon the
1350 value of `_lib_version') if they will act in a strictly ANSI conforming
1353 #ifndef LIB_SOLARIS_SPEC
1354 #define LIB_SOLARIS_SPEC "\
1355 %{mnewlib: --start-group -lsolaris -lc --end-group } \
1357 %{ansi:values-Xc.o%s} \
1359 %{traditional:values-Xt.o%s} \
1360 %{!traditional:values-Xa.o%s}} \
1361 %{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} \
1362 %{solaris-cclib: /opt/SUNWspro/SC4.0/lib/libabi.a} \
1363 %{!shared: %{!symbolic: -lc }}}"
1366 #ifndef STARTFILE_SOLARIS_SPEC
1367 #define STARTFILE_SOLARIS_SPEC "\
1368 %{!msolaris-cclib: scrti.o%s scrt0.o%s} \
1369 %{msolaris-cclib: /opt/SUNWspro/SC4.0/lib/crti.o%s /opt/SUNWspro/SC4.0/lib/crt1.o%s}"
1372 #ifndef ENDFILE_SOLARIS_SPEC
1373 #define ENDFILE_SOLARIS_SPEC "\
1374 %{!msolaris-cclib: scrtn.o%s} \
1375 %{msolaris-cclib: /opt/SUNWspro/SC4.0/lib/crtn.o%s}"
1378 #ifndef LINK_START_SOLARIS_SPEC
1379 #ifdef CROSS_COMPILER
1380 #define LINK_START_SOLARIS_SPEC "-Ttext 0x2000074"
1382 #define LINK_START_SOLARIS_SPEC ""
1386 #ifndef LINK_OS_SOLARIS_SPEC
1387 #define LINK_OS_SOLARIS_SPEC ""
1390 #ifndef CPP_OS_SOLARIS_SPEC
1391 #define CPP_OS_SOLARIS_SPEC "-D__ppc -D__sun__=1 -D__unix__ -D__svr4__ -D__SVR4__ \
1392 %{!ansi: -Dsun=1 -Dunix -DSVR4 -D__EXTENSIONS__ } \
1396 /* Define any extra SPECS that the compiler needs to generate. */
1397 #undef SUBTARGET_EXTRA_SPECS
1398 #define SUBTARGET_EXTRA_SPECS \
1399 { "lib_ads", LIB_ADS_SPEC }, \
1400 { "lib_yellowknife", LIB_YELLOWKNIFE_SPEC }, \
1401 { "lib_mvme", LIB_MVME_SPEC }, \
1402 { "lib_sim", LIB_SIM_SPEC }, \
1403 { "lib_linux", LIB_LINUX_SPEC }, \
1404 { "lib_solaris", LIB_SOLARIS_SPEC }, \
1405 { "lib_default", LIB_DEFAULT_SPEC }, \
1406 { "startfile_ads", STARTFILE_ADS_SPEC }, \
1407 { "startfile_yellowknife", STARTFILE_YELLOWKNIFE_SPEC }, \
1408 { "startfile_mvme", STARTFILE_MVME_SPEC }, \
1409 { "startfile_sim", STARTFILE_SIM_SPEC }, \
1410 { "startfile_linux", STARTFILE_LINUX_SPEC }, \
1411 { "startfile_solaris", STARTFILE_SOLARIS_SPEC }, \
1412 { "startfile_default", STARTFILE_DEFAULT_SPEC }, \
1413 { "endfile_ads", ENDFILE_ADS_SPEC }, \
1414 { "endfile_yellowknife", ENDFILE_YELLOWKNIFE_SPEC }, \
1415 { "endfile_mvme", ENDFILE_MVME_SPEC }, \
1416 { "endfile_sim", ENDFILE_SIM_SPEC }, \
1417 { "endfile_linux", ENDFILE_LINUX_SPEC }, \
1418 { "endfile_solaris", ENDFILE_SOLARIS_SPEC }, \
1419 { "endfile_default", ENDFILE_DEFAULT_SPEC }, \
1420 { "link_path", LINK_PATH_SPEC }, \
1421 { "link_shlib", LINK_SHLIB_SPEC }, \
1422 { "link_target", LINK_TARGET_SPEC }, \
1423 { "link_start", LINK_START_SPEC }, \
1424 { "link_start_ads", LINK_START_ADS_SPEC }, \
1425 { "link_start_yellowknife", LINK_START_YELLOWKNIFE_SPEC }, \
1426 { "link_start_mvme", LINK_START_MVME_SPEC }, \
1427 { "link_start_sim", LINK_START_SIM_SPEC }, \
1428 { "link_start_linux", LINK_START_LINUX_SPEC }, \
1429 { "link_start_solaris", LINK_START_SOLARIS_SPEC }, \
1430 { "link_start_default", LINK_START_DEFAULT_SPEC }, \
1431 { "link_os", LINK_OS_SPEC }, \
1432 { "link_os_ads", LINK_OS_ADS_SPEC }, \
1433 { "link_os_yellowknife", LINK_OS_YELLOWKNIFE_SPEC }, \
1434 { "link_os_mvme", LINK_OS_MVME_SPEC }, \
1435 { "link_os_sim", LINK_OS_SIM_SPEC }, \
1436 { "link_os_linux", LINK_OS_LINUX_SPEC }, \
1437 { "link_os_solaris", LINK_OS_SOLARIS_SPEC }, \
1438 { "link_os_default", LINK_OS_DEFAULT_SPEC }, \
1439 { "cc1_endian_big", CC1_ENDIAN_BIG_SPEC }, \
1440 { "cc1_endian_little", CC1_ENDIAN_LITTLE_SPEC }, \
1441 { "cc1_endian_default", CC1_ENDIAN_DEFAULT_SPEC }, \
1442 { "cpp_endian_big", CPP_ENDIAN_BIG_SPEC }, \
1443 { "cpp_endian_little", CPP_ENDIAN_LITTLE_SPEC }, \
1444 { "cpp_endian_solaris", CPP_ENDIAN_SOLARIS_SPEC }, \
1445 { "cpp_os_ads", CPP_OS_ADS_SPEC }, \
1446 { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
1447 { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
1448 { "cpp_os_sim", CPP_OS_SIM_SPEC }, \
1449 { "cpp_os_linux", CPP_OS_LINUX_SPEC }, \
1450 { "cpp_os_solaris", CPP_OS_SOLARIS_SPEC }, \
1451 { "cpp_os_default", CPP_OS_DEFAULT_SPEC },
1453 /* Define this macro as a C expression for the initializer of an
1454 array of string to tell the driver program which options are
1455 defaults for this target and thus do not need to be handled
1456 specially when using `MULTILIB_OPTIONS'.
1458 Do not define this macro if `MULTILIB_OPTIONS' is not defined in
1459 the target makefile fragment or if none of the options listed in
1460 `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */
1462 #undef MULTILIB_DEFAULTS
1463 #define MULTILIB_DEFAULTS { "mbig", "mcall-sysv" }
1465 /* Define this macro if the code for function profiling should come
1466 before the function prologue. Normally, the profiling code comes
1468 #define PROFILE_BEFORE_PROLOGUE 1
1470 /* Function name to call to do profiling. */
1471 #undef RS6000_MCOUNT
1472 #define RS6000_MCOUNT "_mcount"