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) \
51 || ((target_flags & (MASK_RELOCATABLE \
52 | MASK_MINIMAL_TOC)) \
54 || DEFAULT_ABI == ABI_AIX \
55 || DEFAULT_ABI == ABI_NT)
57 #define TARGET_BITFIELD_TYPE (! TARGET_NO_BITFIELD_TYPE)
58 #define TARGET_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN)
59 #define TARGET_NO_PROTOTYPE (! TARGET_PROTOTYPE)
60 #define TARGET_NO_TOC (! TARGET_TOC)
61 #define TARGET_NO_EABI (! TARGET_EABI)
63 /* Pseudo target to indicate whether the object format is ELF
64 (to get around not having conditional compilation in the md file) */
67 /* Note, V.4 no longer uses a normal TOC, so make -mfull-toc, be just
68 the same as -mminimal-toc. */
69 #undef SUBTARGET_SWITCHES
70 #define SUBTARGET_SWITCHES \
71 { "bit-align", -MASK_NO_BITFIELD_TYPE }, \
72 { "no-bit-align", MASK_NO_BITFIELD_TYPE }, \
73 { "strict-align", MASK_STRICT_ALIGN }, \
74 { "no-strict-align", -MASK_STRICT_ALIGN }, \
75 { "relocatable", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC }, \
76 { "relocatable", -MASK_SDATA }, \
77 { "no-relocatable", -MASK_RELOCATABLE }, \
78 { "relocatable-lib", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC }, \
79 { "relocatable-lib", -MASK_SDATA }, \
80 { "no-relocatable-lib", -MASK_RELOCATABLE }, \
81 { "sdata", MASK_SDATA }, \
82 { "no-sdata", -MASK_SDATA }, \
83 { "little-endian", MASK_LITTLE_ENDIAN }, \
84 { "little", MASK_LITTLE_ENDIAN }, \
85 { "big-endian", -MASK_LITTLE_ENDIAN }, \
86 { "big", -MASK_LITTLE_ENDIAN }, \
88 { "toc", MASK_MINIMAL_TOC }, \
89 { "full-toc", MASK_MINIMAL_TOC }, \
90 { "prototype", MASK_PROTOTYPE }, \
91 { "no-prototype", -MASK_PROTOTYPE }, \
92 { "no-traceback", 0 }, \
93 { "eabi", MASK_EABI }, \
94 { "no-eabi", -MASK_EABI }, \
95 { "regnames", MASK_REGNAMES }, \
96 { "no-regnames", -MASK_REGNAMES }, \
100 { "solaris-cclib", 0 }, \
104 /* Default ABI to use */
105 #define RS6000_ABI_NAME "sysv"
107 /* Strings provided by SUBTARGET_OPTIONS */
108 extern char *rs6000_abi_name;
109 extern char *rs6000_sdata_name;
111 #define SUBTARGET_OPTIONS \
112 { "call-", &rs6000_abi_name}, \
113 { "sdata=", &rs6000_sdata_name}
115 /* Max # of bytes for variables to automatically be put into the .sdata
116 or .sdata2 sections. */
117 extern int g_switch_value; /* value of the -G xx switch */
118 extern int g_switch_set; /* whether -G xx was passed. */
120 #ifndef SDATA_DEFAULT_SIZE
121 #define SDATA_DEFAULT_SIZE 8
124 /* Sometimes certain combinations of command options do not make sense
125 on a particular target machine. You can define a macro
126 `OVERRIDE_OPTIONS' to take account of this. This macro, if
127 defined, is executed once just after all the command options have
130 The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to
133 #define SUBTARGET_OVERRIDE_OPTIONS \
136 g_switch_value = SDATA_DEFAULT_SIZE; \
138 if (!strcmp (rs6000_abi_name, "sysv")) \
139 rs6000_current_abi = ABI_V4; \
140 else if (!strcmp (rs6000_abi_name, "sysv-noeabi")) \
142 rs6000_current_abi = ABI_V4; \
143 target_flags &= ~ MASK_EABI; \
145 else if (!strcmp (rs6000_abi_name, "sysv-eabi") \
146 || !strcmp (rs6000_abi_name, "eabi")) \
148 rs6000_current_abi = ABI_V4; \
149 target_flags |= MASK_EABI; \
151 else if (!strcmp (rs6000_abi_name, "aix")) \
153 rs6000_current_abi = ABI_AIX_NODESC; \
154 target_flags |= MASK_EABI; \
156 else if (!strcmp (rs6000_abi_name, "aixdesc")) \
157 rs6000_current_abi = ABI_AIX; \
158 else if (!strcmp (rs6000_abi_name, "nt")) \
159 rs6000_current_abi = ABI_NT; \
160 else if (!strcmp (rs6000_abi_name, "linux")) \
161 rs6000_current_abi = ABI_V4; \
162 else if (!strcmp (rs6000_abi_name, "solaris")) \
163 rs6000_current_abi = ABI_SOLARIS; \
166 rs6000_current_abi = ABI_V4; \
167 error ("Bad value for -mcall-%s", rs6000_abi_name); \
170 if (rs6000_sdata_name) \
172 target_flags |= MASK_SDATA; \
173 if (!strcmp (rs6000_sdata_name, "none")) \
175 rs6000_sdata = SDATA_NONE; \
176 target_flags &= ~MASK_SDATA; \
178 else if (!strcmp (rs6000_sdata_name, "data")) \
179 rs6000_sdata = SDATA_DATA; \
180 else if (!strcmp (rs6000_sdata_name, "default")) \
181 rs6000_sdata = (TARGET_EABI) ? SDATA_EABI : SDATA_SYSV; \
182 else if (!strcmp (rs6000_sdata_name, "sysv")) \
183 rs6000_sdata = SDATA_SYSV; \
184 else if (!strcmp (rs6000_sdata_name, "eabi")) \
185 rs6000_sdata = SDATA_EABI; \
187 error ("Bad value for -msdata=%s", rs6000_sdata_name); \
189 else if (TARGET_SDATA && TARGET_EABI) \
191 rs6000_sdata = SDATA_EABI; \
192 rs6000_sdata_name = "eabi"; \
194 else if (TARGET_SDATA) \
196 rs6000_sdata = SDATA_SYSV; \
197 rs6000_sdata_name = "sysv"; \
199 else if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS) \
201 rs6000_sdata = SDATA_DATA; \
202 rs6000_sdata_name = "data"; \
203 target_flags |= MASK_SDATA; \
207 rs6000_sdata = SDATA_NONE; \
208 rs6000_sdata_name = "none"; \
211 if (TARGET_RELOCATABLE && \
212 (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV)) \
214 rs6000_sdata = SDATA_DATA; \
215 error ("-mrelocatable and -msdata=%s are incompatible.", \
216 rs6000_sdata_name); \
219 else if (flag_pic && \
220 (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV)) \
222 rs6000_sdata = SDATA_DATA; \
223 error ("-f%s and -msdata=%s are incompatible.", \
224 (flag_pic > 1) ? "PIC" : "pic", \
225 rs6000_sdata_name); \
228 if (TARGET_SDATA && DEFAULT_ABI != ABI_V4 && DEFAULT_ABI != ABI_SOLARIS) \
230 target_flags &= ~MASK_SDATA; \
231 error ("-msdata and -mcall-%s are incompatible.", rs6000_abi_name); \
234 if (TARGET_RELOCATABLE && !TARGET_MINIMAL_TOC) \
236 target_flags |= MASK_MINIMAL_TOC; \
237 error ("-mrelocatable and -mno-minimal-toc are incompatible."); \
240 if (TARGET_RELOCATABLE && \
241 (rs6000_current_abi == ABI_AIX || rs6000_current_abi == ABI_NT)) \
243 target_flags &= ~MASK_RELOCATABLE; \
244 error ("-mrelocatable and -mcall-%s are incompatible.", \
248 if (flag_pic > 1 && \
249 (rs6000_current_abi == ABI_AIX || rs6000_current_abi == ABI_NT)) \
252 error ("-fPIC and -mcall-%s are incompatible.", \
256 if (rs6000_current_abi == ABI_AIX && TARGET_LITTLE_ENDIAN) \
258 target_flags &= ~MASK_LITTLE_ENDIAN; \
259 error ("-mcall-aixdesc must be big endian"); \
262 if (rs6000_current_abi == ABI_NT && TARGET_BIG_ENDIAN) \
264 target_flags |= MASK_LITTLE_ENDIAN; \
265 error ("-mcall-nt must be little endian"); \
268 /* Treat -fPIC the same as -mrelocatable */ \
270 target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC; \
272 else if (TARGET_RELOCATABLE) \
277 /* Default ABI to compile code for */
278 #define DEFAULT_ABI rs6000_current_abi
280 #include "rs6000/powerpc.h"
282 /* System V.4 uses register 13 as a pointer to the small data area,
283 so it is not available to the normal user. */
288 /* System V.4 passes the first 8 floating arguments in registers,
289 instead of the first 13 like AIX does. */
290 #undef FP_ARG_MAX_REG
291 #define FP_ARG_MAX_REG ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_AIX_NODESC) \
292 ? FP_ARG_AIX_MAX_REG : FP_ARG_V4_MAX_REG)
294 /* Size of the V.4 varargs area if needed */
295 #undef RS6000_VARARGS_AREA
296 #define RS6000_VARARGS_AREA ((rs6000_sysv_varargs_p) ? RS6000_VARARGS_SIZE : 0)
298 /* Override default big endianism */
299 #undef BYTES_BIG_ENDIAN
300 #undef WORDS_BIG_ENDIAN
301 #define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN)
302 #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN)
304 /* Define this to set the endianness to use in libgcc2.c, which can
305 not depend on target_flags. */
306 #if !defined(_LITTLE_ENDIAN) && !defined(__sun__)
307 #define LIBGCC2_WORDS_BIG_ENDIAN 1
309 #define LIBGCC2_WORDS_BIG_ENDIAN 0
312 /* Size of the outgoing register save area */
313 #undef RS6000_REG_SAVE
314 #define RS6000_REG_SAVE ((DEFAULT_ABI == ABI_AIX \
315 || DEFAULT_ABI == ABI_AIX_NODESC) \
316 ? (TARGET_64BIT ? 64 : 32) \
319 /* Size of the fixed area on the stack. For AIX, use the standard 6 word
320 area, otherwise use 2 words to store back chain & LR. */
321 #undef RS6000_SAVE_AREA
322 #define RS6000_SAVE_AREA \
323 (((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_AIX_NODESC) ? 24 : 8) << (TARGET_64BIT ? 1 : 0))
325 /* Define cutoff for using external functions to save floating point.
326 Currently on V.4, always use inline stores */
327 #undef FP_SAVE_INLINE
328 #define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 64)
330 /* Don't generate XCOFF debugging information. */
332 #undef XCOFF_DEBUGGING_INFO
334 /* Don't use the COFF object file format. */
336 #undef OBJECT_FORMAT_COFF
338 /* Don't bother to output .extern pseudo-ops. They are not needed by
341 #undef ASM_OUTPUT_EXTERNAL
343 /* Undefine some things which are defined by the generic svr4.h. */
346 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
347 #undef READONLY_DATA_SECTION
348 #undef SELECT_SECTION
349 #undef ASM_DECLARE_FUNCTION_NAME
350 #undef ASM_OUTPUT_CONSTRUCTOR
351 #undef ASM_OUTPUT_DESTRUCTOR
353 /* Use the regular svr4 definitions. */
357 /* Prefix and suffix to use to saving floating point */
358 #undef SAVE_FP_PREFIX
359 #undef SAVE_FP_SUFFIX
360 #define SAVE_FP_PREFIX "_savefpr_"
361 #define SAVE_FP_SUFFIX "_l"
363 /* Prefix and suffix to use to restoring floating point */
364 #undef RESTORE_FP_PREFIX
365 #undef RESTORE_FP_SUFFIX
366 #define RESTORE_FP_PREFIX "_restfpr_"
367 #define RESTORE_FP_SUFFIX "_l"
369 /* Type used for ptrdiff_t, as a string used in a declaration. */
371 #define PTRDIFF_TYPE "int"
373 /* Type used for wchar_t, as a string used in a declaration. */
375 #define WCHAR_TYPE "long int"
377 /* Width of wchar_t in bits. */
378 #undef WCHAR_TYPE_SIZE
379 #define WCHAR_TYPE_SIZE 32
381 /* Make int foo : 8 not cause structures to be aligned to an int boundary */
383 #undef PCC_BITFIELD_TYPE_MATTERS
384 #define PCC_BITFIELD_TYPE_MATTERS (TARGET_BITFIELD_TYPE)
386 /* Define this macro to be the value 1 if instructions will fail to
387 work if given data not on the nominal alignment. If instructions
388 will merely go slower in that case, define this macro as 0.
390 Note, little endian systems trap on unaligned addresses, so never
391 turn off strict alignment in that case. */
392 #undef STRICT_ALIGNMENT
393 #define STRICT_ALIGNMENT (TARGET_STRICT_ALIGN || TARGET_LITTLE_ENDIAN)
395 /* Alignment in bits of the stack boundary. Note, in order to allow building
396 one set of libraries with -mno-eabi instead of eabi libraries and non-eabi
397 versions, just use 64 as the stack boundary. */
398 #undef STACK_BOUNDARY
399 #define STACK_BOUNDARY 64
401 /* Real stack boundary as mandated by the appropriate ABI */
402 #define ABI_STACK_BOUNDARY ((TARGET_EABI) ? 64 : 128)
404 /* No data type wants to be aligned rounder than this. */
405 #undef BIGGEST_ALIGNMENT
406 #define BIGGEST_ALIGNMENT ((TARGET_EABI) ? 64 : 128)
408 #undef BIGGEST_FIELD_ALIGNMENT
409 #undef ADJUST_FIELD_ALIGN
410 #undef ROUND_TYPE_ALIGN
412 /* Use ELF style section commands. */
414 #undef TEXT_SECTION_ASM_OP
415 #define TEXT_SECTION_ASM_OP "\t.section \".text\""
417 #undef DATA_SECTION_ASM_OP
418 #define DATA_SECTION_ASM_OP "\t.section \".data\""
420 #undef BSS_SECTION_ASM_OP
421 #define BSS_SECTION_ASM_OP "\t.section \".bss\""
423 #undef INIT_SECTION_ASM_OP
424 #define INIT_SECTION_ASM_OP "\t.section \".init\",\"ax\""
426 #undef FINI_SECTION_ASM_OP
427 #define FINI_SECTION_ASM_OP "\t.section \".fini\",\"ax\""
429 #define TOC_SECTION_ASM_OP "\t.section \".got\",\"aw\""
431 /* Put PC relative got entries in .got2 */
432 #define MINIMAL_TOC_SECTION_ASM_OP \
433 ((TARGET_RELOCATABLE || flag_pic) ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"")
435 /* Put relocatable data in .data, not .rodata so initialized pointers can be updated */
436 #undef CONST_SECTION_ASM_OP
437 #define CONST_SECTION_ASM_OP \
438 ((TARGET_RELOCATABLE || flag_pic) ? "\t.section\t\".data\"\t# .rodata" : "\t.section\t\".rodata\"")
441 #define SDATA_SECTION_ASM_OP "\t.section \".sdata\",\"aw\""
442 #define SDATA2_SECTION_ASM_OP "\t.section \".sdata2\",\"a\""
443 #define SBSS_SECTION_ASM_OP \
444 ((DEFAULT_ABI == ABI_SOLARIS) ? "\t.section \".sbss\",\"aw\"" : "\t.section \".sbss\",\"aw\",@nobits")
447 /* Besides the usual ELF sections, we need a toc section. */
448 #undef EXTRA_SECTIONS
449 #define EXTRA_SECTIONS in_const, in_ctors, in_dtors, in_toc, in_sdata, in_sdata2, in_sbss, in_init, in_fini
451 #undef EXTRA_SECTION_FUNCTIONS
452 #define EXTRA_SECTION_FUNCTIONS \
453 CONST_SECTION_FUNCTION \
454 CTORS_SECTION_FUNCTION \
455 DTORS_SECTION_FUNCTION \
456 TOC_SECTION_FUNCTION \
457 SDATA_SECTION_FUNCTION \
458 SDATA2_SECTION_FUNCTION \
459 SBSS_SECTION_FUNCTION \
460 INIT_SECTION_FUNCTION \
461 FINI_SECTION_FUNCTION
463 extern void toc_section (), sdata_section (), sdata2_section ();
464 extern void sbss_section ();
466 #define TOC_SECTION_FUNCTION \
470 static int toc_initialized = 0; \
472 if (in_section != in_toc) \
474 in_section = in_toc; \
475 if ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT) \
476 && TARGET_MINIMAL_TOC \
477 && !TARGET_RELOCATABLE) \
479 if (! toc_initialized) \
481 toc_initialized = 1; \
482 fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \
483 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LCTOC", 0); \
484 fprintf (asm_out_file, "\t.tc "); \
485 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1[TC],"); \
486 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
487 fprintf (asm_out_file, "\n"); \
489 fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
490 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
491 fprintf (asm_out_file, " = .+32768\n"); \
494 fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
496 else if ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT) \
497 && !TARGET_RELOCATABLE) \
498 fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \
501 fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
502 if (! toc_initialized) \
504 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
505 fprintf (asm_out_file, " = .+32768\n"); \
506 toc_initialized = 1; \
512 #define SDATA_SECTION_FUNCTION \
516 if (in_section != in_sdata) \
518 in_section = in_sdata; \
519 fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \
523 #define SDATA2_SECTION_FUNCTION \
527 if (in_section != in_sdata2) \
529 in_section = in_sdata2; \
530 fprintf (asm_out_file, "%s\n", SDATA2_SECTION_ASM_OP); \
534 #define SBSS_SECTION_FUNCTION \
538 if (in_section != in_sbss) \
540 in_section = in_sbss; \
541 fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP); \
545 #define INIT_SECTION_FUNCTION \
549 if (in_section != in_init) \
551 in_section = in_init; \
552 fprintf (asm_out_file, "%s\n", INIT_SECTION_ASM_OP); \
556 #define FINI_SECTION_FUNCTION \
560 if (in_section != in_fini) \
562 in_section = in_fini; \
563 fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP); \
567 /* A C statement or statements to switch to the appropriate section
568 for output of RTX in mode MODE. You can assume that RTX is some
569 kind of constant in RTL. The argument MODE is redundant except in
570 the case of a `const_int' rtx. Select the section by calling
571 `text_section' or one of the alternatives for other sections.
573 Do not define this macro if you put all constants in the read-only
576 extern void rs6000_select_rtx_section (), rs6000_select_section ();
578 #undef SELECT_RTX_SECTION
579 #define SELECT_RTX_SECTION(MODE, X) rs6000_select_rtx_section (MODE, X)
581 /* A C statement or statements to switch to the appropriate
582 section for output of DECL. DECL is either a `VAR_DECL' node
583 or a constant of some sort. RELOC indicates whether forming
584 the initial value of DECL requires link-time relocations. */
586 #undef SELECT_SECTION
587 #define SELECT_SECTION(DECL,RELOC) rs6000_select_section (DECL, RELOC)
589 /* Return non-zero if this entry is to be written into the constant pool
590 in a special way. We do so if this is a SYMBOL_REF, LABEL_REF or a CONST
591 containing one of them. If -mfp-in-toc (the default), we also do
592 this for floating-point constants. We actually can only do this
593 if the FP formats of the target and host machines are the same, but
594 we can't check that since not every file that uses
595 GO_IF_LEGITIMATE_ADDRESS_P includes real.h.
597 Unlike AIX, we don't key off of -mmininal-toc, but instead do not
598 allow floating point constants in the TOC if -mrelocatable. */
600 #undef ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
601 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X) \
603 && (GET_CODE (X) == SYMBOL_REF \
604 || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \
605 && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \
606 || GET_CODE (X) == LABEL_REF \
607 || (!TARGET_NO_FP_IN_TOC \
608 && !TARGET_RELOCATABLE \
609 && GET_CODE (X) == CONST_DOUBLE \
610 && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
611 && BITS_PER_WORD == HOST_BITS_PER_INT)))
613 /* These macros generate the special .type and .size directives which
614 are used to set the corresponding fields of the linker symbol table
615 entries in an ELF object file under SVR4. These macros also output
616 the starting labels for the relevant functions/objects. */
618 /* Write the extra assembler code needed to declare a function properly.
619 Some svr4 assemblers need to also have something extra said about the
620 function's return value. We allow for that here. */
622 extern int rs6000_pic_labelno;
624 #undef ASM_DECLARE_FUNCTION_NAME
625 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
628 char *init_ptr = (TARGET_64BIT) ? ".quad" : ".long"; \
629 STRIP_NAME_ENCODING (orig_name, NAME); \
631 if (TARGET_RELOCATABLE && get_pool_size () != 0) \
633 char buf[256], *buf_ptr; \
635 ASM_OUTPUT_INTERNAL_LABEL (FILE, "LCL", rs6000_pic_labelno); \
637 ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1); \
638 STRIP_NAME_ENCODING (buf_ptr, buf); \
639 fprintf (FILE, "\t%s %s-", init_ptr, buf_ptr); \
641 ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); \
642 fprintf (FILE, "%s\n", buf_ptr); \
645 fprintf (FILE, "\t%s\t %s,", TYPE_ASM_OP, orig_name); \
646 fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
648 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
650 if (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT) \
652 char *desc_name = orig_name; \
654 while (*desc_name == '.') \
657 if (TREE_PUBLIC (DECL)) \
658 fprintf (FILE, "\t.globl %s\n", desc_name); \
660 fprintf (FILE, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
661 fprintf (FILE, "%s:\n", desc_name); \
662 fprintf (FILE, "\t%s %s\n", init_ptr, orig_name); \
663 fprintf (FILE, "\t%s _GLOBAL_OFFSET_TABLE_\n", init_ptr); \
664 if (DEFAULT_ABI == ABI_AIX) \
665 fprintf (FILE, "\t%s 0\n", init_ptr); \
666 fprintf (FILE, "\t.previous\n"); \
668 fprintf (FILE, "%s:\n", orig_name); \
671 /* How to renumber registers for dbx and gdb. */
673 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
675 /* svr4.h overrides ASM_OUTPUT_INTERNAL_LABEL. */
677 #undef ASM_OUTPUT_INTERNAL_LABEL_PREFIX
678 #define ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX) \
679 fprintf (FILE, ".%s", PREFIX)
681 /* This is how to allocate empty space in some section. Use .space
682 instead of .zero because the Solaris PowerPC assembler doesn't
683 like it, and gas accepts either syntax. */
686 #define SKIP_ASM_OP ".space"
688 /* This says how to output assembler code to declare an
689 uninitialized internal linkage data object. Under SVR4,
690 the linker seems to want the alignment of data objects
691 to depend on their types. We do exactly that here. */
694 #define LOCAL_ASM_OP ".local"
698 #define LCOMM_ASM_OP ".lcomm"
701 #undef ASM_OUTPUT_ALIGNED_LOCAL
702 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
704 if (TARGET_SDATA && (SIZE) > 0 && (SIZE) <= g_switch_value) \
707 ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT)); \
708 ASM_OUTPUT_LABEL (FILE, NAME); \
709 ASM_OUTPUT_SKIP (FILE, SIZE); \
710 if (!flag_inhibit_size_directive && (SIZE) > 0) \
712 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
713 assemble_name (FILE, NAME); \
714 fprintf (FILE, ",%d\n", SIZE); \
719 fprintf (FILE, "\t%s\t", LCOMM_ASM_OP); \
720 assemble_name ((FILE), (NAME)); \
721 fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
725 /* Describe how to emit unitialized external linkage items */
726 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
728 ASM_GLOBALIZE_LABEL (FILE, NAME); \
729 ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \
732 /* Switch Recognition by gcc.c. Add -G xx support */
734 #undef SWITCH_TAKES_ARG
735 #define SWITCH_TAKES_ARG(CHAR) \
736 ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o' \
737 || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \
738 || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x' \
739 || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V' \
740 || (CHAR) == 'B' || (CHAR) == 'b' || (CHAR) == 'G')
743 #undef ASM_FILE_START
744 #define ASM_FILE_START(FILE) \
746 output_file_directive ((FILE), main_input_filename); \
747 rs6000_file_start (FILE, TARGET_CPU_DEFAULT); \
751 /* This is how to output an assembler line defining an `int' constant.
752 For -mrelocatable, we mark all addresses that need to be fixed up
753 in the .fixup section. */
754 #undef ASM_OUTPUT_INT
755 #define ASM_OUTPUT_INT(FILE,VALUE) \
757 static int recurse = 0; \
758 if ((TARGET_RELOCATABLE || flag_pic) \
759 && in_section != in_toc \
760 && in_section != in_text \
761 && in_section != in_ctors \
762 && in_section != in_dtors \
764 && GET_CODE (VALUE) != CONST_INT \
765 && GET_CODE (VALUE) != CONST_DOUBLE \
766 && CONSTANT_P (VALUE)) \
768 static int labelno = 0; \
772 ASM_GENERATE_INTERNAL_LABEL (buf, "LCP", labelno++); \
773 STRIP_NAME_ENCODING (p, buf); \
774 fprintf (FILE, "%s:\n", p); \
775 fprintf (FILE, "\t.long ("); \
776 output_addr_const (FILE, (VALUE)); \
777 fprintf (FILE, ")@fixup\n"); \
778 fprintf (FILE, "\t.section \".fixup\",\"aw\"\n"); \
779 ASM_OUTPUT_ALIGN (FILE, 2); \
780 fprintf (FILE, "\t.long\t%s\n", p); \
781 fprintf (FILE, "\t.previous\n"); \
784 /* Remove initial .'s to turn a -mcall-aixdesc or -mcall-nt function \
785 address into the address of the descriptor, not the function \
787 else if (GET_CODE (VALUE) == SYMBOL_REF \
788 && XSTR (VALUE, 0)[0] == '.' \
789 && (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT)) \
791 char *name = XSTR (VALUE, 0); \
792 while (*name == '.') \
795 fprintf (FILE, "\t.long %s\n", name); \
799 fprintf (FILE, "\t.long "); \
800 output_addr_const (FILE, (VALUE)); \
801 fprintf (FILE, "\n"); \
805 /* This is the end of what might become sysv4.h. */
807 /* Allow stabs and dwarf, for now, make stabs the default debugging type,
808 not dwarf since G++ doesn't support dwarf. */
809 #undef PREFERRED_DEBUGGING_TYPE
810 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
812 #define DBX_DEBUGGING_INFO
813 #define DWARF_DEBUGGING_INFO
815 /* If we are referencing a function that is static or is known to be
816 in this file, make the SYMBOL_REF special. We can use this to indicate
817 that we can branch to this function without emitting a no-op after the
818 call. For real AIX and NT calling sequences, we also replace the
819 function name with the real name (1 or 2 leading .'s), rather than
820 the function descriptor name. This saves a lot of overriding code
821 to readd the prefixes. */
823 #undef ENCODE_SECTION_INFO
824 #define ENCODE_SECTION_INFO(DECL) rs6000_encode_section_info (DECL)
826 extern void rs6000_encode_section_info ();
828 /* This macro gets just the user-specified name
829 out of the string in a SYMBOL_REF. Discard
831 #undef STRIP_NAME_ENCODING
832 #define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
834 char *_name = SYMBOL_NAME; \
835 while (*_name == '*' || *_name == '@') \
840 /* This is how to output a reference to a user-level label named NAME.
841 `assemble_name' uses this. */
843 #undef ASM_OUTPUT_LABELREF
844 #define ASM_OUTPUT_LABELREF(FILE,NAME) \
846 char *_name = NAME; \
847 while (*_name == '*' || *_name == '@') \
849 fputs (_name, FILE); \
853 * Switch into a generic section.
855 * We make the section read-only and executable for a function decl,
856 * read-only for a const data decl, and writable for a non-const data decl.
858 * If the section has already been defined, we must not
859 * emit the attributes here. The SVR4 assembler does not
860 * recognize section redefinitions.
861 * If DECL is NULL, no attributes are emitted.
863 * Note, Solaris as doesn't like @nobits, and gas can handle .sbss without
867 #undef ASM_OUTPUT_SECTION_NAME
868 #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
870 static struct section_info \
872 struct section_info *next; \
874 enum sect_enum {SECT_RW, SECT_RO, SECT_EXEC} type; \
876 struct section_info *s; \
878 enum sect_enum type; \
880 for (s = sections; s; s = s->next) \
881 if (!strcmp (NAME, s->name)) \
884 if (DECL && TREE_CODE (DECL) == FUNCTION_DECL) \
885 type = SECT_EXEC, mode = "ax"; \
886 else if (DECL && DECL_READONLY_SECTION (DECL, RELOC) && !TARGET_RELOCATABLE && !flag_pic) \
887 type = SECT_RO, mode = "a"; \
889 type = SECT_RW, mode = "aw"; \
893 s = (struct section_info *) xmalloc (sizeof (struct section_info)); \
894 s->name = xmalloc ((strlen (NAME) + 1) * sizeof (*NAME)); \
895 strcpy (s->name, NAME); \
897 s->next = sections; \
899 fprintf (FILE, ".section\t%s,\"%s\"\n", NAME, mode); \
903 if (DECL && s->type != type) \
904 error_with_decl (DECL, "%s causes a section type conflict"); \
906 fprintf (FILE, ".section\t%s\n", NAME); \
910 #undef ASM_OUTPUT_CONSTRUCTOR
911 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
913 if (DEFAULT_ABI != ABI_SOLARIS) \
916 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
917 assemble_name (FILE, NAME); \
922 fputs ("\tbl ", FILE); \
923 assemble_name (FILE, NAME); \
925 fputs ("\n", FILE); \
928 /* A C statement (sans semicolon) to output an element in the table of
929 global destructors. */
930 #undef ASM_OUTPUT_DESTRUCTOR
931 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
933 if (DEFAULT_ABI != ABI_SOLARIS) \
936 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
937 assemble_name (FILE, NAME); \
942 fputs ("\tbl ", FILE); \
943 assemble_name (FILE, NAME); \
945 fputs ("\n", FILE); \
948 /* But, to make this work, we have to output the stabs for the function
951 #define DBX_FUNCTION_FIRST
953 /* This is the end of what might become sysv4dbx.h. */
955 #undef TARGET_VERSION
956 #define TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)");
958 #undef CPP_PREDEFINES
959 #define CPP_PREDEFINES \
960 "-DPPC -Dunix -D__svr4__ -Asystem(unix) -Asystem(svr4) -Acpu(powerpc) -Amachine(powerpc)"
962 /* Pass various options to the assembler */
964 #define ASM_SPEC "%(asm_cpu) %{mregnames} %{mno-regnames} \
965 %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
966 %{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \
967 %{memb} %{!memb: %{msdata: -memb} %{msdata=eabi: -memb}} \
968 %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian} \
969 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
970 %{mcall-solaris: -mlittle -msolaris} %{mcall-linux: -mbig} }}}}"
973 /* Pass -G xxx to the compiler and set correct endian mode */
974 #define CC1_SPEC "%{G*} \
975 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
976 %{mcall-nt: -mlittle } \
977 %{mcall-aixdesc: -mbig } \
978 %{mcall-solaris: -mlittle } \
979 %{mcall-linux: -mbig} }}}} \
980 %{mcall-solaris: -mregnames } \
981 %{mno-sdata: -msdata=none } \
982 %{meabi: %{!mcall-*: -mcall-sysv }} \
983 %{!meabi: %{!mno-eabi: \
984 %{mrelocatable: -meabi } \
985 %{mcall-solaris: -mno-eabi } \
986 %{mcall-linux: -mno-eabi }}}"
988 /* Don't put -Y P,<path> for cross compilers */
989 #undef LINK_PATH_SPEC
990 #ifndef CROSS_COMPILE
991 #define LINK_PATH_SPEC "\
993 %{!nostdlib: %{!YP,*: \
995 %{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
996 %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}} \
997 %{!R*: %{!L*: -R /usr/ucblib}} \
999 %{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
1000 %{!p:-Y P,/usr/ccs/lib:/usr/lib}}}}"
1003 #define LINK_PATH_SPEC ""
1006 /* Default starting address if specified */
1007 #ifndef LINK_START_SPEC
1008 #define LINK_START_SPEC "\
1009 %{mmvme: %(link_start_mvme) } \
1010 %{msim: %(link_start_sim) } \
1011 %{mcall-linux: %(link_start_linux) } \
1012 %{mcall-solaris: %(link_start_solaris) } \
1013 %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(link_start_default) }}}}"
1016 #ifndef LINK_START_DEFAULT_SPEC
1017 #define LINK_START_DEFAULT_SPEC ""
1021 #define LINK_SPEC "\
1022 %{h*} %{v:-V} %{G*} \
1023 %{Wl,*:%*} %{YP,*} %{R*} \
1026 %{!Ttext*: %(link_start) } \
1030 /* For now, turn off shared libraries by default. */
1031 #ifndef SHARED_LIB_SUPPORT
1032 #define NO_SHARED_LIB_SUPPORT
1035 #undef LINK_SHLIB_SPEC
1036 #ifndef NO_SHARED_LIB_SUPPORT
1037 /* Shared libaries are default. */
1038 #define LINK_SHLIB_SPEC "\
1039 %{!static: %(link_path) %{!R*:%{L*:-R %*}}} \
1041 %{static:-dn -Bstatic} \
1042 %{shared:-G -dy -z text %{!h*:%{o*:-h %*}}} \
1043 %{symbolic:-Bsymbolic -G -dy -z text %{!h*:%{o*:-h %*}}}"
1046 /* Shared libraries are not default. */
1047 #define LINK_SHLIB_SPEC "\
1048 %{mshlib: %(link_path) } \
1049 %{!mshlib: %{!shared: %{!symbolic: -dn -Bstatic}}} \
1051 %{shared:-G -dy -z text %{!h*:%{o*:-h %*}} %(link_path) } \
1052 %{symbolic:-Bsymbolic -G -dy -z text %{!h*:%{o*:-h %*}} %(link_path) }"
1055 /* Override the default target of the linker. */
1056 #undef LINK_TARGET_SPEC
1057 #define LINK_TARGET_SPEC "\
1058 %{mlittle: -oformat elf32-powerpcle } %{mlittle-endian: -oformat elf32-powerpcle } \
1059 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: %{mcall-solaris: -oformat elf32-powerpcle}}}}}"
1061 /* Any specific OS flags */
1062 #ifndef LINK_OS_SPEC
1063 #define LINK_OS_SPEC "\
1064 %{mmvme: %(link_os_mvme) } \
1065 %{msim: %(link_os_sim) } \
1066 %{mcall-linux: %(link_os_linux) } \
1067 %{mcall-solaris: %(link_os_solaris) } \
1068 %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(link_os_default) }}}}"
1071 #ifndef LINK_OS_DEFAULT_SPEC
1072 #define LINK_OS_DEFAULT_SPEC ""
1075 #undef CPP_SYSV_SPEC
1076 #define CPP_SYSV_SPEC \
1077 "%{mrelocatable*: -D_RELOCATABLE} \
1078 %{fpic: -D__PIC__=1 -D__pic__=1} \
1079 %{fPIC: -D__PIC__=2 -D__pic__=2} \
1080 %{mcall-sysv: -D_CALL_SYSV} %{mcall-nt: -D_CALL_NT} \
1081 %{mcall-aix: -D_CALL_AIX} %{mcall-aixdesc: -D_CALL_AIX -D_CALL_AIXDESC} \
1082 %{!mcall-sysv: %{!mcall-aix: %{!mcall-aixdesc: %{!mcall-nt: %(cpp_sysv_default) }}}} \
1083 %{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT}"
1085 #undef CPP_SYSV_DEFAULT_SPEC
1086 #define CPP_SYSV_DEFAULT_SPEC "-D_CALL_SYSV"
1088 #ifndef CPP_ENDIAN_BIG_SPEC
1089 #define CPP_ENDIAN_BIG_SPEC "-D_BIG_ENDIAN -D__BIG_ENDIAN__ -Amachine(bigendian)"
1092 #ifndef CPP_ENDIAN_LITTLE_SPEC
1093 #define CPP_ENDIAN_LITTLE_SPEC "-D_LITTLE_ENDIAN -D__LITTLE_ENDIAN__ -Amachine(littleendian)"
1096 #ifndef CPP_ENDIAN_SOLARIS_SPEC
1097 #define CPP_ENDIAN_SOLARIS_SPEC "-D__LITTLE_ENDIAN__ -Amachine(littleendian)"
1100 /* For solaris, don't define _LITTLE_ENDIAN, it conflicts with a header file. */
1101 #undef CPP_ENDIAN_SPEC
1102 #define CPP_ENDIAN_SPEC \
1103 "%{mlittle: %(cpp_endian_little) } \
1104 %{mlittle-endian: %(cpp_endian_little) } \
1105 %{mbig: %(cpp_endian_big) } \
1106 %{mbig-endian: %(cpp_endian_big) } \
1107 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
1108 %{mcall-solaris: %(cpp_endian_solaris) } \
1109 %{mcall-nt: %(cpp_endian_little) } \
1110 %{mcall-linux: %(cpp_endian_big) } \
1111 %{mcall-aixdesc: %(cpp_endian_big) } \
1112 %{!mcall-solaris: %{!mcall-linux: %{!mcall-nt: %{!mcall-aixdesc: %(cpp_endian_default) }}}}}}}}"
1114 #undef CPP_ENDIAN_DEFAULT_SPEC
1115 #define CPP_ENDIAN_DEFAULT_SPEC "%(cpp_endian_big)"
1118 #define CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_sysv) %(cpp_endian) %(cpp_cpu) \
1119 %{mmvme: %(cpp_os_mvme) } \
1120 %{msim: %(cpp_os_sim) } \
1121 %{mcall-linux: %(cpp_os_linux) } \
1122 %{mcall-solaris: %(cpp_os_solaris) } \
1123 %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(cpp_os_default) }}}}"
1125 #ifndef CPP_OS_DEFAULT_SPEC
1126 #define CPP_OS_DEFAULT_SPEC ""
1129 #undef STARTFILE_SPEC
1130 #define STARTFILE_SPEC "\
1131 %{mmvme: %(startfile_mvme) } \
1132 %{msim: %(startfile_sim) } \
1133 %{mcall-linux: %(startfile_linux) } \
1134 %{mcall-solaris: %(startfile_solaris) } \
1135 %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(startfile_default) }}}}"
1137 #undef STARTFILE_DEFAULT_SPEC
1138 #define STARTFILE_DEFAULT_SPEC ""
1142 %{mmvme: %(lib_mvme) } \
1143 %{msim: %(lib_sim) } \
1144 %{mcall-linux: %(lib_linux) } \
1145 %{mcall-solaris: %(lib_solaris) } \
1146 %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(lib_default) }}}}"
1149 #define LIBGCC_SPEC "libgcc.a%s"
1151 #ifndef LIB_DEFAULT_SPEC
1152 #define LIB_DEFAULT_SPEC ""
1156 #define ENDFILE_SPEC "\
1157 %{mmvme: ecrtn.o%s} \
1158 %{msim: ecrtn.o%s} \
1160 %{mcall-solaris: scrtn.o%s} \
1161 %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(endfile_default) }}}}"
1163 #undef ENDFILE_DEFAULT_SPEC
1164 #define ENDFILE_DEFAULT_SPEC ""
1166 /* Motorola MVME support. */
1167 #ifndef LIB_MVME_SPEC
1168 #define LIB_MVME_SPEC "-( -lmvme -lc -)"
1171 #ifndef STARTFILE_MVME_SPEC
1172 #define STARTFILE_MVME_SPEC "ecrti.o%s mvme-crt0.o%s"
1175 #ifndef ENDFILE_MVME_SPEC
1176 #define ENDFILE_MVME_SPEC "ecrtn.o%s"
1179 #ifndef LINK_START_MVME_SPEC
1180 #define LINK_START_MVME_SPEC ""
1183 #ifndef LINK_OS_MVME_SPEC
1184 #define LINK_OS_MVME_SPEC ""
1187 #ifndef CPP_OS_MVME_SPEC
1188 #define CPP_OS_MVME_SPEC ""
1191 /* PowerPC simulator based on netbsd system calls support. */
1192 #ifndef LIB_SIM_SPEC
1193 #define LIB_SIM_SPEC "-( -lsim -lc -)"
1196 #ifndef STARTFILE_SIM_SPEC
1197 #define STARTFILE_SIM_SPEC "ecrti.o%s sim-crt0.o%s"
1200 #ifndef ENDFILE_SIM_SPEC
1201 #define ENDFILE_SIM_SPEC "ecrtn.o%s"
1204 #ifndef LINK_START_SIM_SPEC
1205 #define LINK_START_SIM_SPEC "-Ttext 0x10000074"
1208 #ifndef LINK_OS_SIM_SPEC
1209 #define LINK_OS_SIM_SPEC ""
1212 #ifndef CPP_OS_SIM_SPEC
1213 #define CPP_OS_SIM_SPEC ""
1216 /* Linux support. */
1217 #ifndef LIB_LINUX_SPEC
1218 #define LIB_LINUX_SPEC "%{mnewlib: -( -llinux -lc -) } %{!mnewlib: -lc }"
1221 #ifndef STARTFILE_LINUX_SPEC
1222 #define STARTFILE_LINUX_SPEC "\
1223 %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
1224 %{mnewlib: ecrti.o%s} \
1225 %{!mnewlib: crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
1228 #ifndef ENDFILE_LINUX_SPEC
1229 #define ENDFILE_LINUX_SPEC "\
1230 %{mnewlib: ecrtn.o%s} \
1231 %{!mnewlib: %{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s}"
1234 #ifndef LINK_START_LINUX_SPEC
1235 #define LINK_START_LINUX_SPEC "-Ttext 0x400074"
1238 #ifndef LINK_OS_LINUX_SPEC
1239 #define LINK_OS_LINUX_SPEC ""
1242 #ifndef CPP_OS_LINUX_SPEC
1243 #define CPP_OS_LINUX_SPEC "-D__unix__ -D__linux__ \
1244 %{!ansi: -Dunix -Dlinux } \
1245 -Asystem(unix) -Asystem(linux)"
1248 #ifndef CPP_OS_LINUX_SPEC
1249 #define CPP_OS_LINUX_SPEC ""
1252 /* Solaris support. */
1253 /* For Solaris, Gcc automatically adds in one of the files
1254 /usr/ccs/lib/values-Xc.o, /usr/ccs/lib/values-Xa.o, or
1255 /usr/ccs/lib/values-Xt.o for each final link step (depending upon the other
1256 gcc options selected, such as -traditional and -ansi). These files each
1257 contain one (initialized) copy of a special variable called `_lib_version'.
1258 Each one of these files has `_lib_version' initialized to a different (enum)
1259 value. The SVR4 library routines query the value of `_lib_version' at run
1260 to decide how they should behave. Specifically, they decide (based upon the
1261 value of `_lib_version') if they will act in a strictly ANSI conforming
1264 #ifndef LIB_SOLARIS_SPEC
1265 #define LIB_SOLARIS_SPEC "\
1266 %{mnewlib: -( -lsolaris -lc -) } \
1268 %{ansi:values-Xc.o%s} \
1270 %{traditional:values-Xt.o%s} \
1271 %{!traditional:values-Xa.o%s}} \
1272 %{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} \
1273 %{solaris-cclib: /opt/SUNWspro/SC4.0/lib/libabi.a} \
1274 %{!shared: %{!symbolic: -lc }}}"
1277 #ifndef STARTFILE_SOLARIS_SPEC
1278 #define STARTFILE_SOLARIS_SPEC "\
1279 %{!msolaris-cclib: scrti.o%s scrt0.o%s} \
1280 %{msolaris-cclib: /opt/SUNWspro/SC4.0/lib/crti.o%s /opt/SUNWspro/SC4.0/lib/crt1.o%s}"
1283 #ifndef ENDFILE_SOLARIS_SPEC
1284 #define ENDFILE_SOLARIS_SPEC "\
1285 %{!msolaris-cclib: scrtn.o%s} \
1286 %{msolaris-cclib: /opt/SUNWspro/SC4.0/lib/crtn.o%s}"
1289 #ifndef LINK_START_SOLARIS_SPEC
1290 #ifdef CROSS_COMPILER
1291 #define LINK_START_SOLARIS_SPEC "-Ttext 0x2000074"
1293 #define LINK_START_SOLARIS_SPEC ""
1297 #ifndef LINK_OS_SOLARIS_SPEC
1298 #define LINK_OS_SOLARIS_SPEC ""
1301 #ifndef CPP_OS_SOLARIS_SPEC
1302 #define CPP_OS_SOLARIS_SPEC "-D__ppc -D__sun__=1 -D__unix__ -D__svr4__ -D__SVR4__ \
1303 %{!ansi: -Dsun=1 -Dunix -DSVR4 -D__EXTENSIONS__ } \
1307 /* Define any extra SPECS that the compiler needs to generate. */
1308 #undef SUBTARGET_EXTRA_SPECS
1309 #define SUBTARGET_EXTRA_SPECS \
1310 { "lib_mvme", LIB_MVME_SPEC }, \
1311 { "lib_sim", LIB_SIM_SPEC }, \
1312 { "lib_linux", LIB_LINUX_SPEC }, \
1313 { "lib_solaris", LIB_SOLARIS_SPEC }, \
1314 { "lib_default", LIB_DEFAULT_SPEC }, \
1315 { "startfile_mvme", STARTFILE_MVME_SPEC }, \
1316 { "startfile_sim", STARTFILE_SIM_SPEC }, \
1317 { "startfile_linux", STARTFILE_LINUX_SPEC }, \
1318 { "startfile_solaris", STARTFILE_SOLARIS_SPEC }, \
1319 { "startfile_default", STARTFILE_DEFAULT_SPEC }, \
1320 { "endfile_mvme", ENDFILE_MVME_SPEC }, \
1321 { "endfile_sim", ENDFILE_SIM_SPEC }, \
1322 { "endfile_linux", ENDFILE_LINUX_SPEC }, \
1323 { "endfile_solaris", ENDFILE_SOLARIS_SPEC }, \
1324 { "endfile_default", ENDFILE_DEFAULT_SPEC }, \
1325 { "link_path", LINK_PATH_SPEC }, \
1326 { "link_shlib", LINK_SHLIB_SPEC }, \
1327 { "link_target", LINK_TARGET_SPEC }, \
1328 { "link_start", LINK_START_SPEC }, \
1329 { "link_start_mvme", LINK_START_MVME_SPEC }, \
1330 { "link_start_sim", LINK_START_SIM_SPEC }, \
1331 { "link_start_linux", LINK_START_LINUX_SPEC }, \
1332 { "link_start_solaris", LINK_START_SOLARIS_SPEC }, \
1333 { "link_start_default", LINK_START_DEFAULT_SPEC }, \
1334 { "link_os", LINK_OS_SPEC }, \
1335 { "link_os_mvme", LINK_OS_MVME_SPEC }, \
1336 { "link_os_sim", LINK_OS_SIM_SPEC }, \
1337 { "link_os_linux", LINK_OS_LINUX_SPEC }, \
1338 { "link_os_solaris", LINK_OS_SOLARIS_SPEC }, \
1339 { "link_os_default", LINK_OS_DEFAULT_SPEC }, \
1340 { "cpp_endian_big", CPP_ENDIAN_BIG_SPEC }, \
1341 { "cpp_endian_little", CPP_ENDIAN_LITTLE_SPEC }, \
1342 { "cpp_endian_solaris", CPP_ENDIAN_SOLARIS_SPEC }, \
1343 { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
1344 { "cpp_os_sim", CPP_OS_SIM_SPEC }, \
1345 { "cpp_os_linux", CPP_OS_LINUX_SPEC }, \
1346 { "cpp_os_solaris", CPP_OS_SOLARIS_SPEC }, \
1347 { "cpp_os_default", CPP_OS_DEFAULT_SPEC },
1349 /* Define this macro as a C expression for the initializer of an
1350 array of string to tell the driver program which options are
1351 defaults for this target and thus do not need to be handled
1352 specially when using `MULTILIB_OPTIONS'.
1354 Do not define this macro if `MULTILIB_OPTIONS' is not defined in
1355 the target makefile fragment or if none of the options listed in
1356 `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */
1358 #undef MULTILIB_DEFAULTS
1359 #define MULTILIB_DEFAULTS { "mbig", "mcall-sysv" }