1 /* Target definitions for GNU compiler for PowerPC running System V.4
2 Copyright (C) 1995, 1996, 1997, 1998, 1999 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 const char *rs6000_abi_name;
111 extern const 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_PPC750
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) \
630 const char *orig_name; \
631 const char *init_ptr = (TARGET_64BIT) ? ".quad" : ".long"; \
632 STRIP_NAME_ENCODING (orig_name, NAME); \
634 if (TARGET_RELOCATABLE && (get_pool_size () != 0 || profile_flag)) \
637 const char *buf_ptr; \
639 ASM_OUTPUT_INTERNAL_LABEL (FILE, "LCL", rs6000_pic_labelno); \
641 ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1); \
642 STRIP_NAME_ENCODING (buf_ptr, buf); \
643 fprintf (FILE, "\t%s %s-", init_ptr, buf_ptr); \
645 ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); \
646 fprintf (FILE, "%s\n", buf_ptr); \
649 fprintf (FILE, "\t%s\t %s,", TYPE_ASM_OP, orig_name); \
650 fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
652 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
654 if (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT) \
656 const char *desc_name = orig_name; \
658 while (*desc_name == '.') \
661 if (TREE_PUBLIC (DECL)) \
662 fprintf (FILE, "\t.globl %s\n", desc_name); \
664 fprintf (FILE, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
665 fprintf (FILE, "%s:\n", desc_name); \
666 fprintf (FILE, "\t%s %s\n", init_ptr, orig_name); \
667 fprintf (FILE, "\t%s _GLOBAL_OFFSET_TABLE_\n", init_ptr); \
668 if (DEFAULT_ABI == ABI_AIX) \
669 fprintf (FILE, "\t%s 0\n", init_ptr); \
670 fprintf (FILE, "\t.previous\n"); \
672 fprintf (FILE, "%s:\n", orig_name); \
675 /* How to renumber registers for dbx and gdb. */
677 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
679 /* svr4.h overrides ASM_OUTPUT_INTERNAL_LABEL. */
681 #undef ASM_OUTPUT_INTERNAL_LABEL_PREFIX
682 #define ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX) \
683 fprintf (FILE, ".%s", PREFIX)
685 /* This is how to allocate empty space in some section. Use .space
686 instead of .zero because the Solaris PowerPC assembler doesn't
687 like it, and gas accepts either syntax. */
690 #define SKIP_ASM_OP ".space"
692 /* This says how to output assembler code to declare an
693 uninitialized internal linkage data object. Under SVR4,
694 the linker seems to want the alignment of data objects
695 to depend on their types. We do exactly that here. */
698 #define LOCAL_ASM_OP ".local"
702 #define LCOMM_ASM_OP ".lcomm"
705 #undef ASM_OUTPUT_ALIGNED_LOCAL
706 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
708 if (rs6000_sdata != SDATA_NONE && (SIZE) > 0 \
709 && (SIZE) <= g_switch_value) \
712 ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT)); \
713 ASM_OUTPUT_LABEL (FILE, NAME); \
714 ASM_OUTPUT_SKIP (FILE, SIZE); \
715 if (!flag_inhibit_size_directive && (SIZE) > 0) \
717 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
718 assemble_name (FILE, NAME); \
719 fprintf (FILE, ",%d\n", SIZE); \
724 fprintf (FILE, "\t%s\t", LCOMM_ASM_OP); \
725 assemble_name ((FILE), (NAME)); \
726 fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
730 /* Describe how to emit uninitialized external linkage items */
731 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
733 ASM_GLOBALIZE_LABEL (FILE, NAME); \
734 ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \
737 /* Switch Recognition by gcc.c. Add -G xx support */
739 #undef SWITCH_TAKES_ARG
740 #define SWITCH_TAKES_ARG(CHAR) \
741 ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o' \
742 || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \
743 || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x' \
744 || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V' \
745 || (CHAR) == 'B' || (CHAR) == 'b' || (CHAR) == 'G')
748 #undef ASM_FILE_START
749 #define ASM_FILE_START(FILE) \
751 output_file_directive ((FILE), main_input_filename); \
752 rs6000_file_start (FILE, TARGET_CPU_DEFAULT); \
756 /* This is how to output an assembler line defining an `int' constant.
757 For -mrelocatable, we mark all addresses that need to be fixed up
758 in the .fixup section. */
759 #undef ASM_OUTPUT_INT
760 #define ASM_OUTPUT_INT(FILE,VALUE) \
762 static int recurse = 0; \
763 if ((TARGET_RELOCATABLE || flag_pic) \
764 && in_section != in_toc \
765 && in_section != in_text \
766 && in_section != in_ctors \
767 && in_section != in_dtors \
769 && GET_CODE (VALUE) != CONST_INT \
770 && GET_CODE (VALUE) != CONST_DOUBLE \
771 && CONSTANT_P (VALUE)) \
773 static int labelno = 0; \
778 ASM_GENERATE_INTERNAL_LABEL (buf, "LCP", labelno++); \
779 STRIP_NAME_ENCODING (p, buf); \
780 fprintf (FILE, "%s:\n", p); \
781 fprintf (FILE, "\t.long ("); \
782 output_addr_const (FILE, (VALUE)); \
783 fprintf (FILE, ")@fixup\n"); \
784 fprintf (FILE, "\t.section\t\".fixup\",\"aw\"\n"); \
785 ASM_OUTPUT_ALIGN (FILE, 2); \
786 fprintf (FILE, "\t.long\t%s\n", p); \
787 fprintf (FILE, "\t.previous\n"); \
790 /* Remove initial .'s to turn a -mcall-aixdesc or -mcall-nt function \
791 address into the address of the descriptor, not the function \
793 else if (GET_CODE (VALUE) == SYMBOL_REF \
794 && XSTR (VALUE, 0)[0] == '.' \
795 && (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT)) \
797 char *name = XSTR (VALUE, 0); \
798 while (*name == '.') \
801 fprintf (FILE, "\t.long %s\n", name); \
805 fprintf (FILE, "\t.long "); \
806 output_addr_const (FILE, (VALUE)); \
807 fprintf (FILE, "\n"); \
811 /* This is the end of what might become sysv4.h. */
813 /* Allow stabs and dwarf, for now, make stabs the default debugging type,
814 not dwarf since G++ doesn't support dwarf. */
815 #undef PREFERRED_DEBUGGING_TYPE
816 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
818 #define DBX_DEBUGGING_INFO
819 #define DWARF_DEBUGGING_INFO
821 /* If we are referencing a function that is static or is known to be
822 in this file, make the SYMBOL_REF special. We can use this to indicate
823 that we can branch to this function without emitting a no-op after the
824 call. For real AIX and NT calling sequences, we also replace the
825 function name with the real name (1 or 2 leading .'s), rather than
826 the function descriptor name. This saves a lot of overriding code
827 to readd the prefixes. */
829 #undef ENCODE_SECTION_INFO
830 #define ENCODE_SECTION_INFO(DECL) rs6000_encode_section_info (DECL)
832 extern void rs6000_encode_section_info ();
834 /* This macro gets just the user-specified name
835 out of the string in a SYMBOL_REF. Discard
837 #undef STRIP_NAME_ENCODING
838 #define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
840 const char *_name = SYMBOL_NAME; \
841 while (*_name == '*' || *_name == '@') \
846 /* This is how to output a reference to a user-level label named NAME.
847 `assemble_name' uses this. */
849 #undef ASM_OUTPUT_LABELREF
850 #define ASM_OUTPUT_LABELREF(FILE,NAME) \
852 const char *_name = NAME; \
853 while (*_name == '*' || *_name == '@') \
855 fputs (_name, FILE); \
859 * Switch into a generic section.
861 * We make the section read-only and executable for a function decl,
862 * read-only for a const data decl, and writable for a non-const data decl.
864 * If the section has already been defined, we must not
865 * emit the attributes here. The SVR4 assembler does not
866 * recognize section redefinitions.
867 * If DECL is NULL, no attributes are emitted.
869 * Note, Solaris as doesn't like @nobits, and gas can handle .sbss without
873 #undef ASM_OUTPUT_SECTION_NAME
874 #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
876 static struct section_info \
878 struct section_info *next; \
880 enum sect_enum {SECT_RW, SECT_RO, SECT_EXEC} type; \
882 struct section_info *s; \
884 enum sect_enum type; \
886 for (s = sections; s; s = s->next) \
887 if (!strcmp (NAME, s->name)) \
890 if (DECL && TREE_CODE (DECL) == FUNCTION_DECL) \
891 type = SECT_EXEC, mode = "ax"; \
892 else if (DECL && DECL_READONLY_SECTION (DECL, RELOC) && !TARGET_RELOCATABLE && !flag_pic) \
893 type = SECT_RO, mode = "a"; \
895 type = SECT_RW, mode = "aw"; \
899 s = (struct section_info *) xmalloc (sizeof (struct section_info)); \
900 s->name = xmalloc ((strlen (NAME) + 1) * sizeof (*NAME)); \
901 strcpy (s->name, NAME); \
903 s->next = sections; \
905 fprintf (FILE, "\t.section\t\"%s\",\"%s\"\n", NAME, mode); \
909 if (DECL && s->type != type) \
910 error_with_decl (DECL, "%s causes a section type conflict"); \
912 fprintf (FILE, "\t.section\t\"%s\"\n", NAME); \
916 #undef ASM_OUTPUT_CONSTRUCTOR
917 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
919 if (DEFAULT_ABI != ABI_SOLARIS) \
922 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
923 assemble_name (FILE, NAME); \
928 fputs ("\tbl ", FILE); \
929 assemble_name (FILE, NAME); \
931 fputs ("\n", FILE); \
934 /* A C statement (sans semicolon) to output an element in the table of
935 global destructors. */
936 #undef ASM_OUTPUT_DESTRUCTOR
937 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
939 if (DEFAULT_ABI != ABI_SOLARIS) \
942 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
943 assemble_name (FILE, NAME); \
948 fputs ("\tbl ", FILE); \
949 assemble_name (FILE, NAME); \
951 fputs ("\n", FILE); \
954 /* But, to make this work, we have to output the stabs for the function
957 #define DBX_FUNCTION_FIRST
959 /* This is the end of what might become sysv4dbx.h. */
961 #undef TARGET_VERSION
962 #define TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)");
964 #undef CPP_PREDEFINES
965 #define CPP_PREDEFINES \
966 "-DPPC -Dunix -D__svr4__ -Asystem(unix) -Asystem(svr4) -Acpu(powerpc) -Amachine(powerpc)"
968 /* Pass various options to the assembler */
970 #define ASM_SPEC "%(asm_cpu) \
971 %{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \
972 %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
973 %{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \
974 %{memb} %{!memb: %{msdata: -memb} %{msdata=eabi: -memb}} \
975 %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian} \
976 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
977 %{mcall-solaris: -mlittle -msolaris} \
978 %{mcall-linux: -mbig} }}}}"
980 #ifndef CC1_ENDIAN_BIG_SPEC
981 #define CC1_ENDIAN_BIG_SPEC ""
984 #ifndef CC1_ENDIAN_LITTLE_SPEC
985 #define CC1_ENDIAN_LITTLE_SPEC "\
986 %{!mstrict-align: %{!mno-strict-align: \
991 #ifndef CC1_ENDIAN_DEFAULT_SPEC
992 #define CC1_ENDIAN_DEFAULT_SPEC "%(cc1_endian_big_spec)"
996 /* Pass -G xxx to the compiler and set correct endian mode */
997 #define CC1_SPEC "%{G*} \
998 %{mlittle: %(cc1_endian_little)} %{!mlittle: %{mlittle-endian: %(cc1_endian_little)}} \
999 %{mbig: %(cc1_endian_big)} %{!mbig: %{mbig-endian: %(cc1_endian_big)}} \
1000 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
1001 %{mcall-nt: -mlittle %(cc1_endian_little) } \
1002 %{mcall-aixdesc: -mbig %(cc1_endian_big) } \
1003 %{mcall-solaris: -mlittle %(cc1_endian_little) } \
1004 %{mcall-linux: -mbig %(cc1_endian_big) } \
1005 %{!mcall-nt: %{!mcall-aixdesc: %{!mcall-solaris: %{!mcall-linux: \
1006 %(cc1_endian_default) \
1009 %{mcall-solaris: -mregnames } \
1010 %{mno-sdata: -msdata=none } \
1011 %{meabi: %{!mcall-*: -mcall-sysv }} \
1012 %{!meabi: %{!mno-eabi: \
1013 %{mrelocatable: -meabi } \
1014 %{mcall-solaris: -mno-eabi } \
1015 %{mcall-linux: -mno-eabi }}} \
1016 %{msdata: -msdata=default} \
1017 %{mno-sdata: -msdata=none} \
1020 /* Don't put -Y P,<path> for cross compilers */
1021 #undef LINK_PATH_SPEC
1022 #ifndef CROSS_COMPILE
1023 #define LINK_PATH_SPEC "\
1024 %{!R*:%{L*:-R %*}} \
1025 %{!nostdlib: %{!YP,*: \
1027 %{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
1028 %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}} \
1029 %{!R*: %{!L*: -R /usr/ucblib}} \
1031 %{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
1032 %{!p:-Y P,/usr/ccs/lib:/usr/lib}}}}"
1035 #define LINK_PATH_SPEC ""
1038 /* Default starting address if specified */
1039 #ifndef LINK_START_SPEC
1040 #define LINK_START_SPEC "\
1041 %{mads: %(link_start_ads) } \
1042 %{myellowknife: %(link_start_yellowknife) } \
1043 %{mmvme: %(link_start_mvme) } \
1044 %{msim: %(link_start_sim) } \
1045 %{mcall-linux: %(link_start_linux) } \
1046 %{mcall-solaris: %(link_start_solaris) } \
1047 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(link_start_default) }}}}}}"
1050 #ifndef LINK_START_DEFAULT_SPEC
1051 #define LINK_START_DEFAULT_SPEC ""
1055 #define LINK_SPEC "\
1056 %{h*} %{v:-V} %{G*} \
1057 %{Wl,*:%*} %{YP,*} %{R*} \
1060 %{!Ttext*: %(link_start) } \
1064 /* For now, turn off shared libraries by default. */
1065 #ifndef SHARED_LIB_SUPPORT
1066 #define NO_SHARED_LIB_SUPPORT
1069 #undef LINK_SHLIB_SPEC
1070 #ifndef NO_SHARED_LIB_SUPPORT
1071 /* Shared libraries are default. */
1072 #define LINK_SHLIB_SPEC "\
1073 %{!static: %(link_path) %{!R*:%{L*:-R %*}}} \
1075 %{static:-dn -Bstatic} \
1076 %{shared:-G -dy -z text} \
1077 %{symbolic:-Bsymbolic -G -dy -z text}"
1080 /* Shared libraries are not default. */
1081 #define LINK_SHLIB_SPEC "\
1082 %{mshlib: %(link_path) } \
1083 %{!mshlib: %{!shared: %{!symbolic: -dn -Bstatic}}} \
1085 %{shared:-G -dy -z text %(link_path) } \
1086 %{symbolic:-Bsymbolic -G -dy -z text %(link_path) }"
1089 /* Override the default target of the linker. */
1090 #undef LINK_TARGET_SPEC
1091 #define LINK_TARGET_SPEC "\
1092 %{mlittle: -oformat elf32-powerpcle } %{mlittle-endian: -oformat elf32-powerpcle } \
1093 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: %{mcall-solaris: -oformat elf32-powerpcle}}}}}"
1095 /* Any specific OS flags */
1096 #ifndef LINK_OS_SPEC
1097 #define LINK_OS_SPEC "\
1098 %{mads: %(link_os_ads) } \
1099 %{myellowknife: %(link_os_yellowknife) } \
1100 %{mmvme: %(link_os_mvme) } \
1101 %{msim: %(link_os_sim) } \
1102 %{mcall-linux: %(link_os_linux) } \
1103 %{mcall-solaris: %(link_os_solaris) } \
1104 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(link_os_default) }}}}}}"
1107 #ifndef LINK_OS_DEFAULT_SPEC
1108 #define LINK_OS_DEFAULT_SPEC ""
1111 #undef CPP_SYSV_SPEC
1112 #define CPP_SYSV_SPEC \
1113 "%{mrelocatable*: -D_RELOCATABLE} \
1114 %{fpic: -D__PIC__=1 -D__pic__=1} \
1115 %{!fpic: %{fPIC: -D__PIC__=2 -D__pic__=2}} \
1116 %{mcall-sysv: -D_CALL_SYSV} %{mcall-nt: -D_CALL_NT} \
1117 %{mcall-aix: -D_CALL_AIX} %{mcall-aixdesc: -D_CALL_AIX -D_CALL_AIXDESC} \
1118 %{!mcall-sysv: %{!mcall-aix: %{!mcall-aixdesc: %{!mcall-nt: %(cpp_sysv_default) }}}} \
1119 %{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT}"
1121 #undef CPP_SYSV_DEFAULT_SPEC
1122 #define CPP_SYSV_DEFAULT_SPEC "-D_CALL_SYSV"
1124 #ifndef CPP_ENDIAN_BIG_SPEC
1125 #define CPP_ENDIAN_BIG_SPEC "-D_BIG_ENDIAN -D__BIG_ENDIAN__ -Amachine(bigendian)"
1128 #ifndef CPP_ENDIAN_LITTLE_SPEC
1129 #define CPP_ENDIAN_LITTLE_SPEC "-D_LITTLE_ENDIAN -D__LITTLE_ENDIAN__ -Amachine(littleendian)"
1132 #ifndef CPP_ENDIAN_SOLARIS_SPEC
1133 #define CPP_ENDIAN_SOLARIS_SPEC "-D__LITTLE_ENDIAN__ -Amachine(littleendian)"
1136 /* For solaris, don't define _LITTLE_ENDIAN, it conflicts with a header file. */
1137 #undef CPP_ENDIAN_SPEC
1138 #define CPP_ENDIAN_SPEC \
1139 "%{mlittle: %(cpp_endian_little) } \
1140 %{mlittle-endian: %(cpp_endian_little) } \
1141 %{mbig: %(cpp_endian_big) } \
1142 %{mbig-endian: %(cpp_endian_big) } \
1143 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
1144 %{mcall-solaris: %(cpp_endian_solaris) } \
1145 %{mcall-nt: %(cpp_endian_little) } \
1146 %{mcall-linux: %(cpp_endian_big) } \
1147 %{mcall-aixdesc: %(cpp_endian_big) } \
1148 %{!mcall-solaris: %{!mcall-linux: %{!mcall-nt: %{!mcall-aixdesc: %(cpp_endian_default) }}}}}}}}"
1150 #undef CPP_ENDIAN_DEFAULT_SPEC
1151 #define CPP_ENDIAN_DEFAULT_SPEC "%(cpp_endian_big)"
1154 #define CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_sysv) %(cpp_endian) %(cpp_cpu) \
1155 %{mads: %(cpp_os_ads) } \
1156 %{myellowknife: %(cpp_os_yellowknife) } \
1157 %{mmvme: %(cpp_os_mvme) } \
1158 %{msim: %(cpp_os_sim) } \
1159 %{mcall-linux: %(cpp_os_linux) } \
1160 %{mcall-solaris: %(cpp_os_solaris) } \
1161 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(cpp_os_default) }}}}}}"
1163 #ifndef CPP_OS_DEFAULT_SPEC
1164 #define CPP_OS_DEFAULT_SPEC ""
1167 #undef STARTFILE_SPEC
1168 #define STARTFILE_SPEC "\
1169 %{mads: %(startfile_ads) } \
1170 %{myellowknife: %(startfile_yellowknife) } \
1171 %{mmvme: %(startfile_mvme) } \
1172 %{msim: %(startfile_sim) } \
1173 %{mcall-linux: %(startfile_linux) } \
1174 %{mcall-solaris: %(startfile_solaris) } \
1175 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(startfile_default) }}}}}}"
1177 #undef STARTFILE_DEFAULT_SPEC
1178 #define STARTFILE_DEFAULT_SPEC ""
1182 %{mads: %(lib_ads) } \
1183 %{myellowknife: %(lib_yellowknife) } \
1184 %{mmvme: %(lib_mvme) } \
1185 %{msim: %(lib_sim) } \
1186 %{mcall-linux: %(lib_linux) } \
1187 %{mcall-solaris: %(lib_solaris) } \
1188 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(lib_default) }}}}}}"
1191 #define LIBGCC_SPEC "libgcc.a%s"
1193 #ifndef LIB_DEFAULT_SPEC
1194 #define LIB_DEFAULT_SPEC ""
1198 #define ENDFILE_SPEC "\
1199 %{mads: ecrtn.o%s} \
1200 %{myellowknife: ecrtn.o%s} \
1201 %{mmvme: ecrtn.o%s} \
1202 %{msim: ecrtn.o%s} \
1203 %{mcall-linux: %(endfile_linux) } \
1204 %{mcall-solaris: scrtn.o%s} \
1205 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(endfile_default) }}}}}}"
1207 #undef ENDFILE_DEFAULT_SPEC
1208 #define ENDFILE_DEFAULT_SPEC ""
1210 /* Motorola ADS support. */
1211 #ifndef LIB_ADS_SPEC
1212 #define LIB_ADS_SPEC "--start-group -lads -lc --end-group"
1215 #ifndef STARTFILE_ADS_SPEC
1216 #define STARTFILE_ADS_SPEC "ecrti.o%s crt0.o%s"
1219 #ifndef ENDFILE_ADS_SPEC
1220 #define ENDFILE_ADS_SPEC "ecrtn.o%s"
1223 #ifndef LINK_START_ADS_SPEC
1224 #define LINK_START_ADS_SPEC "-T ads.ld%s"
1227 #ifndef LINK_OS_ADS_SPEC
1228 #define LINK_OS_ADS_SPEC ""
1231 #ifndef CPP_OS_ADS_SPEC
1232 #define CPP_OS_ADS_SPEC ""
1235 /* Motorola Yellowknife support. */
1236 #ifndef LIB_YELLOWKNIFE_SPEC
1237 #define LIB_YELLOWKNIFE_SPEC "--start-group -lyk -lc --end-group"
1240 #ifndef STARTFILE_YELLOWKNIFE_SPEC
1241 #define STARTFILE_YELLOWKNIFE_SPEC "ecrti.o%s crt0.o%s"
1244 #ifndef ENDFILE_YELLOWKNIFE_SPEC
1245 #define ENDFILE_YELLOWKNIFE_SPEC "ecrtn.o%s"
1248 #ifndef LINK_START_YELLOWKNIFE_SPEC
1249 #define LINK_START_YELLOWKNIFE_SPEC "-T yellowknife.ld%s"
1252 #ifndef LINK_OS_YELLOWKNIFE_SPEC
1253 #define LINK_OS_YELLOWKNIFE_SPEC ""
1256 #ifndef CPP_OS_YELLOWKNIFE_SPEC
1257 #define CPP_OS_YELLOWKNIFE_SPEC ""
1260 /* Motorola MVME support. */
1261 #ifndef LIB_MVME_SPEC
1262 #define LIB_MVME_SPEC "--start-group -lmvme -lc --end-group"
1265 #ifndef STARTFILE_MVME_SPEC
1266 #define STARTFILE_MVME_SPEC "ecrti.o%s crt0.o%s"
1269 #ifndef ENDFILE_MVME_SPEC
1270 #define ENDFILE_MVME_SPEC "ecrtn.o%s"
1273 #ifndef LINK_START_MVME_SPEC
1274 #define LINK_START_MVME_SPEC "%{!Wl,-T*: %{!T*: -Ttext 0x40000}}"
1277 #ifndef LINK_OS_MVME_SPEC
1278 #define LINK_OS_MVME_SPEC ""
1281 #ifndef CPP_OS_MVME_SPEC
1282 #define CPP_OS_MVME_SPEC ""
1285 /* PowerPC simulator based on netbsd system calls support. */
1286 #ifndef LIB_SIM_SPEC
1287 #define LIB_SIM_SPEC "--start-group -lsim -lc --end-group"
1290 #ifndef STARTFILE_SIM_SPEC
1291 #define STARTFILE_SIM_SPEC "ecrti.o%s sim-crt0.o%s"
1294 #ifndef ENDFILE_SIM_SPEC
1295 #define ENDFILE_SIM_SPEC "ecrtn.o%s"
1298 #ifndef LINK_START_SIM_SPEC
1299 #define LINK_START_SIM_SPEC "-Ttext 0x10000074"
1302 #ifndef LINK_OS_SIM_SPEC
1303 #define LINK_OS_SIM_SPEC ""
1306 #ifndef CPP_OS_SIM_SPEC
1307 #define CPP_OS_SIM_SPEC ""
1310 /* GNU/Linux support. */
1311 #ifndef LIB_LINUX_SPEC
1312 #ifdef USE_GNULIBC_1
1313 #define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
1316 #define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
1317 %{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } \
1318 %{profile:-lc_p} %{!profile:-lc}}}"
1322 #ifndef STARTFILE_LINUX_SPEC
1323 #define STARTFILE_LINUX_SPEC "\
1324 %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
1325 %{mnewlib: ecrti.o%s} \
1326 %{!mnewlib: crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
1329 #ifndef ENDFILE_LINUX_SPEC
1330 #define ENDFILE_LINUX_SPEC "\
1331 %{mnewlib: ecrtn.o%s} \
1332 %{!mnewlib: %{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s}"
1335 #ifndef LINK_START_LINUX_SPEC
1336 #define LINK_START_LINUX_SPEC "-Ttext 0x400074"
1339 #ifndef LINK_OS_LINUX_SPEC
1340 #define LINK_OS_LINUX_SPEC ""
1343 #ifndef CPP_OS_LINUX_SPEC
1344 #ifdef USE_GNULIBC_1
1345 #define CPP_OS_LINUX_SPEC "-D__unix__ -D__linux__ \
1346 %{!undef:%{!ansi:%{!std=*:-Dunix -Dlinux}%{std=gnu*:-Dunix -Dlinux}}} \
1347 -Asystem(unix) -Asystem(posix)"
1349 #define CPP_OS_LINUX_SPEC "-D__unix__ -D__linux__ \
1350 %{!undef:%{!ansi:%{!std=*:-Dunix -Dlinux}%{std=gnu*:-Dunix -Dlinux}}} \
1351 -Asystem(unix) -Asystem(posix) %{pthread:-D_REENTRANT}"
1355 /* Solaris support. */
1356 /* For Solaris, Gcc automatically adds in one of the files
1357 /usr/ccs/lib/values-Xc.o, /usr/ccs/lib/values-Xa.o, or
1358 /usr/ccs/lib/values-Xt.o for each final link step (depending upon the other
1359 gcc options selected, such as -traditional and -ansi). These files each
1360 contain one (initialized) copy of a special variable called `_lib_version'.
1361 Each one of these files has `_lib_version' initialized to a different (enum)
1362 value. The SVR4 library routines query the value of `_lib_version' at run
1363 to decide how they should behave. Specifically, they decide (based upon the
1364 value of `_lib_version') if they will act in a strictly ANSI conforming
1367 #ifndef LIB_SOLARIS_SPEC
1368 #define LIB_SOLARIS_SPEC "\
1369 %{mnewlib: --start-group -lsolaris -lc --end-group } \
1371 %{ansi:values-Xc.o%s} \
1373 %{traditional:values-Xt.o%s} \
1374 %{!traditional:values-Xa.o%s}} \
1375 %{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} \
1376 %{solaris-cclib: /opt/SUNWspro/SC4.0/lib/libabi.a} \
1377 %{!shared: %{!symbolic: -lc }}}"
1380 #ifndef STARTFILE_SOLARIS_SPEC
1381 #define STARTFILE_SOLARIS_SPEC "\
1382 %{!msolaris-cclib: scrti.o%s scrt0.o%s} \
1383 %{msolaris-cclib: /opt/SUNWspro/SC4.0/lib/crti.o%s /opt/SUNWspro/SC4.0/lib/crt1.o%s}"
1386 #ifndef ENDFILE_SOLARIS_SPEC
1387 #define ENDFILE_SOLARIS_SPEC "\
1388 %{!msolaris-cclib: scrtn.o%s} \
1389 %{msolaris-cclib: /opt/SUNWspro/SC4.0/lib/crtn.o%s}"
1392 #ifndef LINK_START_SOLARIS_SPEC
1393 #ifdef CROSS_COMPILER
1394 #define LINK_START_SOLARIS_SPEC "-Ttext 0x2000074"
1396 #define LINK_START_SOLARIS_SPEC ""
1400 #ifndef LINK_OS_SOLARIS_SPEC
1401 #define LINK_OS_SOLARIS_SPEC ""
1404 #ifndef CPP_OS_SOLARIS_SPEC
1405 #define CPP_OS_SOLARIS_SPEC "-D__ppc -D__sun__=1 -D__unix__ -D__svr4__ -D__SVR4__ \
1406 %{!undef:%{!ansi:%{!std=*:-Dsun=1 -Dunix -DSVR4 -D__EXTENSIONS__} \
1407 %{std=gnu*:-Dsun=1 -Dunix -DSVR4 -D__EXTENSIONS__}}} \
1411 /* Define any extra SPECS that the compiler needs to generate. */
1412 #undef SUBTARGET_EXTRA_SPECS
1413 #define SUBTARGET_EXTRA_SPECS \
1414 { "lib_ads", LIB_ADS_SPEC }, \
1415 { "lib_yellowknife", LIB_YELLOWKNIFE_SPEC }, \
1416 { "lib_mvme", LIB_MVME_SPEC }, \
1417 { "lib_sim", LIB_SIM_SPEC }, \
1418 { "lib_linux", LIB_LINUX_SPEC }, \
1419 { "lib_solaris", LIB_SOLARIS_SPEC }, \
1420 { "lib_default", LIB_DEFAULT_SPEC }, \
1421 { "startfile_ads", STARTFILE_ADS_SPEC }, \
1422 { "startfile_yellowknife", STARTFILE_YELLOWKNIFE_SPEC }, \
1423 { "startfile_mvme", STARTFILE_MVME_SPEC }, \
1424 { "startfile_sim", STARTFILE_SIM_SPEC }, \
1425 { "startfile_linux", STARTFILE_LINUX_SPEC }, \
1426 { "startfile_solaris", STARTFILE_SOLARIS_SPEC }, \
1427 { "startfile_default", STARTFILE_DEFAULT_SPEC }, \
1428 { "endfile_ads", ENDFILE_ADS_SPEC }, \
1429 { "endfile_yellowknife", ENDFILE_YELLOWKNIFE_SPEC }, \
1430 { "endfile_mvme", ENDFILE_MVME_SPEC }, \
1431 { "endfile_sim", ENDFILE_SIM_SPEC }, \
1432 { "endfile_linux", ENDFILE_LINUX_SPEC }, \
1433 { "endfile_solaris", ENDFILE_SOLARIS_SPEC }, \
1434 { "endfile_default", ENDFILE_DEFAULT_SPEC }, \
1435 { "link_path", LINK_PATH_SPEC }, \
1436 { "link_shlib", LINK_SHLIB_SPEC }, \
1437 { "link_target", LINK_TARGET_SPEC }, \
1438 { "link_start", LINK_START_SPEC }, \
1439 { "link_start_ads", LINK_START_ADS_SPEC }, \
1440 { "link_start_yellowknife", LINK_START_YELLOWKNIFE_SPEC }, \
1441 { "link_start_mvme", LINK_START_MVME_SPEC }, \
1442 { "link_start_sim", LINK_START_SIM_SPEC }, \
1443 { "link_start_linux", LINK_START_LINUX_SPEC }, \
1444 { "link_start_solaris", LINK_START_SOLARIS_SPEC }, \
1445 { "link_start_default", LINK_START_DEFAULT_SPEC }, \
1446 { "link_os", LINK_OS_SPEC }, \
1447 { "link_os_ads", LINK_OS_ADS_SPEC }, \
1448 { "link_os_yellowknife", LINK_OS_YELLOWKNIFE_SPEC }, \
1449 { "link_os_mvme", LINK_OS_MVME_SPEC }, \
1450 { "link_os_sim", LINK_OS_SIM_SPEC }, \
1451 { "link_os_linux", LINK_OS_LINUX_SPEC }, \
1452 { "link_os_solaris", LINK_OS_SOLARIS_SPEC }, \
1453 { "link_os_default", LINK_OS_DEFAULT_SPEC }, \
1454 { "cc1_endian_big", CC1_ENDIAN_BIG_SPEC }, \
1455 { "cc1_endian_little", CC1_ENDIAN_LITTLE_SPEC }, \
1456 { "cc1_endian_default", CC1_ENDIAN_DEFAULT_SPEC }, \
1457 { "cpp_endian_big", CPP_ENDIAN_BIG_SPEC }, \
1458 { "cpp_endian_little", CPP_ENDIAN_LITTLE_SPEC }, \
1459 { "cpp_endian_solaris", CPP_ENDIAN_SOLARIS_SPEC }, \
1460 { "cpp_os_ads", CPP_OS_ADS_SPEC }, \
1461 { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
1462 { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
1463 { "cpp_os_sim", CPP_OS_SIM_SPEC }, \
1464 { "cpp_os_linux", CPP_OS_LINUX_SPEC }, \
1465 { "cpp_os_solaris", CPP_OS_SOLARIS_SPEC }, \
1466 { "cpp_os_default", CPP_OS_DEFAULT_SPEC },
1468 /* Define this macro as a C expression for the initializer of an
1469 array of string to tell the driver program which options are
1470 defaults for this target and thus do not need to be handled
1471 specially when using `MULTILIB_OPTIONS'.
1473 Do not define this macro if `MULTILIB_OPTIONS' is not defined in
1474 the target makefile fragment or if none of the options listed in
1475 `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */
1477 #undef MULTILIB_DEFAULTS
1478 #define MULTILIB_DEFAULTS { "mbig", "mcall-sysv" }
1480 /* Define this macro if the code for function profiling should come
1481 before the function prologue. Normally, the profiling code comes
1483 #define PROFILE_BEFORE_PROLOGUE 1
1485 /* Function name to call to do profiling. */
1486 #undef RS6000_MCOUNT
1487 #define RS6000_MCOUNT "_mcount"