1 /* Target definitions for GNU compiler for PowerPC running System V.4
2 Copyright (C) 1995, 1996 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_SDATA 0x08000000 /* use small data areas */
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 */
40 #define MASK_EABI 0x00800000 /* Adhere to eabi, not System V spec */
42 #define TARGET_NO_BITFIELD_TYPE (target_flags & MASK_NO_BITFIELD_TYPE)
43 #define TARGET_STRICT_ALIGN (target_flags & MASK_STRICT_ALIGN)
44 #define TARGET_RELOCATABLE (target_flags & MASK_RELOCATABLE)
45 #define TARGET_SDATA (target_flags & MASK_SDATA)
46 #define TARGET_LITTLE_ENDIAN (target_flags & MASK_LITTLE_ENDIAN)
47 #define TARGET_REGNAMES (target_flags & MASK_REGNAMES)
48 #define TARGET_PROTOTYPE (target_flags & MASK_PROTOTYPE)
49 #define TARGET_EABI (target_flags & MASK_EABI)
50 #define TARGET_TOC ((target_flags & (MASK_64BIT \
52 | MASK_MINIMAL_TOC)) \
53 || DEFAULT_ABI == ABI_AIX \
54 || DEFAULT_ABI == ABI_NT)
56 #define TARGET_BITFIELD_TYPE (! TARGET_NO_BITFIELD_TYPE)
57 #define TARGET_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN)
58 #define TARGET_NO_PROTOTYPE (! TARGET_PROTOTYPE)
59 #define TARGET_NO_TOC (! TARGET_TOC)
60 #define TARGET_NO_EABI (! TARGET_EABI)
62 /* Pseudo target to indicate whether the object format is ELF
63 (to get around not having conditional compilation in the md file) */
66 /* Note, V.4 no longer uses a normal TOC, so make -mfull-toc, be just
67 the same as -mminimal-toc. */
68 #undef SUBTARGET_SWITCHES
69 #define SUBTARGET_SWITCHES \
70 { "bit-align", -MASK_NO_BITFIELD_TYPE }, \
71 { "no-bit-align", MASK_NO_BITFIELD_TYPE }, \
72 { "strict-align", MASK_STRICT_ALIGN }, \
73 { "no-strict-align", -MASK_STRICT_ALIGN }, \
74 { "relocatable", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC }, \
75 { "relocatable", -MASK_SDATA }, \
76 { "no-relocatable", -MASK_RELOCATABLE }, \
77 { "relocatable-lib", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC }, \
78 { "relocatable-lib", -MASK_SDATA }, \
79 { "no-relocatable-lib", -MASK_RELOCATABLE }, \
80 { "sdata", MASK_SDATA }, \
81 { "no-sdata", -MASK_SDATA }, \
82 { "little-endian", MASK_LITTLE_ENDIAN }, \
83 { "little", MASK_LITTLE_ENDIAN }, \
84 { "big-endian", -MASK_LITTLE_ENDIAN }, \
85 { "big", -MASK_LITTLE_ENDIAN }, \
87 { "toc", MASK_MINIMAL_TOC }, \
88 { "full-toc", MASK_MINIMAL_TOC }, \
89 { "prototype", MASK_PROTOTYPE }, \
90 { "no-prototype", -MASK_PROTOTYPE }, \
91 { "no-traceback", 0 }, \
92 { "eabi", MASK_EABI }, \
93 { "no-eabi", -MASK_EABI }, \
94 { "regnames", MASK_REGNAMES }, \
95 { "no-regnames", -MASK_REGNAMES }, \
99 { "solaris-cclib", 0 }, \
103 /* Default ABI to use */
104 #define RS6000_ABI_NAME "sysv"
106 /* Strings provided by SUBTARGET_OPTIONS */
107 extern char *rs6000_abi_name;
108 extern char *rs6000_sdata_name;
110 #define SUBTARGET_OPTIONS \
111 { "call-", &rs6000_abi_name}, \
112 { "sdata=", &rs6000_sdata_name}
114 /* Max # of bytes for variables to automatically be put into the .sdata
115 or .sdata2 sections. */
116 extern int g_switch_value; /* value of the -G xx switch */
117 extern int g_switch_set; /* whether -G xx was passed. */
119 #ifndef SDATA_DEFAULT_SIZE
120 #define SDATA_DEFAULT_SIZE 8
123 /* Sometimes certain combinations of command options do not make sense
124 on a particular target machine. You can define a macro
125 `OVERRIDE_OPTIONS' to take account of this. This macro, if
126 defined, is executed once just after all the command options have
129 The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to
132 #define SUBTARGET_OVERRIDE_OPTIONS \
135 g_switch_value = SDATA_DEFAULT_SIZE; \
137 if (!strcmp (rs6000_abi_name, "sysv")) \
138 rs6000_current_abi = ABI_V4; \
139 else if (!strcmp (rs6000_abi_name, "sysv-noeabi")) \
141 rs6000_current_abi = ABI_V4; \
142 target_flags &= ~ MASK_EABI; \
144 else if (!strcmp (rs6000_abi_name, "sysv-eabi") \
145 || !strcmp (rs6000_abi_name, "eabi")) \
147 rs6000_current_abi = ABI_V4; \
148 target_flags |= MASK_EABI; \
150 else if (!strcmp (rs6000_abi_name, "aix")) \
152 rs6000_current_abi = ABI_AIX_NODESC; \
153 target_flags |= MASK_EABI; \
155 else if (!strcmp (rs6000_abi_name, "aixdesc")) \
156 rs6000_current_abi = ABI_AIX; \
157 else if (!strcmp (rs6000_abi_name, "nt")) \
158 rs6000_current_abi = ABI_NT; \
159 else if (!strcmp (rs6000_abi_name, "linux")) \
160 rs6000_current_abi = ABI_V4; \
161 else if (!strcmp (rs6000_abi_name, "solaris")) \
162 rs6000_current_abi = ABI_SOLARIS; \
165 rs6000_current_abi = ABI_V4; \
166 error ("Bad value for -mcall-%s", rs6000_abi_name); \
169 if (rs6000_sdata_name) \
171 target_flags |= MASK_SDATA; \
172 if (!strcmp (rs6000_sdata_name, "none")) \
174 rs6000_sdata = SDATA_NONE; \
175 target_flags &= ~MASK_SDATA; \
177 else if (!strcmp (rs6000_sdata_name, "data")) \
178 rs6000_sdata = SDATA_DATA; \
179 else if (!strcmp (rs6000_sdata_name, "default")) \
180 rs6000_sdata = (TARGET_EABI) ? SDATA_EABI : SDATA_SYSV; \
181 else if (!strcmp (rs6000_sdata_name, "sysv")) \
182 rs6000_sdata = SDATA_SYSV; \
183 else if (!strcmp (rs6000_sdata_name, "eabi")) \
184 rs6000_sdata = SDATA_EABI; \
186 error ("Bad value for -msdata=%s", rs6000_sdata_name); \
188 else if (TARGET_SDATA) \
189 rs6000_sdata = (TARGET_EABI) ? SDATA_EABI : SDATA_SYSV; \
190 else if (!TARGET_RELOCATABLE && !flag_pic && DEFAULT_ABI == ABI_V4) \
192 rs6000_sdata = SDATA_DATA; \
193 target_flags |= MASK_SDATA; \
196 rs6000_sdata = SDATA_NONE; \
198 if (TARGET_RELOCATABLE && \
199 (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV)) \
201 target_flags &= ~MASK_SDATA; \
202 rs6000_sdata = SDATA_NONE; \
203 error ("-mrelocatable and -msdata are incompatible."); \
206 if (TARGET_RELOCATABLE && !TARGET_EABI) \
208 target_flags |= ~MASK_EABI; \
209 error ("-mrelocatable and -mno-eabi are incompatible."); \
212 if (TARGET_SDATA && DEFAULT_ABI != ABI_V4 \
213 && DEFAULT_ABI != ABI_SOLARIS) \
215 target_flags &= ~MASK_SDATA; \
216 error ("-msdata and -mcall-aix are incompatible."); \
219 if (TARGET_RELOCATABLE && !TARGET_MINIMAL_TOC) \
221 target_flags |= MASK_MINIMAL_TOC; \
222 error ("-mrelocatable and -mno-minimal-toc are incompatible."); \
225 if (TARGET_RELOCATABLE && \
226 (rs6000_current_abi == ABI_AIX || rs6000_current_abi == ABI_NT)) \
228 target_flags &= ~MASK_RELOCATABLE; \
229 error ("-mrelocatable and -mcall-%s are incompatible.", \
233 if (rs6000_current_abi == ABI_AIX && TARGET_LITTLE_ENDIAN) \
235 target_flags &= ~MASK_LITTLE_ENDIAN; \
236 error ("-mcall-aixdesc must be big endian"); \
239 if (rs6000_current_abi == ABI_NT && TARGET_BIG_ENDIAN) \
241 target_flags |= MASK_LITTLE_ENDIAN; \
242 error ("-mcall-nt must be little endian"); \
246 /* Default ABI to compile code for */
247 #define DEFAULT_ABI rs6000_current_abi
249 #include "rs6000/powerpc.h"
251 /* System V.4 uses register 13 as a pointer to the small data area,
252 so it is not available to the normal user. */
257 /* System V.4 passes the first 8 floating arguments in registers,
258 instead of the first 13 like AIX does. */
259 #undef FP_ARG_MAX_REG
260 #define FP_ARG_MAX_REG ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_AIX_NODESC) \
261 ? FP_ARG_AIX_MAX_REG : FP_ARG_V4_MAX_REG)
263 /* Size of the V.4 varargs area if needed */
264 #undef RS6000_VARARGS_AREA
265 #define RS6000_VARARGS_AREA ((rs6000_sysv_varargs_p) ? RS6000_VARARGS_SIZE : 0)
267 /* Override default big endianism */
268 #undef BYTES_BIG_ENDIAN
269 #undef WORDS_BIG_ENDIAN
270 #define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN)
271 #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN)
273 /* Define this to set the endianness to use in libgcc2.c, which can
274 not depend on target_flags. */
275 #if !defined(_LITTLE_ENDIAN) && !defined(__sun__)
276 #define LIBGCC2_WORDS_BIG_ENDIAN 1
278 #define LIBGCC2_WORDS_BIG_ENDIAN 0
281 /* Size of the outgoing register save area */
282 #undef RS6000_REG_SAVE
283 #define RS6000_REG_SAVE ((DEFAULT_ABI == ABI_AIX \
284 || DEFAULT_ABI == ABI_AIX_NODESC) \
285 ? (TARGET_64BIT ? 64 : 32) \
288 /* Size of the fixed area on the stack. For AIX, use the standard 6 word
289 area, otherwise use 2 words to store back chain & LR. */
290 #undef RS6000_SAVE_AREA
291 #define RS6000_SAVE_AREA \
292 (((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_AIX_NODESC) ? 24 : 8) << (TARGET_64BIT ? 1 : 0))
294 /* Define cutoff for using external functions to save floating point.
295 Currently on V.4, always use inline stores */
296 #undef FP_SAVE_INLINE
297 #define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 64)
299 /* Don't generate XCOFF debugging information. */
301 #undef XCOFF_DEBUGGING_INFO
303 /* Don't use the COFF object file format. */
305 #undef OBJECT_FORMAT_COFF
307 /* Don't bother to output .extern pseudo-ops. They are not needed by
310 #undef ASM_OUTPUT_EXTERNAL
312 /* Undefine some things which are defined by the generic svr4.h. */
315 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
316 #undef READONLY_DATA_SECTION
317 #undef SELECT_SECTION
318 #undef ASM_DECLARE_FUNCTION_NAME
319 #undef ASM_OUTPUT_CONSTRUCTOR
320 #undef ASM_OUTPUT_DESTRUCTOR
322 /* Use the regular svr4 definitions. */
326 /* Prefix and suffix to use to saving floating point */
327 #undef SAVE_FP_PREFIX
328 #undef SAVE_FP_SUFFIX
329 #define SAVE_FP_PREFIX "_savefpr_"
330 #define SAVE_FP_SUFFIX "_l"
332 /* Prefix and suffix to use to restoring floating point */
333 #undef RESTORE_FP_PREFIX
334 #undef RESTORE_FP_SUFFIX
335 #define RESTORE_FP_PREFIX "_restfpr_"
336 #define RESTORE_FP_SUFFIX "_l"
338 /* Type used for ptrdiff_t, as a string used in a declaration. */
340 #define PTRDIFF_TYPE "int"
342 /* Type used for wchar_t, as a string used in a declaration. */
344 #define WCHAR_TYPE "short unsigned int"
346 /* Width of wchar_t in bits. */
347 #undef WCHAR_TYPE_SIZE
348 #define WCHAR_TYPE_SIZE 16
350 /* Make int foo : 8 not cause structures to be aligned to an int boundary */
352 #undef PCC_BITFIELD_TYPE_MATTERS
353 #define PCC_BITFIELD_TYPE_MATTERS (TARGET_BITFIELD_TYPE)
355 /* Define this macro to be the value 1 if instructions will fail to
356 work if given data not on the nominal alignment. If instructions
357 will merely go slower in that case, define this macro as 0.
359 Note, little endian systems trap on unaligned addresses, so never
360 turn off strict alignment in that case. */
361 #undef STRICT_ALIGNMENT
362 #define STRICT_ALIGNMENT (TARGET_STRICT_ALIGN || TARGET_LITTLE_ENDIAN)
364 /* Align stack to 8 byte boundaries for eabi, 16 byte boundaries for System V.4 */
365 #undef STACK_BOUNDARY
366 #define STACK_BOUNDARY ((TARGET_EABI) ? 64 : 128)
368 /* No data type wants to be aligned rounder than this. */
369 #undef BIGGEST_ALIGNMENT
370 #define BIGGEST_ALIGNMENT ((TARGET_EABI) ? 64 : 128)
372 #undef BIGGEST_FIELD_ALIGNMENT
373 #undef ADJUST_FIELD_ALIGN
374 #undef ROUND_TYPE_ALIGN
376 /* Use ELF style section commands. */
378 #undef TEXT_SECTION_ASM_OP
379 #define TEXT_SECTION_ASM_OP "\t.section \".text\""
381 #undef DATA_SECTION_ASM_OP
382 #define DATA_SECTION_ASM_OP "\t.section \".data\""
384 #undef BSS_SECTION_ASM_OP
385 #define BSS_SECTION_ASM_OP "\t.section \".bss\""
387 #undef INIT_SECTION_ASM_OP
388 #define INIT_SECTION_ASM_OP "\t.section \".init\",\"ax\""
390 #undef FINI_SECTION_ASM_OP
391 #define FINI_SECTION_ASM_OP "\t.section \".fini\",\"ax\""
393 #define TOC_SECTION_ASM_OP "\t.section \".got\",\"aw\""
395 /* Put PC relative got entries in .got2 */
396 #define MINIMAL_TOC_SECTION_ASM_OP \
397 ((TARGET_RELOCATABLE) ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"")
399 /* Put relocatable data in .data, not .rodata so initialized pointers can be updated */
400 #undef CONST_SECTION_ASM_OP
401 #define CONST_SECTION_ASM_OP \
402 ((TARGET_RELOCATABLE) ? "\t.section\t\".data\"\t# .rodata" : "\t.section\t\".rodata\"")
405 #define SDATA_SECTION_ASM_OP "\t.section \".sdata\",\"aw\""
406 #define SDATA2_SECTION_ASM_OP "\t.section \".sdata2\",\"a\""
407 #define SBSS_SECTION_ASM_OP \
408 ((DEFAULT_ABI == ABI_SOLARIS) ? "\t.section \".sbss\",\"aw\"" : "\t.section \".sbss\",\"aw\",@nobits")
411 /* Besides the usual ELF sections, we need a toc section. */
412 #undef EXTRA_SECTIONS
413 #define EXTRA_SECTIONS in_const, in_ctors, in_dtors, in_toc, in_sdata, in_sdata2, in_sbss, in_init, in_fini
415 #undef EXTRA_SECTION_FUNCTIONS
416 #define EXTRA_SECTION_FUNCTIONS \
417 CONST_SECTION_FUNCTION \
418 CTORS_SECTION_FUNCTION \
419 DTORS_SECTION_FUNCTION \
420 TOC_SECTION_FUNCTION \
421 SDATA_SECTION_FUNCTION \
422 SDATA2_SECTION_FUNCTION \
423 SBSS_SECTION_FUNCTION \
424 INIT_SECTION_FUNCTION \
425 FINI_SECTION_FUNCTION
427 extern void toc_section (), sdata_section (), sdata2_section ();
428 extern void sbss_section ();
430 #define TOC_SECTION_FUNCTION \
434 static int toc_initialized = 0; \
436 if (in_section != in_toc) \
438 in_section = in_toc; \
439 if ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT) \
440 && TARGET_MINIMAL_TOC \
441 && !TARGET_RELOCATABLE) \
443 if (! toc_initialized) \
445 toc_initialized = 1; \
446 fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \
447 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LCTOC", 0); \
448 fprintf (asm_out_file, "\t.tc "); \
449 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1[TC],"); \
450 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
451 fprintf (asm_out_file, "\n"); \
453 fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
454 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
455 fprintf (asm_out_file, " = .+32768\n"); \
458 fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
460 else if ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT) \
461 && !TARGET_RELOCATABLE) \
462 fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \
465 fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
466 if (! toc_initialized) \
468 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
469 fprintf (asm_out_file, " = .+32768\n"); \
470 toc_initialized = 1; \
476 #define SDATA_SECTION_FUNCTION \
480 if (in_section != in_sdata) \
482 in_section = in_sdata; \
483 fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \
487 #define SDATA2_SECTION_FUNCTION \
491 if (in_section != in_sdata2) \
493 in_section = in_sdata2; \
494 fprintf (asm_out_file, "%s\n", SDATA2_SECTION_ASM_OP); \
498 #define SBSS_SECTION_FUNCTION \
502 if (in_section != in_sbss) \
504 in_section = in_sbss; \
505 fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP); \
509 #define INIT_SECTION_FUNCTION \
513 if (in_section != in_init) \
515 in_section = in_init; \
516 fprintf (asm_out_file, "%s\n", INIT_SECTION_ASM_OP); \
520 #define FINI_SECTION_FUNCTION \
524 if (in_section != in_fini) \
526 in_section = in_fini; \
527 fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP); \
531 /* A C statement or statements to switch to the appropriate section
532 for output of RTX in mode MODE. You can assume that RTX is some
533 kind of constant in RTL. The argument MODE is redundant except in
534 the case of a `const_int' rtx. Select the section by calling
535 `text_section' or one of the alternatives for other sections.
537 Do not define this macro if you put all constants in the read-only
540 extern void rs6000_select_rtx_section (), rs6000_select_section ();
542 #undef SELECT_RTX_SECTION
543 #define SELECT_RTX_SECTION(MODE, X) rs6000_select_rtx_section (MODE, X)
545 /* A C statement or statements to switch to the appropriate
546 section for output of DECL. DECL is either a `VAR_DECL' node
547 or a constant of some sort. RELOC indicates whether forming
548 the initial value of DECL requires link-time relocations. */
550 #undef SELECT_SECTION
551 #define SELECT_SECTION(DECL,RELOC) rs6000_select_section (DECL, RELOC)
553 /* Return non-zero if this entry is to be written into the constant pool
554 in a special way. We do so if this is a SYMBOL_REF, LABEL_REF or a CONST
555 containing one of them. If -mfp-in-toc (the default), we also do
556 this for floating-point constants. We actually can only do this
557 if the FP formats of the target and host machines are the same, but
558 we can't check that since not every file that uses
559 GO_IF_LEGITIMATE_ADDRESS_P includes real.h.
561 Unlike AIX, we don't key off of -mmininal-toc, but instead do not
562 allow floating point constants in the TOC if -mrelocatable. */
564 #undef ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
565 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X) \
567 && (GET_CODE (X) == SYMBOL_REF \
568 || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \
569 && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \
570 || GET_CODE (X) == LABEL_REF \
571 || (!TARGET_NO_FP_IN_TOC \
572 && !TARGET_RELOCATABLE \
573 && GET_CODE (X) == CONST_DOUBLE \
574 && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
575 && BITS_PER_WORD == HOST_BITS_PER_INT)))
577 /* These macros generate the special .type and .size directives which
578 are used to set the corresponding fields of the linker symbol table
579 entries in an ELF object file under SVR4. These macros also output
580 the starting labels for the relevant functions/objects. */
582 /* Write the extra assembler code needed to declare a function properly.
583 Some svr4 assemblers need to also have something extra said about the
584 function's return value. We allow for that here. */
586 extern int rs6000_pic_labelno;
588 #undef ASM_DECLARE_FUNCTION_NAME
589 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
592 char *init_ptr = (TARGET_64BIT) ? ".quad" : ".long"; \
593 STRIP_NAME_ENCODING (orig_name, NAME); \
595 if (TARGET_RELOCATABLE && get_pool_size () != 0) \
597 char buf[256], *buf_ptr; \
599 ASM_OUTPUT_INTERNAL_LABEL (FILE, "LCL", rs6000_pic_labelno); \
601 ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1); \
602 STRIP_NAME_ENCODING (buf_ptr, buf); \
603 fprintf (FILE, "\t%s %s-", init_ptr, buf_ptr); \
605 ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); \
606 fprintf (FILE, "%s\n", buf_ptr); \
609 fprintf (FILE, "\t%s\t %s,", TYPE_ASM_OP, orig_name); \
610 fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
612 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
614 if (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT) \
616 char *desc_name = orig_name; \
618 while (*desc_name == '.') \
621 if (TREE_PUBLIC (DECL)) \
622 fprintf (FILE, "\t.globl %s\n", desc_name); \
624 fprintf (FILE, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
625 fprintf (FILE, "%s:\n", desc_name); \
626 fprintf (FILE, "\t%s %s\n", init_ptr, orig_name); \
627 fprintf (FILE, "\t%s _GLOBAL_OFFSET_TABLE_\n", init_ptr); \
628 if (DEFAULT_ABI == ABI_AIX) \
629 fprintf (FILE, "\t%s 0\n", init_ptr); \
630 fprintf (FILE, "\t.previous\n"); \
632 fprintf (FILE, "%s:\n", orig_name); \
635 /* How to renumber registers for dbx and gdb. */
637 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
639 /* svr4.h overrides ASM_OUTPUT_INTERNAL_LABEL. */
641 #undef ASM_OUTPUT_INTERNAL_LABEL_PREFIX
642 #define ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX) \
643 fprintf (FILE, ".%s", PREFIX)
645 /* This is how to allocate empty space in some section. Use .space
646 instead of .zero because the Solaris PowerPC assembler doesn't
647 like it, and gas accepts either syntax. */
650 #define SKIP_ASM_OP ".space"
652 /* This says how to output assembler code to declare an
653 uninitialized internal linkage data object. Under SVR4,
654 the linker seems to want the alignment of data objects
655 to depend on their types. We do exactly that here. */
658 #define LOCAL_ASM_OP ".local"
662 #define LCOMM_ASM_OP ".lcomm"
665 #undef ASM_OUTPUT_ALIGNED_LOCAL
666 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
668 if (TARGET_SDATA && (SIZE) > 0 && (SIZE) <= g_switch_value) \
671 ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT)); \
672 ASM_OUTPUT_LABEL (FILE, NAME); \
673 ASM_OUTPUT_SKIP (FILE, SIZE); \
674 if (!flag_inhibit_size_directive && (SIZE) > 0) \
676 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
677 assemble_name (FILE, NAME); \
678 fprintf (FILE, ",%d\n", SIZE); \
683 fprintf (FILE, "\t%s\t", LCOMM_ASM_OP); \
684 assemble_name ((FILE), (NAME)); \
685 fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
689 /* Describe how to emit unitialized external linkage items */
690 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
692 ASM_GLOBALIZE_LABEL (FILE, NAME); \
693 ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \
696 /* Switch Recognition by gcc.c. Add -G xx support */
698 #undef SWITCH_TAKES_ARG
699 #define SWITCH_TAKES_ARG(CHAR) \
700 ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o' \
701 || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \
702 || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x' \
703 || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V' \
704 || (CHAR) == 'B' || (CHAR) == 'b' || (CHAR) == 'G')
707 #undef ASM_FILE_START
708 #define ASM_FILE_START(FILE) \
710 output_file_directive ((FILE), main_input_filename); \
711 rs6000_file_start (FILE, TARGET_CPU_DEFAULT); \
715 /* This is how to output an assembler line defining an `int' constant.
716 For -mrelocatable, we mark all addresses that need to be fixed up
717 in the .fixup section. */
718 #undef ASM_OUTPUT_INT
719 #define ASM_OUTPUT_INT(FILE,VALUE) \
721 static int recurse = 0; \
722 if (TARGET_RELOCATABLE \
723 && in_section != in_toc \
724 && in_section != in_text \
725 && in_section != in_ctors \
726 && in_section != in_dtors \
728 && GET_CODE (VALUE) != CONST_INT \
729 && GET_CODE (VALUE) != CONST_DOUBLE \
730 && CONSTANT_P (VALUE)) \
732 static int labelno = 0; \
736 ASM_GENERATE_INTERNAL_LABEL (buf, "LCP", labelno++); \
737 STRIP_NAME_ENCODING (p, buf); \
738 fprintf (FILE, "%s:\n", p); \
739 fprintf (FILE, "\t.long ("); \
740 output_addr_const (FILE, (VALUE)); \
741 fprintf (FILE, ")@fixup\n"); \
742 fprintf (FILE, "\t.section \".fixup\",\"aw\"\n"); \
743 ASM_OUTPUT_ALIGN (FILE, 2); \
744 fprintf (FILE, "\t.long\t%s\n", p); \
745 fprintf (FILE, "\t.previous\n"); \
748 /* Remove initial .'s to turn a -mcall-aixdesc or -mcall-nt function \
749 address into the address of the descriptor, not the function \
751 else if (GET_CODE (VALUE) == SYMBOL_REF \
752 && XSTR (VALUE, 0)[0] == '.' \
753 && (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT)) \
755 char *name = XSTR (VALUE, 0); \
756 while (*name == '.') \
759 fprintf (FILE, "\t.long %s\n", name); \
763 fprintf (FILE, "\t.long "); \
764 output_addr_const (FILE, (VALUE)); \
765 fprintf (FILE, "\n"); \
769 /* This is the end of what might become sysv4.h. */
771 /* Allow stabs and dwarf, for now, make stabs the default debugging type,
772 not dwarf since G++ doesn't support dwarf. */
773 #undef PREFERRED_DEBUGGING_TYPE
774 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
776 #define DBX_DEBUGGING_INFO
777 #define DWARF_DEBUGGING_INFO
779 /* If we are referencing a function that is static or is known to be
780 in this file, make the SYMBOL_REF special. We can use this to indicate
781 that we can branch to this function without emitting a no-op after the
782 call. For real AIX and NT calling sequences, we also replace the
783 function name with the real name (1 or 2 leading .'s), rather than
784 the function descriptor name. This saves a lot of overriding code
785 to readd the prefixes. */
787 #undef ENCODE_SECTION_INFO
788 #define ENCODE_SECTION_INFO(DECL) rs6000_encode_section_info (DECL)
790 extern void rs6000_encode_section_info ();
792 /* This macro gets just the user-specified name
793 out of the string in a SYMBOL_REF. Discard
795 #undef STRIP_NAME_ENCODING
796 #define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
798 char *_name = SYMBOL_NAME; \
799 while (*_name == '*' || *_name == '@') \
804 /* This is how to output a reference to a user-level label named NAME.
805 `assemble_name' uses this. */
807 #undef ASM_OUTPUT_LABELREF
808 #define ASM_OUTPUT_LABELREF(FILE,NAME) \
810 char *_name = NAME; \
811 while (*_name == '*' || *_name == '@') \
813 fputs (_name, FILE); \
817 * Switch into a generic section.
819 * We make the section read-only and executable for a function decl,
820 * read-only for a const data decl, and writable for a non-const data decl.
822 * If the section has already been defined, we must not
823 * emit the attributes here. The SVR4 assembler does not
824 * recognize section redefinitions.
825 * If DECL is NULL, no attributes are emitted.
827 * Note, Solaris as doesn't like @nobits, and gas can handle .sbss without
831 #undef ASM_OUTPUT_SECTION_NAME
832 #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \
834 static struct section_info \
836 struct section_info *next; \
838 enum sect_enum {SECT_RW, SECT_RO, SECT_EXEC} type; \
840 struct section_info *s; \
842 enum sect_enum type; \
844 for (s = sections; s; s = s->next) \
845 if (!strcmp (NAME, s->name)) \
848 if (DECL && TREE_CODE (DECL) == FUNCTION_DECL) \
849 type = SECT_EXEC, mode = "ax"; \
850 else if (DECL && TREE_READONLY (DECL)) \
851 type = SECT_RO, mode = "a"; \
853 type = SECT_RW, mode = "aw"; \
857 s = (struct section_info *) xmalloc (sizeof (struct section_info)); \
858 s->name = xmalloc ((strlen (NAME) + 1) * sizeof (*NAME)); \
859 strcpy (s->name, NAME); \
861 s->next = sections; \
863 fprintf (FILE, ".section\t%s,\"%s\"\n", NAME, mode); \
867 if (DECL && s->type != type) \
868 error_with_decl (DECL, "%s causes a section type conflict"); \
870 fprintf (FILE, ".section\t%s\n", NAME); \
874 #undef ASM_OUTPUT_CONSTRUCTOR
875 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
877 if (DEFAULT_ABI != ABI_SOLARIS) \
880 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
881 assemble_name (FILE, NAME); \
886 fputs ("\tbl ", FILE); \
887 assemble_name (FILE, NAME); \
889 fputs ("\n", FILE); \
892 /* A C statement (sans semicolon) to output an element in the table of
893 global destructors. */
894 #undef ASM_OUTPUT_DESTRUCTOR
895 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
897 if (DEFAULT_ABI != ABI_SOLARIS) \
900 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
901 assemble_name (FILE, NAME); \
906 fputs ("\tbl ", FILE); \
907 assemble_name (FILE, NAME); \
909 fputs ("\n", FILE); \
912 /* But, to make this work, we have to output the stabs for the function
915 #define DBX_FUNCTION_FIRST
917 /* This is the end of what might become sysv4dbx.h. */
919 #undef TARGET_VERSION
920 #define TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)");
922 #undef CPP_PREDEFINES
923 #define CPP_PREDEFINES \
924 "-DPPC -Dunix -D__svr4__ -Asystem(unix) -Asystem(svr4) -Acpu(powerpc) -Amachine(powerpc)"
926 /* Pass various options to the assembler */
928 #define ASM_SPEC "%(asm_cpu) %{mregnames} %{mno-regnames} \
929 %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
930 %{mrelocatable} %{mrelocatable-lib} \
931 %{memb} %{!memb: %{msdata: -memb} %{msdata=eabi: -memb}} \
932 %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian} \
933 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
934 %{mcall-solaris: -mlittle} %{mcall-linux: -mbig} }}}}"
937 /* Pass -G xxx to the compiler and set correct endian mode */
938 #define CC1_SPEC "%{G*} \
939 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
940 %{mcall-nt: -mlittle } \
941 %{mcall-aixdesc: -mbig } \
942 %{mcall-solaris: -mlittle } \
943 %{mcall-linux: -mbig} }}}} \
944 %{mcall-solaris: -mregnames } \
945 %{mno-sdata: -msdata=none } \
946 %{meabi: %{!mcall-*: -mcall-sysv }} \
947 %{!meabi: %{!mno-eabi: \
948 %{mrelocatable: -meabi } \
949 %{mcall-solaris: -mno-eabi } \
950 %{mcall-linux: -mno-eabi }}}"
952 /* Don't put -Y P,<path> for cross compilers */
953 #undef LINK_PATH_SPEC
954 #ifndef CROSS_COMPILE
955 #define LINK_PATH_SPEC "\
957 %{!nostdlib: %{!YP,*: \
959 %{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
960 %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}} \
961 %{!R*: %{!L*: -R /usr/ucblib}} \
963 %{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
964 %{!p:-Y P,/usr/ccs/lib:/usr/lib}}}}"
967 #define LINK_PATH_SPEC ""
970 /* Default starting address if specified */
971 #ifndef LINK_START_SPEC
972 #define LINK_START_SPEC "\
973 %{mmvme: %(link_start_mvme) } \
974 %{msim: %(link_start_sim) } \
975 %{mcall-linux: %(link_start_linux) } \
976 %{mcall-solaris: %(link_start_solaris) } \
977 %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(link_start_default) }}}}"
980 #ifndef LINK_START_DEFAULT_SPEC
981 #define LINK_START_DEFAULT_SPEC ""
986 %{h*} %{v:-V} %{G*} \
987 %{Wl,*:%*} %{YP,*} %{R*} \
990 %{!Ttext*: %(link_start) } \
994 /* For now, turn off shared libraries by default. */
995 #ifndef SHARED_LIB_SUPPORT
996 #define NO_SHARED_LIB_SUPPORT
999 #undef LINK_SHLIB_SPEC
1000 #ifndef NO_SHARED_LIB_SUPPORT
1001 /* Shared libaries are default. */
1002 #define LINK_SHLIB_SPEC "\
1003 %{!static: %(link_path) %{!R*:%{L*:-R %*}}} \
1005 %{static:-dn -Bstatic} \
1006 %{shared:-G -dy -z text %{!h*:%{o*:-h %*}}} \
1007 %{symbolic:-Bsymbolic -G -dy -z text %{!h*:%{o*:-h %*}}}"
1010 /* Shared libraries are not default. */
1011 #define LINK_SHLIB_SPEC "\
1012 %{mshlib: %(link_path) } \
1013 %{!mshlib: %{!shared: %{!symbolic: -dn -Bstatic}}} \
1015 %{shared:-G -dy -z text %{!h*:%{o*:-h %*}} %(link_path) } \
1016 %{symbolic:-Bsymbolic -G -dy -z text %{!h*:%{o*:-h %*}} %(link_path) }"
1019 /* Override the default target of the linker. */
1020 #undef LINK_TARGET_SPEC
1021 #define LINK_TARGET_SPEC "\
1022 %{mlittle: -oformat elf32-powerpcle } %{mlittle-endian: -oformat elf32-powerpcle } \
1023 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: %{mcall-solaris: -oformat elf32-powerpcle}}}}}"
1025 /* Any specific OS flags */
1026 #ifndef LINK_OS_SPEC
1027 #define LINK_OS_SPEC "\
1028 %{mmvme: %(link_os_mvme) } \
1029 %{msim: %(link_os_sim) } \
1030 %{mcall-linux: %(link_os_linux) } \
1031 %{mcall-solaris: %(link_os_solaris) } \
1032 %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(link_os_default) }}}}"
1035 #ifndef LINK_OS_DEFAULT_SPEC
1036 #define LINK_OS_DEFAULT_SPEC ""
1039 #undef CPP_SYSV_SPEC
1040 #define CPP_SYSV_SPEC \
1041 "%{mrelocatable*: -D_RELOCATABLE} \
1042 %{mcall-sysv: -D_CALL_SYSV} %{mcall-nt: -D_CALL_NT} \
1043 %{mcall-aix: -D_CALL_AIX} %{mcall-aixdesc: -D_CALL_AIX -D_CALL_AIXDESC} \
1044 %{!mcall-sysv: %{!mcall-aix: %{!mcall-aixdesc: %{!mcall-nt: %(cpp_sysv_default) }}}} \
1045 %{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT}"
1047 #undef CPP_SYSV_DEFAULT_SPEC
1048 #define CPP_SYSV_DEFAULT_SPEC "-D_CALL_SYSV"
1050 /* For solaris, don't define _LITTLE_ENDIAN, it conflicts with a header file. */
1051 #undef CPP_ENDIAN_SPEC
1052 #define CPP_ENDIAN_SPEC \
1053 "%{mlittle: -D_LITTLE_ENDIAN -Amachine(littleendian)} \
1054 %{mlittle-endian: -D_LITTLE_ENDIAN -Amachine(littleendian)} \
1055 %{mbig: -D_BIG_ENDIAN -Amachine(bigendian)} \
1056 %{mbig-endian: -D_BIG_ENDIAN -Amachine(bigendian)} \
1057 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
1058 %{mcall-solaris: -Amachine(littleendian)} \
1059 %{mcall-nt: -D_LITTLE_ENDIAN -Amachine(littleendian)} \
1060 %{mcall-linux: -D_BIG_ENDIAN -Amachine(bigendian)} \
1061 %{mcall-aixdesc: -D_BIG_ENDIAN -Amachine(bigendian)} \
1062 %{!mcall-solaris: %{!mcall-linux: %{!mcall-nt: %{!mcall-aixdesc: %(cpp_endian_default) }}}}}}}}"
1064 #undef CPP_ENDIAN_DEFAULT_SPEC
1065 #define CPP_ENDIAN_DEFAULT_SPEC "-D_BIG_ENDIAN -Amachine(bigendian)"
1068 #define CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_sysv) %(cpp_endian) %(cpp_cpu) \
1069 %{mmvme: %(cpp_os_mvme) } \
1070 %{msim: %(cpp_os_sim) } \
1071 %{mcall-linux: %(cpp_os_linux) } \
1072 %{mcall-solaris: %(cpp_os_solaris) } \
1073 %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(cpp_os_default) }}}}"
1075 #ifndef CPP_OS_DEFAULT_SPEC
1076 #define CPP_OS_DEFAULT_SPEC ""
1079 #undef STARTFILE_SPEC
1080 #define STARTFILE_SPEC "\
1081 %{mmvme: %(startfile_mvme) } \
1082 %{msim: %(startfile_sim) } \
1083 %{mcall-linux: %(startfile_linux) } \
1084 %{mcall-solaris: %(startfile_solaris) } \
1085 %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(startfile_default) }}}}"
1087 #undef STARTFILE_DEFAULT_SPEC
1088 #define STARTFILE_DEFAULT_SPEC ""
1092 %{mmvme: %(lib_mvme) } \
1093 %{msim: %(lib_sim) } \
1094 %{mcall-linux: %(lib_linux) } \
1095 %{mcall-solaris: %(lib_solaris) } \
1096 %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(lib_default) }}}}"
1099 #define LIBGCC_SPEC "libgcc.a%s"
1101 #ifndef LIB_DEFAULT_SPEC
1102 #define LIB_DEFAULT_SPEC ""
1106 #define ENDFILE_SPEC "\
1107 %{mmvme: ecrtn.o%s} \
1108 %{msim: ecrtn.o%s} \
1110 %{mcall-solaris: scrtn.o%s} \
1111 %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(endfile_default) }}}}"
1113 #undef ENDFILE_DEFAULT_SPEC
1114 #define ENDFILE_DEFAULT_SPEC ""
1116 /* Motorola MVME support. */
1117 #ifndef LIB_MVME_SPEC
1118 #define LIB_MVME_SPEC "-( -lmvme -lc -)"
1121 #ifndef STARTFILE_MVME_SPEC
1122 #define STARTFILE_MVME_SPEC "ecrti.o%s mvme-crt0.o%s"
1125 #ifndef ENDFILE_MVME_SPEC
1126 #define ENDFILE_MVME_SPEC "ecrtn.o%s"
1129 #ifndef LINK_START_MVME_SPEC
1130 #define LINK_START_MVME_SPEC ""
1133 #ifndef LINK_OS_MVME_SPEC
1134 #define LINK_OS_MVME_SPEC ""
1137 #ifndef CPP_OS_MVME_SPEC
1138 #define CPP_OS_MVME_SPEC ""
1141 /* PowerPC simulator based on netbsd system calls support. */
1142 #ifndef LIB_SIM_SPEC
1143 #define LIB_SIM_SPEC "-( -lsim -lc -)"
1146 #ifndef STARTFILE_SIM_SPEC
1147 #define STARTFILE_SIM_SPEC "ecrti.o%s sim-crt0.o%s"
1150 #ifndef ENDFILE_SIM_SPEC
1151 #define ENDFILE_SIM_SPEC "ecrtn.o%s"
1154 #ifndef LINK_START_SIM_SPEC
1155 #define LINK_START_SIM_SPEC "-Ttext 0x10000074"
1158 #ifndef LINK_OS_SIM_SPEC
1159 #define LINK_OS_SIM_SPEC ""
1162 #ifndef CPP_OS_SIM_SPEC
1163 #define CPP_OS_SIM_SPEC ""
1166 /* Linux support. */
1167 #ifndef LIB_LINUX_SPEC
1168 #define LIB_LINUX_SPEC "%{mnewlib: -( -llinux -lc -) } %{!mnewlib: -lc }"
1171 #ifndef STARTFILE_LINUX_SPEC
1172 #define STARTFILE_LINUX_SPEC "\
1173 %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
1177 #ifndef ENDFILE_LINUX_SPEC
1178 #define ENDFILE_LINUX_SPEC "scrtn.o%s"
1181 #ifndef LINK_START_LINUX_SPEC
1182 #define LINK_START_LINUX_SPEC "-Ttext 0x400074"
1185 #ifndef LINK_OS_LINUX_SPEC
1186 #define LINK_OS_LINUX_SPEC ""
1189 #ifndef CPP_OS_LINUX_SPEC
1190 #define CPP_OS_LINUX_SPEC "-D__unix__ -D__linux__ \
1191 %{!ansi: -Dunix -Dlinux } \
1192 -Asystem(unix) -Asystem(linux)"
1195 #ifndef CPP_OS_LINUX_SPEC
1196 #define CPP_OS_LINUX_SPEC ""
1199 /* Solaris support. */
1200 /* For Solaris, Gcc automatically adds in one of the files
1201 /usr/ccs/lib/values-Xc.o, /usr/ccs/lib/values-Xa.o, or
1202 /usr/ccs/lib/values-Xt.o for each final link step (depending upon the other
1203 gcc options selected, such as -traditional and -ansi). These files each
1204 contain one (initialized) copy of a special variable called `_lib_version'.
1205 Each one of these files has `_lib_version' initialized to a different (enum)
1206 value. The SVR4 library routines query the value of `_lib_version' at run
1207 to decide how they should behave. Specifically, they decide (based upon the
1208 value of `_lib_version') if they will act in a strictly ANSI conforming
1211 #ifndef LIB_SOLARIS_SPEC
1212 #define LIB_SOLARIS_SPEC "\
1213 %{mnewlib: -( -lsolaris -lc -) } \
1215 %{ansi:values-Xc.o%s} \
1217 %{traditional:values-Xt.o%s} \
1218 %{!traditional:values-Xa.o%s}} \
1219 %{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} \
1220 %{solaris-cclib: /opt/SUNWspro/SC4.0/lib/libabi.a} \
1221 %{!shared: %{!symbolic: -lc }}}"
1224 #ifndef STARTFILE_SOLARIS_SPEC
1225 #define STARTFILE_SOLARIS_SPEC "\
1226 %{!msolaris-cclib: scrti.o%s scrt0.o%s} \
1227 %{msolaris-cclib: /opt/SUNWspro/SC4.0/lib/crti.o%s /opt/SUNWspro/SC4.0/lib/crt1.o%s}"
1230 #ifndef ENDFILE_SOLARIS_SPEC
1231 #define ENDFILE_SOLARIS_SPEC "\
1232 %{!msolaris-cclib: scrtn.o%s} \
1233 %{msolaris-cclib: /opt/SUNWspro/SC4.0/lib/crtn.o%s}"
1236 #ifndef LINK_START_SOLARIS_SPEC
1237 #ifdef CROSS_COMPILER
1238 #define LINK_START_SOLARIS_SPEC "-Ttext 0x2000074"
1240 #define LINK_START_SOLARIS_SPEC ""
1244 #ifndef LINK_OS_SOLARIS_SPEC
1245 #define LINK_OS_SOLARIS_SPEC ""
1248 #ifndef CPP_OS_SOLARIS_SPEC
1249 #define CPP_OS_SOLARIS_SPEC "-D__ppc -D__sun__=1 -D__unix__ -D__svr4__ -D__SVR4__ \
1250 %{!ansi: -Dsun=1 -Dunix -DSVR4 -D__EXTENSIONS__ } \
1254 /* Define any extra SPECS that the compiler needs to generate. */
1255 #undef SUBTARGET_EXTRA_SPECS
1256 #define SUBTARGET_EXTRA_SPECS \
1257 { "lib_mvme", LIB_MVME_SPEC }, \
1258 { "lib_sim", LIB_SIM_SPEC }, \
1259 { "lib_linux", LIB_LINUX_SPEC }, \
1260 { "lib_solaris", LIB_SOLARIS_SPEC }, \
1261 { "lib_default", LIB_DEFAULT_SPEC }, \
1262 { "startfile_mvme", STARTFILE_MVME_SPEC }, \
1263 { "startfile_sim", STARTFILE_SIM_SPEC }, \
1264 { "startfile_linux", STARTFILE_LINUX_SPEC }, \
1265 { "startfile_solaris", STARTFILE_SOLARIS_SPEC }, \
1266 { "startfile_default", STARTFILE_DEFAULT_SPEC }, \
1267 { "endfile_mvme", ENDFILE_MVME_SPEC }, \
1268 { "endfile_sim", ENDFILE_SIM_SPEC }, \
1269 { "endfile_linux", ENDFILE_LINUX_SPEC }, \
1270 { "endfile_solaris", ENDFILE_SOLARIS_SPEC }, \
1271 { "endfile_default", ENDFILE_DEFAULT_SPEC }, \
1272 { "link_path", LINK_PATH_SPEC }, \
1273 { "link_shlib", LINK_SHLIB_SPEC }, \
1274 { "link_target", LINK_TARGET_SPEC }, \
1275 { "link_start", LINK_START_SPEC }, \
1276 { "link_start_mvme", LINK_START_MVME_SPEC }, \
1277 { "link_start_sim", LINK_START_SIM_SPEC }, \
1278 { "link_start_linux", LINK_START_LINUX_SPEC }, \
1279 { "link_start_solaris", LINK_START_SOLARIS_SPEC }, \
1280 { "link_start_default", LINK_START_DEFAULT_SPEC }, \
1281 { "link_os", LINK_OS_SPEC }, \
1282 { "link_os_mvme", LINK_OS_MVME_SPEC }, \
1283 { "link_os_sim", LINK_OS_SIM_SPEC }, \
1284 { "link_os_linux", LINK_OS_LINUX_SPEC }, \
1285 { "link_os_solaris", LINK_OS_SOLARIS_SPEC }, \
1286 { "link_os_default", LINK_OS_DEFAULT_SPEC }, \
1287 { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
1288 { "cpp_os_sim", CPP_OS_SIM_SPEC }, \
1289 { "cpp_os_linux", CPP_OS_LINUX_SPEC }, \
1290 { "cpp_os_solaris", CPP_OS_SOLARIS_SPEC }, \
1291 { "cpp_os_default", CPP_OS_DEFAULT_SPEC },
1293 /* Define this macro as a C expression for the initializer of an
1294 array of string to tell the driver program which options are
1295 defaults for this target and thus do not need to be handled
1296 specially when using `MULTILIB_OPTIONS'.
1298 Do not define this macro if `MULTILIB_OPTIONS' is not defined in
1299 the target makefile fragment or if none of the options listed in
1300 `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */
1302 #undef MULTILIB_DEFAULTS
1303 #define MULTILIB_DEFAULTS { "mbig", "mbig-endian", "mcall-sysv-noeabi", "mno-sdata" }