Pass -mno-regnames to assembler.
[official-gcc.git] / gcc / config / rs6000 / sysv4.h
blob23eaac5b86f8371f63a7780f6b35e93c23d66826
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)
10 any later version.
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 | MASK_RELOCATABLE \
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) */
64 #define TARGET_ELF 1
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 }, \
86 { "no-toc", 0 }, \
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 }, \
96 { "sim", 0 }, \
97 { "mvme", 0 }, \
98 { "emb", 0 }, \
99 { "solaris-cclib", 0 }, \
100 { "newlib", 0 },
102 /* Default ABI to use */
103 #define RS6000_ABI_NAME "sysv"
105 /* Strings provided by SUBTARGET_OPTIONS */
106 extern char *rs6000_abi_name;
107 extern char *rs6000_sdata_name;
109 #define SUBTARGET_OPTIONS \
110 { "call-", &rs6000_abi_name}, \
111 { "sdata=", &rs6000_sdata_name}
113 /* Max # of bytes for variables to automatically be put into the .sdata
114 or .sdata2 sections. */
115 extern int g_switch_value; /* value of the -G xx switch */
116 extern int g_switch_set; /* whether -G xx was passed. */
118 #ifndef SDATA_DEFAULT_SIZE
119 #define SDATA_DEFAULT_SIZE 8
120 #endif
122 /* Sometimes certain combinations of command options do not make sense
123 on a particular target machine. You can define a macro
124 `OVERRIDE_OPTIONS' to take account of this. This macro, if
125 defined, is executed once just after all the command options have
126 been parsed.
128 The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to
129 get control. */
131 #define SUBTARGET_OVERRIDE_OPTIONS \
132 do { \
133 if (!g_switch_set) \
134 g_switch_value = SDATA_DEFAULT_SIZE; \
136 if (!strcmp (rs6000_abi_name, "sysv")) \
137 rs6000_current_abi = ABI_V4; \
138 else if (!strcmp (rs6000_abi_name, "sysv-noeabi")) \
140 rs6000_current_abi = ABI_V4; \
141 target_flags &= ~ MASK_EABI; \
143 else if (!strcmp (rs6000_abi_name, "sysv-eabi") \
144 || !strcmp (rs6000_abi_name, "eabi")) \
146 rs6000_current_abi = ABI_V4; \
147 target_flags |= MASK_EABI; \
149 else if (!strcmp (rs6000_abi_name, "aix")) \
151 rs6000_current_abi = ABI_AIX_NODESC; \
152 target_flags |= MASK_EABI; \
154 else if (!strcmp (rs6000_abi_name, "aixdesc")) \
155 rs6000_current_abi = ABI_AIX; \
156 else if (!strcmp (rs6000_abi_name, "nt")) \
157 rs6000_current_abi = ABI_NT; \
158 else if (!strcmp (rs6000_abi_name, "linux")) \
159 rs6000_current_abi = ABI_V4; \
160 else if (!strcmp (rs6000_abi_name, "solaris")) \
161 rs6000_current_abi = ABI_SOLARIS; \
162 else \
164 rs6000_current_abi = ABI_V4; \
165 error ("Bad value for -mcall-%s", rs6000_abi_name); \
168 if (rs6000_sdata_name) \
170 target_flags |= MASK_SDATA; \
171 if (!strcmp (rs6000_sdata_name, "none")) \
173 rs6000_sdata = SDATA_NONE; \
174 target_flags &= ~MASK_SDATA; \
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; \
184 else \
185 error ("Bad value for -msdata=%s", rs6000_sdata_name); \
187 else if (TARGET_SDATA) \
188 rs6000_sdata = (TARGET_EABI) ? SDATA_EABI : SDATA_SYSV; \
189 else if (!TARGET_RELOCATABLE && !flag_pic && DEFAULT_ABI == ABI_V4) \
191 rs6000_sdata = SDATA_DATA; \
192 target_flags |= MASK_SDATA; \
194 else \
195 rs6000_sdata = SDATA_NONE; \
197 if (TARGET_RELOCATABLE && \
198 (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV)) \
200 target_flags &= ~MASK_SDATA; \
201 rs6000_sdata = SDATA_NONE; \
202 error ("-mrelocatable and -msdata are incompatible."); \
205 if (TARGET_RELOCATABLE && !TARGET_EABI) \
207 target_flags |= ~MASK_EABI; \
208 error ("-mrelocatable and -mno-eabi are incompatible."); \
211 if (TARGET_SDATA && DEFAULT_ABI != ABI_V4 \
212 && DEFAULT_ABI != ABI_SOLARIS) \
214 target_flags &= ~MASK_SDATA; \
215 error ("-msdata and -mcall-aix are incompatible."); \
218 if (TARGET_RELOCATABLE && !TARGET_MINIMAL_TOC) \
220 target_flags |= MASK_MINIMAL_TOC; \
221 error ("-mrelocatable and -mno-minimal-toc are incompatible."); \
224 if (TARGET_RELOCATABLE && \
225 (rs6000_current_abi == ABI_AIX || rs6000_current_abi == ABI_NT)) \
227 target_flags &= ~MASK_RELOCATABLE; \
228 error ("-mrelocatable and -mcall-%s are incompatible.", \
229 rs6000_abi_name); \
232 if (rs6000_current_abi == ABI_AIX && TARGET_LITTLE_ENDIAN) \
234 target_flags &= ~MASK_LITTLE_ENDIAN; \
235 error ("-mcall-aixdesc must be big endian"); \
238 if (rs6000_current_abi == ABI_NT && TARGET_BIG_ENDIAN) \
240 target_flags |= MASK_LITTLE_ENDIAN; \
241 error ("-mcall-nt must be little endian"); \
243 } while (0)
245 /* Default ABI to compile code for */
246 #define DEFAULT_ABI rs6000_current_abi
248 #include "rs6000/powerpc.h"
250 /* System V.4 uses register 13 as a pointer to the small data area,
251 so it is not available to the normal user. */
253 #undef FIXED_R13
254 #define FIXED_R13 1
256 /* System V.4 passes the first 8 floating arguments in registers,
257 instead of the first 13 like AIX does. */
258 #undef FP_ARG_MAX_REG
259 #define FP_ARG_MAX_REG ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_AIX_NODESC) \
260 ? FP_ARG_AIX_MAX_REG : FP_ARG_V4_MAX_REG)
262 /* Size of the V.4 varargs area if needed */
263 #undef RS6000_VARARGS_AREA
264 #define RS6000_VARARGS_AREA ((rs6000_sysv_varargs_p) ? RS6000_VARARGS_SIZE : 0)
266 /* Override default big endianism */
267 #undef BYTES_BIG_ENDIAN
268 #undef WORDS_BIG_ENDIAN
269 #define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN)
270 #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN)
272 /* Define this to set the endianness to use in libgcc2.c, which can
273 not depend on target_flags. */
274 #ifndef _LITTLE_ENDIAN
275 #define LIBGCC2_WORDS_BIG_ENDIAN 1
276 #else
277 #define LIBGCC2_WORDS_BIG_ENDIAN 0
278 #endif
280 /* Size of the outgoing register save area */
281 #undef RS6000_REG_SAVE
282 #define RS6000_REG_SAVE ((DEFAULT_ABI == ABI_AIX \
283 || DEFAULT_ABI == ABI_AIX_NODESC) \
284 ? (TARGET_64BIT ? 64 : 32) \
285 : 0)
287 /* Size of the fixed area on the stack. For AIX, use the standard 6 word
288 area, otherwise use 2 words to store back chain & LR. */
289 #undef RS6000_SAVE_AREA
290 #define RS6000_SAVE_AREA \
291 (((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_AIX_NODESC) ? 24 : 8) << (TARGET_64BIT ? 1 : 0))
293 /* Define cutoff for using external functions to save floating point.
294 Currently on V.4, always use inline stores */
295 #undef FP_SAVE_INLINE
296 #define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 64)
298 /* Don't generate XCOFF debugging information. */
300 #undef XCOFF_DEBUGGING_INFO
302 /* Don't use the COFF object file format. */
304 #undef OBJECT_FORMAT_COFF
306 /* Don't bother to output .extern pseudo-ops. They are not needed by
307 ELF assemblers. */
309 #undef ASM_OUTPUT_EXTERNAL
311 /* Undefine some things which are defined by the generic svr4.h. */
313 #undef ASM_FILE_END
314 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
315 #undef READONLY_DATA_SECTION
316 #undef SELECT_SECTION
317 #undef ASM_DECLARE_FUNCTION_NAME
318 #undef ASM_OUTPUT_CONSTRUCTOR
319 #undef ASM_OUTPUT_DESTRUCTOR
321 /* Use the regular svr4 definitions. */
323 #include "svr4.h"
325 /* Prefix and suffix to use to saving floating point */
326 #undef SAVE_FP_PREFIX
327 #undef SAVE_FP_SUFFIX
328 #define SAVE_FP_PREFIX "_savefpr_"
329 #define SAVE_FP_SUFFIX "_l"
331 /* Prefix and suffix to use to restoring floating point */
332 #undef RESTORE_FP_PREFIX
333 #undef RESTORE_FP_SUFFIX
334 #define RESTORE_FP_PREFIX "_restfpr_"
335 #define RESTORE_FP_SUFFIX "_l"
337 /* Type used for ptrdiff_t, as a string used in a declaration. */
338 #undef PTRDIFF_TYPE
339 #define PTRDIFF_TYPE "int"
341 /* Type used for wchar_t, as a string used in a declaration. */
342 #undef WCHAR_TYPE
343 #define WCHAR_TYPE "short unsigned int"
345 /* Width of wchar_t in bits. */
346 #undef WCHAR_TYPE_SIZE
347 #define WCHAR_TYPE_SIZE 16
349 /* Make int foo : 8 not cause structures to be aligned to an int boundary */
351 #undef PCC_BITFIELD_TYPE_MATTERS
352 #define PCC_BITFIELD_TYPE_MATTERS (TARGET_BITFIELD_TYPE)
354 /* Define this macro to be the value 1 if instructions will fail to
355 work if given data not on the nominal alignment. If instructions
356 will merely go slower in that case, define this macro as 0.
358 Note, little endian systems trap on unaligned addresses, so never
359 turn off strict alignment in that case. */
360 #undef STRICT_ALIGNMENT
361 #define STRICT_ALIGNMENT (TARGET_STRICT_ALIGN || TARGET_LITTLE_ENDIAN)
363 /* Align stack to 8 byte boundaries for eabi, 16 byte boundaries for System V.4 */
364 #undef STACK_BOUNDARY
365 #define STACK_BOUNDARY ((TARGET_EABI) ? 64 : 128)
367 /* No data type wants to be aligned rounder than this. */
368 #undef BIGGEST_ALIGNMENT
369 #define BIGGEST_ALIGNMENT ((TARGET_EABI) ? 64 : 128)
371 #undef BIGGEST_FIELD_ALIGNMENT
372 #undef ADJUST_FIELD_ALIGN
373 #undef ROUND_TYPE_ALIGN
375 /* Use ELF style section commands. */
377 #undef TEXT_SECTION_ASM_OP
378 #define TEXT_SECTION_ASM_OP "\t.section \".text\""
380 #undef DATA_SECTION_ASM_OP
381 #define DATA_SECTION_ASM_OP "\t.section \".data\""
383 #undef BSS_SECTION_ASM_OP
384 #define BSS_SECTION_ASM_OP "\t.section \".bss\""
386 #undef INIT_SECTION_ASM_OP
387 #define INIT_SECTION_ASM_OP "\t.section \".init\",\"ax\""
389 #undef FINI_SECTION_ASM_OP
390 #define FINI_SECTION_ASM_OP "\t.section \".fini\",\"ax\""
392 #define TOC_SECTION_ASM_OP "\t.section \".got\",\"aw\""
394 /* Put PC relative got entries in .got2 */
395 #define MINIMAL_TOC_SECTION_ASM_OP \
396 ((TARGET_RELOCATABLE) ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"")
398 /* Put relocatable data in .data, not .rodata so initialized pointers can be updated */
399 #undef CONST_SECTION_ASM_OP
400 #define CONST_SECTION_ASM_OP \
401 ((TARGET_RELOCATABLE) ? "\t.section\t\".data\"\t# .rodata" : "\t.section\t\".rodata\"")
404 #define SDATA_SECTION_ASM_OP "\t.section \".sdata\",\"aw\""
405 #define SDATA2_SECTION_ASM_OP "\t.section \".sdata2\",\"a\""
406 #define SBSS_SECTION_ASM_OP \
407 ((DEFAULT_ABI == ABI_SOLARIS) ? "\t.section \".sbss\",\"aw\"" : "\t.section \".sbss\",\"aw\",@nobits")
410 /* Besides the usual ELF sections, we need a toc section. */
411 #undef EXTRA_SECTIONS
412 #define EXTRA_SECTIONS in_const, in_ctors, in_dtors, in_toc, in_sdata, in_sdata2, in_sbss, in_init, in_fini
414 #undef EXTRA_SECTION_FUNCTIONS
415 #define EXTRA_SECTION_FUNCTIONS \
416 CONST_SECTION_FUNCTION \
417 CTORS_SECTION_FUNCTION \
418 DTORS_SECTION_FUNCTION \
419 TOC_SECTION_FUNCTION \
420 SDATA_SECTION_FUNCTION \
421 SDATA2_SECTION_FUNCTION \
422 SBSS_SECTION_FUNCTION \
423 INIT_SECTION_FUNCTION \
424 FINI_SECTION_FUNCTION
426 extern void toc_section (), sdata_section (), sdata2_section ();
427 extern void sbss_section ();
429 #define TOC_SECTION_FUNCTION \
430 void \
431 toc_section () \
433 static int toc_initialized = 0; \
435 if (in_section != in_toc) \
437 in_section = in_toc; \
438 if ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT) \
439 && TARGET_MINIMAL_TOC \
440 && !TARGET_RELOCATABLE) \
442 if (! toc_initialized) \
444 toc_initialized = 1; \
445 fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \
446 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LCTOC", 0); \
447 fprintf (asm_out_file, "\t.tc "); \
448 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1[TC],"); \
449 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
450 fprintf (asm_out_file, "\n"); \
452 fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
453 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
454 fprintf (asm_out_file, " = .+32768\n"); \
456 else \
457 fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
459 else if ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT) \
460 && !TARGET_RELOCATABLE) \
461 fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \
462 else \
464 fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
465 if (! toc_initialized) \
467 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
468 fprintf (asm_out_file, " = .+32768\n"); \
469 toc_initialized = 1; \
475 #define SDATA_SECTION_FUNCTION \
476 void \
477 sdata_section () \
479 if (in_section != in_sdata) \
481 in_section = in_sdata; \
482 fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \
486 #define SDATA2_SECTION_FUNCTION \
487 void \
488 sdata2_section () \
490 if (in_section != in_sdata2) \
492 in_section = in_sdata2; \
493 fprintf (asm_out_file, "%s\n", SDATA2_SECTION_ASM_OP); \
497 #define SBSS_SECTION_FUNCTION \
498 void \
499 sbss_section () \
501 if (in_section != in_sbss) \
503 in_section = in_sbss; \
504 fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP); \
508 #define INIT_SECTION_FUNCTION \
509 void \
510 init_section () \
512 if (in_section != in_init) \
514 in_section = in_init; \
515 fprintf (asm_out_file, "%s\n", INIT_SECTION_ASM_OP); \
519 #define FINI_SECTION_FUNCTION \
520 void \
521 fini_section () \
523 if (in_section != in_fini) \
525 in_section = in_fini; \
526 fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP); \
530 /* A C statement or statements to switch to the appropriate section
531 for output of RTX in mode MODE. You can assume that RTX is some
532 kind of constant in RTL. The argument MODE is redundant except in
533 the case of a `const_int' rtx. Select the section by calling
534 `text_section' or one of the alternatives for other sections.
536 Do not define this macro if you put all constants in the read-only
537 data section. */
539 extern void rs6000_select_rtx_section (), rs6000_select_section ();
541 #undef SELECT_RTX_SECTION
542 #define SELECT_RTX_SECTION(MODE, X) rs6000_select_rtx_section (MODE, X)
544 /* A C statement or statements to switch to the appropriate
545 section for output of DECL. DECL is either a `VAR_DECL' node
546 or a constant of some sort. RELOC indicates whether forming
547 the initial value of DECL requires link-time relocations. */
549 #undef SELECT_SECTION
550 #define SELECT_SECTION(DECL,RELOC) rs6000_select_section (DECL, RELOC)
552 /* Return non-zero if this entry is to be written into the constant pool
553 in a special way. We do so if this is a SYMBOL_REF, LABEL_REF or a CONST
554 containing one of them. If -mfp-in-toc (the default), we also do
555 this for floating-point constants. We actually can only do this
556 if the FP formats of the target and host machines are the same, but
557 we can't check that since not every file that uses
558 GO_IF_LEGITIMATE_ADDRESS_P includes real.h.
560 Unlike AIX, we don't key off of -mmininal-toc, but instead do not
561 allow floating point constants in the TOC if -mrelocatable. */
563 #undef ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
564 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X) \
565 (TARGET_TOC \
566 && (GET_CODE (X) == SYMBOL_REF \
567 || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \
568 && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \
569 || GET_CODE (X) == LABEL_REF \
570 || (!TARGET_NO_FP_IN_TOC \
571 && !TARGET_RELOCATABLE \
572 && GET_CODE (X) == CONST_DOUBLE \
573 && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
574 && BITS_PER_WORD == HOST_BITS_PER_INT)))
576 /* These macros generate the special .type and .size directives which
577 are used to set the corresponding fields of the linker symbol table
578 entries in an ELF object file under SVR4. These macros also output
579 the starting labels for the relevant functions/objects. */
581 /* Write the extra assembler code needed to declare a function properly.
582 Some svr4 assemblers need to also have something extra said about the
583 function's return value. We allow for that here. */
585 extern int rs6000_pic_labelno;
587 #undef ASM_DECLARE_FUNCTION_NAME
588 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
589 do { \
590 char *orig_name; \
591 char *init_ptr = (TARGET_64BIT) ? ".quad" : ".long"; \
592 STRIP_NAME_ENCODING (orig_name, NAME); \
594 if (TARGET_RELOCATABLE && get_pool_size () != 0) \
596 char buf[256], *buf_ptr; \
598 ASM_OUTPUT_INTERNAL_LABEL (FILE, "LCL", rs6000_pic_labelno); \
600 ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1); \
601 STRIP_NAME_ENCODING (buf_ptr, buf); \
602 fprintf (FILE, "\t%s %s-", init_ptr, buf_ptr); \
604 ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); \
605 fprintf (FILE, "%s\n", buf_ptr); \
608 fprintf (FILE, "\t%s\t %s,", TYPE_ASM_OP, orig_name); \
609 fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
610 putc ('\n', FILE); \
611 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
613 if (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT) \
615 char *desc_name = orig_name; \
617 while (*desc_name == '.') \
618 desc_name++; \
620 if (TREE_PUBLIC (DECL)) \
621 fprintf (FILE, "\t.globl %s\n", desc_name); \
623 fprintf (FILE, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
624 fprintf (FILE, "%s:\n", desc_name); \
625 fprintf (FILE, "\t%s %s\n", init_ptr, orig_name); \
626 fprintf (FILE, "\t%s _GLOBAL_OFFSET_TABLE_\n", init_ptr); \
627 if (DEFAULT_ABI == ABI_AIX) \
628 fprintf (FILE, "\t%s 0\n", init_ptr); \
629 fprintf (FILE, "\t.previous\n"); \
631 fprintf (FILE, "%s:\n", orig_name); \
632 } while (0)
634 /* How to renumber registers for dbx and gdb. */
636 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
638 /* svr4.h overrides ASM_OUTPUT_INTERNAL_LABEL. */
640 #undef ASM_OUTPUT_INTERNAL_LABEL_PREFIX
641 #define ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX) \
642 fprintf (FILE, ".%s", PREFIX)
644 /* This is how to allocate empty space in some section. Use .space
645 instead of .zero because the Solaris PowerPC assembler doesn't
646 like it, and gas accepts either syntax. */
648 #undef SKIP_ASM_OP
649 #define SKIP_ASM_OP ".space"
651 /* This says how to output assembler code to declare an
652 uninitialized internal linkage data object. Under SVR4,
653 the linker seems to want the alignment of data objects
654 to depend on their types. We do exactly that here. */
656 #ifndef LOCAL_ASM_OP
657 #define LOCAL_ASM_OP ".local"
658 #endif
660 #undef ASM_OUTPUT_ALIGNED_LOCAL
661 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
662 do { \
663 if (TARGET_SDATA && (SIZE) > 0 && (SIZE) <= g_switch_value) \
664 sbss_section (); \
665 else \
666 bss_section (); \
668 ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT)); \
669 ASM_OUTPUT_LABEL (FILE, NAME); \
670 ASM_OUTPUT_SKIP (FILE, SIZE); \
671 } while (0)
673 /* Describe how to emit unitialized external linkage items */
674 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
675 do { \
676 ASM_GLOBALIZE_LABEL (FILE, NAME); \
677 ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \
678 } while (0)
680 /* Switch Recognition by gcc.c. Add -G xx support */
682 #undef SWITCH_TAKES_ARG
683 #define SWITCH_TAKES_ARG(CHAR) \
684 ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o' \
685 || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \
686 || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x' \
687 || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V' \
688 || (CHAR) == 'B' || (CHAR) == 'b' || (CHAR) == 'G')
690 /* Output .file. */
691 #undef ASM_FILE_START
692 #define ASM_FILE_START(FILE) \
693 do { \
694 output_file_directive ((FILE), main_input_filename); \
695 rs6000_file_start (FILE, TARGET_CPU_DEFAULT); \
696 } while (0)
699 /* This is how to output an assembler line defining an `int' constant.
700 For -mrelocatable, we mark all addresses that need to be fixed up
701 in the .fixup section. */
702 #undef ASM_OUTPUT_INT
703 #define ASM_OUTPUT_INT(FILE,VALUE) \
704 do { \
705 static int recurse = 0; \
706 if (TARGET_RELOCATABLE \
707 && in_section != in_toc \
708 && in_section != in_text \
709 && in_section != in_ctors \
710 && in_section != in_dtors \
711 && !recurse \
712 && GET_CODE (VALUE) != CONST_INT \
713 && GET_CODE (VALUE) != CONST_DOUBLE \
714 && CONSTANT_P (VALUE)) \
716 static int labelno = 0; \
717 char buf[256], *p; \
719 recurse = 1; \
720 ASM_GENERATE_INTERNAL_LABEL (buf, "LCP", labelno++); \
721 STRIP_NAME_ENCODING (p, buf); \
722 fprintf (FILE, "%s:\n", p); \
723 fprintf (FILE, "\t.long ("); \
724 output_addr_const (FILE, (VALUE)); \
725 fprintf (FILE, ")@fixup\n"); \
726 fprintf (FILE, "\t.section \".fixup\",\"aw\"\n"); \
727 ASM_OUTPUT_ALIGN (FILE, 2); \
728 fprintf (FILE, "\t.long\t%s\n", p); \
729 fprintf (FILE, "\t.previous\n"); \
730 recurse = 0; \
732 /* Remove initial .'s to turn a -mcall-aixdesc or -mcall-nt function \
733 address into the address of the descriptor, not the function \
734 itself. */ \
735 else if (GET_CODE (VALUE) == SYMBOL_REF \
736 && XSTR (VALUE, 0)[0] == '.' \
737 && (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT)) \
739 char *name = XSTR (VALUE, 0); \
740 while (*name == '.') \
741 name++; \
743 fprintf (FILE, "\t.long %s\n", name); \
745 else \
747 fprintf (FILE, "\t.long "); \
748 output_addr_const (FILE, (VALUE)); \
749 fprintf (FILE, "\n"); \
751 } while (0)
753 /* This is the end of what might become sysv4.h. */
755 /* Allow stabs and dwarf, for now, make stabs the default debugging type,
756 not dwarf since G++ doesn't support dwarf. */
757 #undef PREFERRED_DEBUGGING_TYPE
758 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
760 #define DBX_DEBUGGING_INFO
761 #define DWARF_DEBUGGING_INFO
763 /* If we are referencing a function that is static or is known to be
764 in this file, make the SYMBOL_REF special. We can use this to indicate
765 that we can branch to this function without emitting a no-op after the
766 call. For real AIX and NT calling sequences, we also replace the
767 function name with the real name (1 or 2 leading .'s), rather than
768 the function descriptor name. This saves a lot of overriding code
769 to readd the prefixes. */
771 #undef ENCODE_SECTION_INFO
772 #define ENCODE_SECTION_INFO(DECL) rs6000_encode_section_info (DECL)
774 extern void rs6000_encode_section_info ();
776 /* This macro gets just the user-specified name
777 out of the string in a SYMBOL_REF. Discard
778 a leading * or @. */
779 #undef STRIP_NAME_ENCODING
780 #define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
781 do { \
782 char *_name = SYMBOL_NAME; \
783 while (*_name == '*' || *_name == '@') \
784 _name++; \
785 (VAR) = _name; \
786 } while (0)
788 /* This is how to output a reference to a user-level label named NAME.
789 `assemble_name' uses this. */
791 #undef ASM_OUTPUT_LABELREF
792 #define ASM_OUTPUT_LABELREF(FILE,NAME) \
793 do { \
794 char *_name = NAME; \
795 while (*_name == '*' || *_name == '@') \
796 _name++; \
797 fputs (_name, FILE); \
798 } while (0)
801 * Switch into a generic section.
803 * We make the section read-only and executable for a function decl,
804 * read-only for a const data decl, and writable for a non-const data decl.
806 * If the section has already been defined, we must not
807 * emit the attributes here. The SVR4 assembler does not
808 * recognize section redefinitions.
809 * If DECL is NULL, no attributes are emitted.
811 * Note, Solaris as doesn't like @nobits, and gas can handle .sbss without
812 * needing @nobits.
815 #undef ASM_OUTPUT_SECTION_NAME
816 #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \
817 do { \
818 static struct section_info \
820 struct section_info *next; \
821 char *name; \
822 enum sect_enum {SECT_RW, SECT_RO, SECT_EXEC} type; \
823 } *sections; \
824 struct section_info *s; \
825 char *mode; \
826 enum sect_enum type; \
828 for (s = sections; s; s = s->next) \
829 if (!strcmp (NAME, s->name)) \
830 break; \
832 if (DECL && TREE_CODE (DECL) == FUNCTION_DECL) \
833 type = SECT_EXEC, mode = "ax"; \
834 else if (DECL && TREE_READONLY (DECL)) \
835 type = SECT_RO, mode = "a"; \
836 else \
837 type = SECT_RW, mode = "aw"; \
839 if (s == 0) \
841 s = (struct section_info *) xmalloc (sizeof (struct section_info)); \
842 s->name = xmalloc ((strlen (NAME) + 1) * sizeof (*NAME)); \
843 strcpy (s->name, NAME); \
844 s->type = type; \
845 s->next = sections; \
846 sections = s; \
847 fprintf (FILE, ".section\t%s,\"%s\"\n", NAME, mode); \
849 else \
851 if (DECL && s->type != type) \
852 error_with_decl (DECL, "%s causes a section type conflict"); \
854 fprintf (FILE, ".section\t%s\n", NAME); \
856 } while (0)
858 #undef ASM_OUTPUT_CONSTRUCTOR
859 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
860 do { \
861 if (DEFAULT_ABI != ABI_SOLARIS) \
863 ctors_section (); \
864 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
865 assemble_name (FILE, NAME); \
867 else \
869 init_section (); \
870 fputs ("\tbl ", FILE); \
871 assemble_name (FILE, NAME); \
873 fputs ("\n", FILE); \
874 } while (0)
876 /* A C statement (sans semicolon) to output an element in the table of
877 global destructors. */
878 #undef ASM_OUTPUT_DESTRUCTOR
879 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
880 do { \
881 if (DEFAULT_ABI != ABI_SOLARIS) \
883 dtors_section (); \
884 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
885 assemble_name (FILE, NAME); \
887 else \
889 fini_section (); \
890 fputs ("\tbl ", FILE); \
891 assemble_name (FILE, NAME); \
893 fputs ("\n", FILE); \
894 } while (0)
896 /* But, to make this work, we have to output the stabs for the function
897 name *first*... */
899 #define DBX_FUNCTION_FIRST
901 /* This is the end of what might become sysv4dbx.h. */
903 #undef TARGET_VERSION
904 #define TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)");
906 #undef CPP_PREDEFINES
907 #define CPP_PREDEFINES \
908 "-DPPC -Dunix -D__svr4__ -Asystem(unix) -Asystem(svr4) -Acpu(powerpc) -Amachine(powerpc)"
910 /* Pass various options to the assembler */
911 #undef ASM_SPEC
912 #define ASM_SPEC "%(asm_cpu) %{mregnames} %{mno-regnames} \
913 %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
914 %{mrelocatable} %{mrelocatable-lib} \
915 %{memb} %{!memb: %{msdata: -memb} %{msdata=eabi: -memb}} \
916 %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian} \
917 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
918 %{mcall-solaris: -mlittle} %{mcall-linux: -mbig} }}}}"
920 #undef CC1_SPEC
921 /* Pass -G xxx to the compiler and set correct endian mode */
922 #define CC1_SPEC "%{G*} \
923 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
924 %{mcall-nt: -mlittle } \
925 %{mcall-aixdesc: -mbig } \
926 %{mcall-solaris: -mlittle } \
927 %{mcall-linux: -mbig} }}}} \
928 %{mcall-solaris: -mregnames } \
929 %{mno-sdata: -msdata=none } \
930 %{meabi: %{!mcall-*: -mcall-sysv }} \
931 %{!meabi: %{!mno-eabi: \
932 %{mrelocatable: -meabi } \
933 %{mcall-solaris: -mno-eabi } \
934 %{mcall-linux: -mno-eabi }}}"
936 /* Don't put -Y P,<path> for cross compilers */
937 #undef LINK_PATH_SPEC
938 #ifndef CROSS_COMPILE
939 #define LINK_PATH_SPEC "\
940 %{!nostdlib: %{!YP,*:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
941 %{!p:-Y P,/usr/ccs/lib:/usr/lib}}}"
943 #else
944 #define LINK_PATH_SPEC ""
945 #endif
947 /* Default starting address if specified */
948 #ifndef LINK_START_SPEC
949 #define LINK_START_SPEC "\
950 %{mmvme: %(link_start_mvme) } \
951 %{msim: %(link_start_sim) } \
952 %{mcall-linux: %(link_start_linux) } \
953 %{mcall-solaris: %(link_start_solaris) } \
954 %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(link_start_default) }}}}"
955 #endif
957 #ifndef LINK_START_DEFAULT_SPEC
958 #define LINK_START_DEFAULT_SPEC ""
959 #endif
961 #undef LINK_SPEC
962 #define LINK_SPEC "\
963 %{h*} %{v:-V} %{G*} \
964 %{b} %{Wl,*:%*} \
965 %{static:-dn -Bstatic} \
966 %{shared:-G -dy -z text %{!h*:%{o*:-h %*}}} \
967 %{symbolic:-Bsymbolic -G -dy -z text %{!h*:%{o*:-h %*}}} \
968 %{G:-G} \
969 %{YP,*} \
970 %(link_path) \
971 %{!Ttext*: %(link_start) } \
972 %{Qy:} %{!Qn:-Qy} \
973 %{mlittle: -oformat elf32-powerpcle } %{mlittle-endian: -oformat elf32-powerpcle } \
974 %{mbig: -oformat elf32-powerpc } %{mbig-endian: -oformat elf32-powerpc } \
975 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
976 %{mcall-solaris: -oformat elf32-powerpcle} \
977 %{mcall-linux: -oformat elf32-powerpc} }}}}"
980 #undef CPP_SYSV_SPEC
981 #define CPP_SYSV_SPEC \
982 "%{mrelocatable*: -D_RELOCATABLE} \
983 %{mcall-sysv: -D_CALL_SYSV} %{mcall-nt: -D_CALL_NT} \
984 %{mcall-aix: -D_CALL_AIX} %{mcall-aixdesc: -D_CALL_AIX -D_CALL_AIXDESC} \
985 %{!mcall-sysv: %{!mcall-aix: %{!mcall-aixdesc: %{!mcall-nt: %(cpp_sysv_default) }}}} \
986 %{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT}"
988 #undef CPP_SYSV_DEFAULT_SPEC
989 #define CPP_SYSV_DEFAULT_SPEC "-D_CALL_SYSV"
991 /* For solaris, don't define _LITTLE_ENDIAN, it conflicts with a header file. */
992 #undef CPP_ENDIAN_SPEC
993 #define CPP_ENDIAN_SPEC \
994 "%{mlittle: -D_LITTLE_ENDIAN -Amachine(littleendian)} \
995 %{mlittle-endian: -D_LITTLE_ENDIAN -Amachine(littleendian)} \
996 %{mbig: -D_BIG_ENDIAN -Amachine(bigendian)} \
997 %{mbig-endian: -D_BIG_ENDIAN -Amachine(bigendian)} \
998 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
999 %{mcall-solaris: -Amachine(littleendian)} \
1000 %{mcall-nt: -D_LITTLE_ENDIAN -Amachine(littleendian)} \
1001 %{mcall-linux: -D_BIG_ENDIAN -Amachine(bigendian)} \
1002 %{mcall-aixdesc: -D_BIG_ENDIAN -Amachine(bigendian)} \
1003 %{!mcall-solaris: %{!mcall-linux: %{!mcall-nt: %{!mcall-aixdesc: %(cpp_endian_default_spec) }}}}}}}}"
1005 #undef CPP_ENDIAN_DEFAULT_SPEC
1006 #define CPP_ENDIAN_DEFAULT_SPEC "-D_BIG_ENDIAN -Amachine(bigendian)"
1008 #undef CPP_SPEC
1009 #define CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_sysv) %(cpp_endian) %(cpp_cpu) \
1010 %{mmvme: %(cpp_os_mvme) } \
1011 %{msim: %(cpp_os_sim) } \
1012 %{mcall-linux: %(cpp_os_linux) } \
1013 %{mcall-solaris: %(cpp_os_solaris) } \
1014 %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(cpp_os_default) }}}}"
1016 #ifndef CPP_OS_DEFAULT_SPEC
1017 #define CPP_OS_DEFAULT_SPEC ""
1018 #endif
1020 #undef STARTFILE_SPEC
1021 #define STARTFILE_SPEC "\
1022 %{mmvme: %(startfile_mvme) } \
1023 %{msim: %(startfile_sim) } \
1024 %{mcall-linux: %(startfile_linux) } \
1025 %{mcall-solaris: %(startfile_solaris) } \
1026 %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(startfile_default) }}}}"
1028 #undef STARTFILE_DEFAULT_SPEC
1029 #define STARTFILE_DEFAULT_SPEC ""
1031 #undef LIB_SPEC
1032 #define LIB_SPEC "\
1033 %{mmvme: %(lib_mvme) } \
1034 %{msim: %(lib_sim) } \
1035 %{mcall-linux: %(lib_linux) } \
1036 %{mcall-solaris: %(lib_solaris) } \
1037 %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(lib_default) }}}}"
1039 #undef LIBGCC_SPEC
1040 #define LIBGCC_SPEC "libgcc.a%s"
1042 #ifndef LIB_DEFAULT_SPEC
1043 #define LIB_DEFAULT_SPEC ""
1044 #endif
1046 #undef ENDFILE_SPEC
1047 #define ENDFILE_SPEC "\
1048 %{mmvme: ecrtn.o%s} \
1049 %{msim: ecrtn.o%s} \
1050 %{mcall-linux: } \
1051 %{mcall-solaris: scrtn.o%s} \
1052 %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(endfile_default) }}}}"
1054 #undef ENDFILE_DEFAULT_SPEC
1055 #define ENDFILE_DEFAULT_SPEC ""
1057 /* Motorola MVME support. */
1058 #ifndef LIB_MVME_SPEC
1059 #define LIB_MVME_SPEC "-( -lmvme -lc -)"
1060 #endif
1062 #ifndef STARTFILE_MVME_SPEC
1063 #define STARTFILE_MVME_SPEC "ecrti.o%s mvme-crt0.o%s"
1064 #endif
1066 #ifndef ENDFILE_MVME_SPEC
1067 #define ENDFILE_MVME_SPEC "ecrtn.o%s"
1068 #endif
1070 #ifndef LINK_START_MVME_SPEC
1071 #define LINK_START_MVME_SPEC ""
1072 #endif
1074 #ifndef CPP_OS_MVME_SPEC
1075 #define CPP_OS_MVME_SPEC ""
1076 #endif
1078 /* PowerPC simulator based on netbsd system calls support. */
1079 #ifndef LIB_SIM_SPEC
1080 #define LIB_SIM_SPEC "-( -lsim -lc -)"
1081 #endif
1083 #ifndef STARTFILE_SIM_SPEC
1084 #define STARTFILE_SIM_SPEC "ecrti.o%s sim-crt0.o%s"
1085 #endif
1087 #ifndef ENDFILE_SIM_SPEC
1088 #define ENDFILE_SIM_SPEC "ecrtn.o%s"
1089 #endif
1091 #ifndef LINK_START_SIM_SPEC
1092 #define LINK_START_SIM_SPEC "-Ttext 0x10000074"
1093 #endif
1095 #ifndef CPP_OS_SIM_SPEC
1096 #define CPP_OS_SIM_SPEC ""
1097 #endif
1099 /* Linux support. */
1100 #ifndef LIB_LINUX_SPEC
1101 #define LIB_LINUX_SPEC "%{mnewlib: -( -llinux -lc -) } %{!mnewlib: -lc }"
1102 #endif
1104 #ifndef STARTFILE_LINUX_SPEC
1105 #define STARTFILE_LINUX_SPEC "\
1106 %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
1107 scrti.o%s"
1108 #endif
1110 #ifndef ENDFILE_LINUX_SPEC
1111 #define ENDFILE_LINUX_SPEC "scrtn.o%s"
1112 #endif
1114 #ifndef LINK_START_LINUX_SPEC
1115 #define LINK_START_LINUX_SPEC "-Ttext 0x400074"
1116 #endif
1118 #ifndef CPP_OS_LINUX_SPEC
1119 #define CPP_OS_LINUX_SPEC "-D__unix__ -D__linux__ \
1120 %{!ansi: -Dunix -Dlinux } \
1121 -Asystem(unix) -Asystem(linux)"
1122 #endif
1124 #ifndef CPP_OS_LINUX_SPEC
1125 #define CPP_OS_LINUX_SPEC ""
1126 #endif
1128 /* Solaris support. */
1129 /* For Solaris, Gcc automatically adds in one of the files
1130 /usr/ccs/lib/values-Xc.o, /usr/ccs/lib/values-Xa.o, or
1131 /usr/ccs/lib/values-Xt.o for each final link step (depending upon the other
1132 gcc options selected, such as -traditional and -ansi). These files each
1133 contain one (initialized) copy of a special variable called `_lib_version'.
1134 Each one of these files has `_lib_version' initialized to a different (enum)
1135 value. The SVR4 library routines query the value of `_lib_version' at run
1136 to decide how they should behave. Specifically, they decide (based upon the
1137 value of `_lib_version') if they will act in a strictly ANSI conforming
1138 manner or not. */
1140 #ifndef LIB_SOLARIS_SPEC
1141 #define LIB_SOLARIS_SPEC "\
1142 %{mnewlib: -( -lsolaris -lc -) } \
1143 %{!mnewlib: \
1144 %{ansi:values-Xc.o%s} \
1145 %{!ansi: \
1146 %{traditional:values-Xt.o%s} \
1147 %{!traditional:values-Xa.o%s}} \
1148 %{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} \
1149 %{solaris-cclib: /opt/SUNWspro/SC4.0/lib/libabi.a} \
1150 %{!shared: %{!symbolic: -lc }}}"
1151 #endif
1153 #ifndef STARTFILE_SOLARIS_SPEC
1154 #define STARTFILE_SOLARIS_SPEC "\
1155 %{!msolaris-cclib: scrti.o%s scrt0.o%s} \
1156 %{msolaris-cclib: /opt/SUNWspro/SC4.0/lib/crti.o%s /opt/SUNWspro/SC4.0/lib/crt1.o%s}"
1157 #endif
1159 #ifndef ENDFILE_SOLARIS_SPEC
1160 #define ENDFILE_SOLARIS_SPEC "\
1161 %{!msolaris-cclib: scrtn.o%s} \
1162 %{msolaris-cclib: /opt/SUNWspro/SC4.0/lib/crtn.o%s}"
1163 #endif
1165 #ifndef LINK_START_SOLARIS_SPEC
1166 #ifdef CROSS_COMPILER
1167 #define LINK_START_SOLARIS_SPEC "-Ttext 0x2000074"
1168 #else
1169 #define LINK_START_SOLARIS_SPEC ""
1170 #endif
1171 #endif
1173 #ifndef CPP_OS_SOLARIS_SPEC
1174 #define CPP_OS_SOLARIS_SPEC "-D__ppc -D__sun__=1 -D__unix__ -D__svr4__ -D__SVR4__ \
1175 %{!ansi: -Dsun=1 -Dunix -DSVR4 -D__EXTENSIONS__ } \
1176 -Amachine(prep)"
1177 #endif
1179 /* Define any extra SPECS that the compiler needs to generate. */
1180 #undef SUBTARGET_EXTRA_SPECS
1181 #define SUBTARGET_EXTRA_SPECS \
1182 { "lib_mvme", LIB_MVME_SPEC }, \
1183 { "lib_sim", LIB_SIM_SPEC }, \
1184 { "lib_linux", LIB_LINUX_SPEC }, \
1185 { "lib_solaris", LIB_SOLARIS_SPEC }, \
1186 { "lib_default", LIB_DEFAULT_SPEC }, \
1187 { "startfile_mvme", STARTFILE_MVME_SPEC }, \
1188 { "startfile_sim", STARTFILE_SIM_SPEC }, \
1189 { "startfile_linux", STARTFILE_LINUX_SPEC }, \
1190 { "startfile_solaris", STARTFILE_SOLARIS_SPEC }, \
1191 { "startfile_default", STARTFILE_DEFAULT_SPEC }, \
1192 { "endfile_mvme", ENDFILE_MVME_SPEC }, \
1193 { "endfile_sim", ENDFILE_SIM_SPEC }, \
1194 { "endfile_linux", ENDFILE_LINUX_SPEC }, \
1195 { "endfile_solaris", ENDFILE_SOLARIS_SPEC }, \
1196 { "endfile_default", ENDFILE_DEFAULT_SPEC }, \
1197 { "link_start", LINK_START_SPEC }, \
1198 { "link_start_mvme", LINK_START_MVME_SPEC }, \
1199 { "link_start_sim", LINK_START_SIM_SPEC }, \
1200 { "link_start_linux", LINK_START_LINUX_SPEC }, \
1201 { "link_start_solaris", LINK_START_SOLARIS_SPEC }, \
1202 { "link_start_default", LINK_START_DEFAULT_SPEC }, \
1203 { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
1204 { "cpp_os_sim", CPP_OS_SIM_SPEC }, \
1205 { "cpp_os_linux", CPP_OS_LINUX_SPEC }, \
1206 { "cpp_os_solaris", CPP_OS_SOLARIS_SPEC }, \
1207 { "cpp_os_default", CPP_OS_DEFAULT_SPEC }, \
1208 { "link_path", LINK_PATH_SPEC },
1210 /* Define this macro as a C expression for the initializer of an
1211 array of string to tell the driver program which options are
1212 defaults for this target and thus do not need to be handled
1213 specially when using `MULTILIB_OPTIONS'.
1215 Do not define this macro if `MULTILIB_OPTIONS' is not defined in
1216 the target makefile fragment or if none of the options listed in
1217 `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */
1219 #undef MULTILIB_DEFAULTS
1220 #define MULTILIB_DEFAULTS { "mbig", "mbig-endian", "mcall-sysv-noeabi", "mno-sdata" }