* Makefile.in (final.o): Depend on target.h.
[official-gcc.git] / gcc / config / rs6000 / sysv4.h
blob9500e72025cb600ee64331fc507a638ab92df953
1 /* Target definitions for GNU compiler for PowerPC running System V.4
2 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001
3 Free Software Foundation, Inc.
4 Contributed by Cygnus Support.
6 This file is part of GNU CC.
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
24 /* Yes! We are ELF. */
25 #define TARGET_OBJECT_FORMAT OBJECT_ELF
27 /* Default ABI to compile code for. */
28 #define DEFAULT_ABI rs6000_current_abi
30 /* Default ABI to use. */
31 #define RS6000_ABI_NAME "sysv"
33 /* Override rs6000.h definition. */
34 #undef ASM_DEFAULT_SPEC
35 #define ASM_DEFAULT_SPEC "-mppc"
37 /* Override rs6000.h definition. */
38 #undef CPP_DEFAULT_SPEC
39 #define CPP_DEFAULT_SPEC "-D_ARCH_PPC"
41 /* Small data support types. */
42 enum rs6000_sdata_type {
43 SDATA_NONE, /* No small data support. */
44 SDATA_DATA, /* Just put data in .sbss/.sdata, don't use relocs. */
45 SDATA_SYSV, /* Use r13 to point to .sdata/.sbss. */
46 SDATA_EABI /* Use r13 like above, r2 points to .sdata2/.sbss2. */
49 extern enum rs6000_sdata_type rs6000_sdata;
51 /* V.4/eabi switches. */
52 #define MASK_NO_BITFIELD_TYPE 0x40000000 /* Set PCC_BITFIELD_TYPE_MATTERS to 0. */
53 #define MASK_STRICT_ALIGN 0x20000000 /* Set STRICT_ALIGNMENT to 1. */
54 #define MASK_RELOCATABLE 0x10000000 /* GOT pointers are PC relative. */
55 #define MASK_EABI 0x08000000 /* Adhere to eabi, not System V spec. */
56 #define MASK_LITTLE_ENDIAN 0x04000000 /* Target is little endian. */
57 #define MASK_REGNAMES 0x02000000 /* Use alternate register names. */
58 #define MASK_PROTOTYPE 0x01000000 /* Only prototyped fcns pass variable args. */
59 #define MASK_LONG_DOUBLE_128 0x00800000 /* Use IEEE quad long double. */
60 #define MASK_NO_BITFIELD_WORD 0x00400000 /* Bitfields cannot cross word boundaries */
62 #define TARGET_NO_BITFIELD_TYPE (target_flags & MASK_NO_BITFIELD_TYPE)
63 #define TARGET_STRICT_ALIGN (target_flags & MASK_STRICT_ALIGN)
64 #define TARGET_RELOCATABLE (target_flags & MASK_RELOCATABLE)
65 #define TARGET_EABI (target_flags & MASK_EABI)
66 #define TARGET_LITTLE_ENDIAN (target_flags & MASK_LITTLE_ENDIAN)
67 #define TARGET_REGNAMES (target_flags & MASK_REGNAMES)
68 #define TARGET_PROTOTYPE (target_flags & MASK_PROTOTYPE)
69 #define TARGET_LONG_DOUBLE_128 (target_flags & MASK_LONG_DOUBLE_128)
70 #define TARGET_NO_BITFIELD_WORD (target_flags & MASK_NO_BITFIELD_WORD)
71 #define TARGET_TOC ((target_flags & MASK_64BIT) \
72 || ((target_flags & (MASK_RELOCATABLE \
73 | MASK_MINIMAL_TOC)) \
74 && flag_pic > 1) \
75 || DEFAULT_ABI == ABI_AIX)
77 #define TARGET_BITFIELD_TYPE (! TARGET_NO_BITFIELD_TYPE)
78 #define TARGET_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN)
79 #define TARGET_NO_PROTOTYPE (! TARGET_PROTOTYPE)
80 #define TARGET_NO_TOC (! TARGET_TOC)
81 #define TARGET_NO_EABI (! TARGET_EABI)
83 /* Strings provided by SUBTARGET_OPTIONS */
84 extern const char *rs6000_abi_name;
85 extern const char *rs6000_sdata_name;
87 /* Override rs6000.h definition. */
88 #undef SUBTARGET_OPTIONS
89 #define SUBTARGET_OPTIONS \
90 { "call-", &rs6000_abi_name, N_("Select ABI calling convention.") }, \
91 { "sdata=", &rs6000_sdata_name, N_("Select method for sdata handling.") }
93 /* Max # of bytes for variables to automatically be put into the .sdata
94 or .sdata2 sections. */
95 extern int g_switch_value; /* Value of the -G xx switch. */
96 extern int g_switch_set; /* Whether -G xx was passed. */
98 #define SDATA_DEFAULT_SIZE 8
100 /* Note, V.4 no longer uses a normal TOC, so make -mfull-toc, be just
101 the same as -mminimal-toc. */
102 /* Override rs6000.h definition. */
103 #undef SUBTARGET_SWITCHES
104 #define SUBTARGET_SWITCHES \
105 { "bit-align", -MASK_NO_BITFIELD_TYPE, \
106 N_("Align to the base type of the bitfield.") }, \
107 { "no-bit-align", MASK_NO_BITFIELD_TYPE, \
108 N_("Don't align to the base type of the bitfield.") }, \
109 { "strict-align", MASK_STRICT_ALIGN, \
110 N_("Don't assume that unaligned accesses are handled by the system") }, \
111 { "no-strict-align", -MASK_STRICT_ALIGN, \
112 N_("Assume that unaligned accesses are handled by the system") }, \
113 { "relocatable", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, \
114 N_("Produce code relocatable at runtime.") }, \
115 { "no-relocatable", -MASK_RELOCATABLE, \
116 N_("Don't produce code relocatable at runtime.") }, \
117 { "relocatable-lib", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, \
118 N_("Produce code relocatable at runtime.") }, \
119 { "no-relocatable-lib", -MASK_RELOCATABLE, \
120 N_("Don't produce code relocatable at runtime.") }, \
121 { "little-endian", MASK_LITTLE_ENDIAN, \
122 N_("Produce little endian code.") }, \
123 { "little", MASK_LITTLE_ENDIAN, \
124 N_("Produce little endian code.") }, \
125 { "big-endian", -MASK_LITTLE_ENDIAN, \
126 N_("Produce big endian code.") }, \
127 { "big", -MASK_LITTLE_ENDIAN, \
128 N_("Produce big endian code.") }, \
129 { "long-double-64", -MASK_LONG_DOUBLE_128, \
130 N_("Use 64 bit long doubles") }, \
131 { "long-double-128", MASK_LONG_DOUBLE_128, \
132 N_("Use 128 bit long doubles") }, \
133 { "no-toc", 0, N_("no description yet") }, \
134 { "toc", MASK_MINIMAL_TOC, N_("no description yet") }, \
135 { "full-toc", MASK_MINIMAL_TOC, N_("no description yet") }, \
136 { "prototype", MASK_PROTOTYPE, N_("no description yet") }, \
137 { "no-prototype", -MASK_PROTOTYPE, N_("no description yet") }, \
138 { "no-traceback", 0, N_("no description yet") }, \
139 { "eabi", MASK_EABI, N_("Use EABI.") }, \
140 { "no-eabi", -MASK_EABI, N_("Don't use EABI.") }, \
141 { "bit-word", -MASK_NO_BITFIELD_WORD, "" }, \
142 { "no-bit-word", MASK_NO_BITFIELD_WORD, \
143 N_("Do not allow bitfields to cross word boundaries") }, \
144 { "regnames", MASK_REGNAMES, \
145 N_("Use alternate register names.") }, \
146 { "no-regnames", -MASK_REGNAMES, \
147 N_("Don't use alternate register names.") }, \
148 { "sdata", 0, N_("no description yet") }, \
149 { "no-sdata", 0, N_("no description yet") }, \
150 { "sim", 0, \
151 N_("Link with libsim.a, libc.a and sim-crt0.o.") }, \
152 { "ads", 0, \
153 N_("Link with libads.a, libc.a and crt0.o.") }, \
154 { "yellowknife", 0, \
155 N_("Link with libyk.a, libc.a and crt0.o.") }, \
156 { "mvme", 0, \
157 N_("Link with libmvme.a, libc.a and crt0.o.") }, \
158 { "emb", 0, \
159 N_("Set the PPC_EMB bit in the ELF flags header") }, \
160 { "vxworks", 0, N_("no description yet") }, \
161 { "solaris-cclib", 0, N_("no description yet") }, \
162 { "shlib", 0, N_("no description yet") }, \
163 EXTRA_SUBTARGET_SWITCHES \
164 { "newlib", 0, N_("no description yet") },
166 /* This is meant to be redefined in the host dependent files. */
167 #define EXTRA_SUBTARGET_SWITCHES
169 /* Sometimes certain combinations of command options do not make sense
170 on a particular target machine. You can define a macro
171 `OVERRIDE_OPTIONS' to take account of this. This macro, if
172 defined, is executed once just after all the command options have
173 been parsed.
175 The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to
176 get control. */
178 #define SUBTARGET_OVERRIDE_OPTIONS \
179 do { \
180 if (!g_switch_set) \
181 g_switch_value = SDATA_DEFAULT_SIZE; \
183 if (!strcmp (rs6000_abi_name, "sysv")) \
184 rs6000_current_abi = ABI_V4; \
185 else if (!strcmp (rs6000_abi_name, "sysv-noeabi")) \
187 rs6000_current_abi = ABI_V4; \
188 target_flags &= ~ MASK_EABI; \
190 else if (!strcmp (rs6000_abi_name, "sysv-eabi") \
191 || !strcmp (rs6000_abi_name, "eabi")) \
193 rs6000_current_abi = ABI_V4; \
194 target_flags |= MASK_EABI; \
196 else if (!strcmp (rs6000_abi_name, "aix")) \
198 rs6000_current_abi = ABI_AIX_NODESC; \
199 target_flags |= MASK_EABI; \
201 else if (!strcmp (rs6000_abi_name, "aixdesc")) \
202 rs6000_current_abi = ABI_AIX; \
203 else if (!strcmp (rs6000_abi_name, "linux")) \
204 rs6000_current_abi = ABI_V4; \
205 else if (!strcmp (rs6000_abi_name, "solaris")) \
206 rs6000_current_abi = ABI_SOLARIS; \
207 else if (!strcmp (rs6000_abi_name, "i960-old")) \
209 rs6000_current_abi = ABI_V4; \
210 target_flags |= (MASK_LITTLE_ENDIAN | MASK_EABI \
211 | MASK_NO_BITFIELD_WORD); \
212 target_flags &= ~MASK_STRICT_ALIGN; \
214 else \
216 rs6000_current_abi = ABI_V4; \
217 error ("Bad value for -mcall-%s", rs6000_abi_name); \
220 if (rs6000_sdata_name) \
222 if (!strcmp (rs6000_sdata_name, "none")) \
223 rs6000_sdata = SDATA_NONE; \
224 else if (!strcmp (rs6000_sdata_name, "data")) \
225 rs6000_sdata = SDATA_DATA; \
226 else if (!strcmp (rs6000_sdata_name, "default")) \
227 rs6000_sdata = (TARGET_EABI) ? SDATA_EABI : SDATA_SYSV; \
228 else if (!strcmp (rs6000_sdata_name, "sysv")) \
229 rs6000_sdata = SDATA_SYSV; \
230 else if (!strcmp (rs6000_sdata_name, "eabi")) \
231 rs6000_sdata = SDATA_EABI; \
232 else \
233 error ("Bad value for -msdata=%s", rs6000_sdata_name); \
235 else if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS) \
237 rs6000_sdata = SDATA_DATA; \
238 rs6000_sdata_name = "data"; \
240 else \
242 rs6000_sdata = SDATA_NONE; \
243 rs6000_sdata_name = "none"; \
246 if (TARGET_RELOCATABLE && \
247 (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV)) \
249 rs6000_sdata = SDATA_DATA; \
250 error ("-mrelocatable and -msdata=%s are incompatible.", \
251 rs6000_sdata_name); \
254 else if (flag_pic && \
255 (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV)) \
257 rs6000_sdata = SDATA_DATA; \
258 error ("-f%s and -msdata=%s are incompatible.", \
259 (flag_pic > 1) ? "PIC" : "pic", \
260 rs6000_sdata_name); \
263 if (rs6000_sdata != SDATA_NONE && DEFAULT_ABI != ABI_V4 \
264 && DEFAULT_ABI != ABI_SOLARIS) \
266 rs6000_sdata = SDATA_NONE; \
267 error ("-msdata=%s and -mcall-%s are incompatible.", \
268 rs6000_sdata_name, rs6000_abi_name); \
271 if (TARGET_RELOCATABLE && !TARGET_MINIMAL_TOC) \
273 target_flags |= MASK_MINIMAL_TOC; \
274 error ("-mrelocatable and -mno-minimal-toc are incompatible."); \
277 if (TARGET_RELOCATABLE && rs6000_current_abi == ABI_AIX) \
279 target_flags &= ~MASK_RELOCATABLE; \
280 error ("-mrelocatable and -mcall-%s are incompatible.", \
281 rs6000_abi_name); \
284 if (flag_pic > 1 && rs6000_current_abi == ABI_AIX) \
286 flag_pic = 0; \
287 error ("-fPIC and -mcall-%s are incompatible.", \
288 rs6000_abi_name); \
291 if (rs6000_current_abi == ABI_AIX && TARGET_LITTLE_ENDIAN) \
293 target_flags &= ~MASK_LITTLE_ENDIAN; \
294 error ("-mcall-aixdesc must be big endian"); \
297 /* Treat -fPIC the same as -mrelocatable. */ \
298 if (flag_pic > 1) \
299 target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC; \
301 else if (TARGET_RELOCATABLE) \
302 flag_pic = 2; \
304 } while (0)
307 /* Override rs6000.h definition. */
308 #undef TARGET_DEFAULT
309 #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS)
311 /* Override rs6000.h definition. */
312 #undef PROCESSOR_DEFAULT
313 #define PROCESSOR_DEFAULT PROCESSOR_PPC750
315 /* System V.4 uses register 13 as a pointer to the small data area,
316 so it is not available to the normal user. */
318 #define FIXED_R13 1
320 /* Size of the V.4 varargs area if needed. */
321 /* Override rs6000.h definition. */
322 #undef RS6000_VARARGS_AREA
323 #define RS6000_VARARGS_AREA ((cfun->machine->sysv_varargs_p) ? RS6000_VARARGS_SIZE : 0)
325 /* Override default big endianism definitions in rs6000.h. */
326 #undef BYTES_BIG_ENDIAN
327 #undef WORDS_BIG_ENDIAN
328 #define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN)
329 #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN)
331 /* Define this to set the endianness to use in libgcc2.c, which can
332 not depend on target_flags. */
333 #if !defined(_LITTLE_ENDIAN) && !defined(__sun__)
334 #define LIBGCC2_WORDS_BIG_ENDIAN 1
335 #else
336 #define LIBGCC2_WORDS_BIG_ENDIAN 0
337 #endif
339 /* Define cutoff for using external functions to save floating point.
340 Currently on V.4, always use inline stores. */
341 #define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 64)
343 /* Put jump tables in read-only memory, rather than in .text. */
344 #define JUMP_TABLES_IN_TEXT_SECTION 0
346 /* Prefix and suffix to use to saving floating point. */
347 #define SAVE_FP_PREFIX "_savefpr_"
348 #define SAVE_FP_SUFFIX "_l"
350 /* Prefix and suffix to use to restoring floating point. */
351 #define RESTORE_FP_PREFIX "_restfpr_"
352 #define RESTORE_FP_SUFFIX "_l"
354 /* Type used for ptrdiff_t, as a string used in a declaration. */
355 #define PTRDIFF_TYPE "int"
357 /* Type used for wchar_t, as a string used in a declaration. */
358 /* Override svr4.h definition. */
359 #undef WCHAR_TYPE
360 #define WCHAR_TYPE "long int"
362 /* Width of wchar_t in bits. */
363 /* Override svr4.h definition. */
364 #undef WCHAR_TYPE_SIZE
365 #define WCHAR_TYPE_SIZE 32
367 /* Define for support of TFmode long double and REAL_ARITHMETIC.
368 PowerPC SVR4 ABI says that long double is 4 words. */
369 #undef LONG_DOUBLE_TYPE_SIZE
370 #define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64)
372 /* Constant which presents upper bound of the above value. */
373 #define MAX_LONG_DOUBLE_TYPE_SIZE 128
375 /* Define this to set long double type size to use in libgcc2.c, which can
376 not depend on target_flags. */
377 #ifdef __LONG_DOUBLE_128__
378 #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128
379 #else
380 #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
381 #endif
383 /* Make int foo : 8 not cause structures to be aligned to an int boundary. */
384 /* Override elfos.h definition. */
385 #undef PCC_BITFIELD_TYPE_MATTERS
386 #define PCC_BITFIELD_TYPE_MATTERS (TARGET_BITFIELD_TYPE)
388 #undef BITFIELD_NBYTES_LIMITED
389 #define BITFIELD_NBYTES_LIMITED (TARGET_NO_BITFIELD_WORD)
391 /* Define this macro to be the value 1 if instructions will fail to
392 work if given data not on the nominal alignment. If instructions
393 will merely go slower in that case, define this macro as 0. */
394 #undef STRICT_ALIGNMENT
395 #define STRICT_ALIGNMENT (TARGET_STRICT_ALIGN)
397 /* Alignment in bits of the stack boundary. Note, in order to allow building
398 one set of libraries with -mno-eabi instead of eabi libraries and non-eabi
399 versions, just use 64 as the stack boundary. */
400 #undef STACK_BOUNDARY
401 #define STACK_BOUNDARY 64
403 /* Real stack boundary as mandated by the appropriate ABI. */
404 #define ABI_STACK_BOUNDARY ((TARGET_EABI) ? 64 : 128)
406 /* No data type wants to be aligned rounder than this. */
407 #undef BIGGEST_ALIGNMENT
408 #define BIGGEST_ALIGNMENT ((TARGET_EABI) ? 64 : 128)
410 #undef BIGGEST_FIELD_ALIGNMENT
411 #undef ADJUST_FIELD_ALIGN
412 #undef ROUND_TYPE_ALIGN
414 /* Use ELF style section commands. */
416 #define TEXT_SECTION_ASM_OP "\t.section\t\".text\""
418 #define DATA_SECTION_ASM_OP "\t.section\t\".data\""
420 #define BSS_SECTION_ASM_OP "\t.section\t\".bss\""
422 /* Override elfos.h definition. */
423 #undef INIT_SECTION_ASM_OP
424 #define INIT_SECTION_ASM_OP "\t.section\t\".init\",\"ax\""
426 /* Override elfos.h definition. */
427 #undef FINI_SECTION_ASM_OP
428 #define FINI_SECTION_ASM_OP "\t.section\t\".fini\",\"ax\""
430 #define TOC_SECTION_ASM_OP "\t.section\t\".got\",\"aw\""
432 /* Put PC relative got entries in .got2. */
433 #define MINIMAL_TOC_SECTION_ASM_OP \
434 ((TARGET_RELOCATABLE || flag_pic) ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"")
436 #define SDATA_SECTION_ASM_OP "\t.section\t\".sdata\",\"aw\""
437 #define SDATA2_SECTION_ASM_OP "\t.section\t\".sdata2\",\"a\""
438 #define SBSS_SECTION_ASM_OP \
439 ((DEFAULT_ABI == ABI_SOLARIS) ? "\t.section\t\".sbss\",\"aw\"" : "\t.section\t\".sbss\",\"aw\",@nobits")
442 /* Besides the usual ELF sections, we need a toc section. */
443 /* Override elfos.h definition. */
444 #undef EXTRA_SECTIONS
445 #define EXTRA_SECTIONS in_const, in_ctors, in_dtors, in_toc, in_sdata, in_sdata2, in_sbss, in_init, in_fini
447 /* Override elfos.h definition. */
448 #undef EXTRA_SECTION_FUNCTIONS
449 #define EXTRA_SECTION_FUNCTIONS \
450 CONST_SECTION_FUNCTION \
451 CTORS_SECTION_FUNCTION \
452 DTORS_SECTION_FUNCTION \
453 TOC_SECTION_FUNCTION \
454 SDATA_SECTION_FUNCTION \
455 SDATA2_SECTION_FUNCTION \
456 SBSS_SECTION_FUNCTION \
457 INIT_SECTION_FUNCTION \
458 FINI_SECTION_FUNCTION
460 #define TOC_SECTION_FUNCTION \
461 void \
462 toc_section () \
464 if (in_section != in_toc) \
466 in_section = in_toc; \
467 if (DEFAULT_ABI == ABI_AIX \
468 && TARGET_MINIMAL_TOC \
469 && !TARGET_RELOCATABLE) \
471 if (! toc_initialized) \
473 toc_initialized = 1; \
474 fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \
475 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LCTOC", 0); \
476 fprintf (asm_out_file, "\t.tc "); \
477 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1[TC],"); \
478 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
479 fprintf (asm_out_file, "\n"); \
481 fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
482 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
483 fprintf (asm_out_file, " = .+32768\n"); \
485 else \
486 fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
488 else if (DEFAULT_ABI == ABI_AIX && !TARGET_RELOCATABLE) \
489 fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \
490 else \
492 fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
493 if (! toc_initialized) \
495 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
496 fprintf (asm_out_file, " = .+32768\n"); \
497 toc_initialized = 1; \
503 #define SDATA_SECTION_FUNCTION \
504 void \
505 sdata_section () \
507 if (in_section != in_sdata) \
509 in_section = in_sdata; \
510 fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \
514 #define SDATA2_SECTION_FUNCTION \
515 void \
516 sdata2_section () \
518 if (in_section != in_sdata2) \
520 in_section = in_sdata2; \
521 fprintf (asm_out_file, "%s\n", SDATA2_SECTION_ASM_OP); \
525 #define SBSS_SECTION_FUNCTION \
526 void \
527 sbss_section () \
529 if (in_section != in_sbss) \
531 in_section = in_sbss; \
532 fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP); \
536 #define INIT_SECTION_FUNCTION \
537 void \
538 init_section () \
540 if (in_section != in_init) \
542 in_section = in_init; \
543 fprintf (asm_out_file, "%s\n", INIT_SECTION_ASM_OP); \
547 #define FINI_SECTION_FUNCTION \
548 void \
549 fini_section () \
551 if (in_section != in_fini) \
553 in_section = in_fini; \
554 fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP); \
558 /* A C statement or statements to switch to the appropriate section
559 for output of RTX in mode MODE. You can assume that RTX is some
560 kind of constant in RTL. The argument MODE is redundant except in
561 the case of a `const_int' rtx. Select the section by calling
562 `text_section' or one of the alternatives for other sections.
564 Do not define this macro if you put all constants in the read-only
565 data section. */
567 /* Override elfos.h definition. */
568 #undef SELECT_RTX_SECTION
569 #define SELECT_RTX_SECTION(MODE, X) rs6000_select_rtx_section (MODE, X)
571 /* A C statement or statements to switch to the appropriate
572 section for output of DECL. DECL is either a `VAR_DECL' node
573 or a constant of some sort. RELOC indicates whether forming
574 the initial value of DECL requires link-time relocations. */
576 /* Override elfos.h definition. */
577 #undef SELECT_SECTION
578 #define SELECT_SECTION(DECL, RELOC) rs6000_select_section (DECL, RELOC)
580 /* A C statement to build up a unique section name, expressed as a
581 STRING_CST node, and assign it to DECL_SECTION_NAME (decl).
582 RELOC indicates whether the initial value of EXP requires
583 link-time relocations. If you do not define this macro, GCC will use
584 the symbol name prefixed by `.' as the section name. Note - this
585 macro can now be called for unitialised data items as well as
586 initialised data and functions. */
588 /* Override elfos.h definition. */
589 #undef UNIQUE_SECTION
590 #define UNIQUE_SECTION(DECL, RELOC) rs6000_unique_section (DECL, RELOC)
592 /* Return non-zero if this entry is to be written into the constant pool
593 in a special way. We do so if this is a SYMBOL_REF, LABEL_REF or a CONST
594 containing one of them. If -mfp-in-toc (the default), we also do
595 this for floating-point constants. We actually can only do this
596 if the FP formats of the target and host machines are the same, but
597 we can't check that since not every file that uses
598 GO_IF_LEGITIMATE_ADDRESS_P includes real.h.
600 Unlike AIX, we don't key off of -mminimal-toc, but instead do not
601 allow floating point constants in the TOC if -mrelocatable. */
603 #undef ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
604 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) \
605 (TARGET_TOC \
606 && (GET_CODE (X) == SYMBOL_REF \
607 || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \
608 && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \
609 || GET_CODE (X) == LABEL_REF \
610 || (GET_CODE (X) == CONST_INT \
611 && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode)) \
612 || (!TARGET_NO_FP_IN_TOC \
613 && !TARGET_RELOCATABLE \
614 && GET_CODE (X) == CONST_DOUBLE \
615 && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
616 && BITS_PER_WORD == HOST_BITS_PER_INT)))
618 /* These macros generate the special .type and .size directives which
619 are used to set the corresponding fields of the linker symbol table
620 entries in an ELF object file under SVR4. These macros also output
621 the starting labels for the relevant functions/objects. */
623 /* Write the extra assembler code needed to declare a function properly.
624 Some svr4 assemblers need to also have something extra said about the
625 function's return value. We allow for that here. */
627 extern int rs6000_pic_labelno;
629 /* Override elfos.h definition. */
630 #undef ASM_DECLARE_FUNCTION_NAME
631 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
632 do { \
633 const char *init_ptr = (TARGET_64BIT) ? ".quad" : ".long"; \
635 if (TARGET_RELOCATABLE && (get_pool_size () != 0 || profile_flag) \
636 && uses_TOC()) \
638 char buf[256]; \
640 ASM_OUTPUT_INTERNAL_LABEL (FILE, "LCL", rs6000_pic_labelno); \
642 ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1); \
643 fprintf (FILE, "\t%s ", init_ptr); \
644 assemble_name (FILE, buf); \
645 putc ('-', FILE); \
646 ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); \
647 assemble_name (FILE, buf); \
648 putc ('\n', FILE); \
651 fprintf (FILE, "%s", TYPE_ASM_OP); \
652 assemble_name (FILE, NAME); \
653 putc (',', FILE); \
654 fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
655 putc ('\n', FILE); \
656 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
658 if (DEFAULT_ABI == ABI_AIX) \
660 const char *desc_name, *orig_name; \
662 STRIP_NAME_ENCODING (orig_name, NAME); \
663 desc_name = orig_name; \
664 while (*desc_name == '.') \
665 desc_name++; \
667 if (TREE_PUBLIC (DECL)) \
668 fprintf (FILE, "\t.globl %s\n", desc_name); \
670 fprintf (FILE, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
671 fprintf (FILE, "%s:\n", desc_name); \
672 fprintf (FILE, "\t%s %s\n", init_ptr, orig_name); \
673 fprintf (FILE, "\t%s _GLOBAL_OFFSET_TABLE_\n", init_ptr); \
674 if (DEFAULT_ABI == ABI_AIX) \
675 fprintf (FILE, "\t%s 0\n", init_ptr); \
676 fprintf (FILE, "\t.previous\n"); \
678 ASM_OUTPUT_LABEL (FILE, NAME); \
679 } while (0)
681 /* A C compound statement that outputs the assembler code for a thunk function,
682 used to implement C++ virtual function calls with multiple inheritance. The
683 thunk acts as a wrapper around a virtual function, adjusting the implicit
684 object parameter before handing control off to the real function.
686 First, emit code to add the integer DELTA to the location that contains the
687 incoming first argument. Assume that this argument contains a pointer, and
688 is the one used to pass the this' pointer in C++. This is the incoming
689 argument *before* the function prologue, e.g. %o0' on a sparc. The
690 addition must preserve the values of all other incoming arguments.
692 After the addition, emit code to jump to FUNCTION, which is a
693 FUNCTION_DECL'. This is a direct pure jump, not a call, and does not touch
694 the return address. Hence returning from FUNCTION will return to whoever
695 called the current thunk'.
697 The effect must be as if FUNCTION had been called directly with
698 the adjusted first argument. This macro is responsible for
699 emitting all of the code for a thunk function;
700 output_function_prologue() and output_function_epilogue() are not
701 invoked.
703 The THUNK_FNDECL is redundant. (DELTA and FUNCTION have already been
704 extracted from it.) It might possibly be useful on some targets, but
705 probably not.
707 If you do not define this macro, the target-independent code in the C++
708 frontend will generate a less efficient heavyweight thunk that calls
709 FUNCTION instead of jumping to it. The generic approach does not support
710 varargs. */
712 #define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
713 output_mi_thunk (FILE, THUNK_FNDECL, DELTA, FUNCTION)
715 /* How to renumber registers for dbx and gdb. */
717 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
719 /* The USER_LABEL_PREFIX stuff is affected by the -fleading-underscore
720 flag. The LOCAL_LABEL_PREFIX variable is used by dbxelf.h. */
722 #define LOCAL_LABEL_PREFIX "."
723 #define USER_LABEL_PREFIX ""
725 /* svr4.h overrides ASM_OUTPUT_INTERNAL_LABEL. */
727 #define ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX) \
728 asm_fprintf (FILE, "%L%s", PREFIX)
730 #define ASM_OUTPUT_LABEL(FILE,NAME) \
731 (assemble_name (FILE, NAME), fputs (":\n", FILE))
733 /* This is how to output a command to make the user-level label named NAME
734 defined for reference from other files. */
736 #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
737 do { fputs ("\t.globl ", FILE); \
738 assemble_name (FILE, NAME); putc ('\n', FILE);} while (0)
740 /* This is how to allocate empty space in some section. Use .space
741 instead of .zero because the Solaris PowerPC assembler doesn't
742 like it, and gas accepts either syntax. */
744 /* Override elfos.h definition. */
745 #undef SKIP_ASM_OP
746 #define SKIP_ASM_OP "\t.space\t"
748 /* This says how to output assembler code to declare an
749 uninitialized internal linkage data object. Under SVR4,
750 the linker seems to want the alignment of data objects
751 to depend on their types. We do exactly that here. */
753 #define LOCAL_ASM_OP "\t.local\t"
755 #define LCOMM_ASM_OP "\t.lcomm\t"
757 /* Override elfos.h definition. */
758 #undef ASM_OUTPUT_ALIGNED_LOCAL
759 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
760 do { \
761 if (rs6000_sdata != SDATA_NONE && (SIZE) > 0 \
762 && (SIZE) <= g_switch_value) \
764 sbss_section (); \
765 ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT)); \
766 ASM_OUTPUT_LABEL (FILE, NAME); \
767 ASM_OUTPUT_SKIP (FILE, SIZE); \
768 if (!flag_inhibit_size_directive && (SIZE) > 0) \
770 fprintf (FILE, "%s", SIZE_ASM_OP); \
771 assemble_name (FILE, NAME); \
772 fprintf (FILE, ",%d\n", SIZE); \
775 else \
777 fprintf (FILE, "%s", LCOMM_ASM_OP); \
778 assemble_name ((FILE), (NAME)); \
779 fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
781 } while (0)
783 /* Describe how to emit uninitialized external linkage items. */
784 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
785 do { \
786 ASM_GLOBALIZE_LABEL (FILE, NAME); \
787 ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \
788 } while (0)
790 /* Switch Recognition by gcc.c. Add -G xx support. */
792 /* Override svr4.h definition. */
793 #undef SWITCH_TAKES_ARG
794 #define SWITCH_TAKES_ARG(CHAR) \
795 ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o' \
796 || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \
797 || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x' \
798 || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V' \
799 || (CHAR) == 'B' || (CHAR) == 'b' || (CHAR) == 'G')
801 /* Output .file. */
802 /* Override elfos.h definition. */
803 #undef ASM_FILE_START
804 #define ASM_FILE_START(FILE) \
805 do { \
806 output_file_directive ((FILE), main_input_filename); \
807 rs6000_file_start (FILE, TARGET_CPU_DEFAULT); \
808 } while (0)
811 extern int fixuplabelno;
813 /* This is how to output an assembler line defining an `int' constant.
814 For -mrelocatable, we mark all addresses that need to be fixed up
815 in the .fixup section. */
816 /* Override rs6000.h definition. */
817 #undef ASM_OUTPUT_INT
818 #define ASM_OUTPUT_INT(FILE,VALUE) \
819 do { \
820 static int recurse = 0; \
821 if (TARGET_RELOCATABLE \
822 && in_section != in_toc \
823 && in_section != in_text \
824 && in_section != in_ctors \
825 && in_section != in_dtors \
826 && !recurse \
827 && GET_CODE (VALUE) != CONST_INT \
828 && GET_CODE (VALUE) != CONST_DOUBLE \
829 && CONSTANT_P (VALUE)) \
831 char buf[256]; \
833 recurse = 1; \
834 ASM_GENERATE_INTERNAL_LABEL (buf, "LCP", fixuplabelno); \
835 fixuplabelno++; \
836 ASM_OUTPUT_LABEL (FILE, buf); \
837 fprintf (FILE, "\t.long ("); \
838 output_addr_const (FILE, (VALUE)); \
839 fprintf (FILE, ")@fixup\n"); \
840 fprintf (FILE, "\t.section\t\".fixup\",\"aw\"\n"); \
841 ASM_OUTPUT_ALIGN (FILE, 2); \
842 fprintf (FILE, "\t.long\t"); \
843 assemble_name (FILE, buf); \
844 fprintf (FILE, "\n\t.previous\n"); \
845 recurse = 0; \
847 /* Remove initial .'s to turn a -mcall-aixdesc function \
848 address into the address of the descriptor, not the function \
849 itself. */ \
850 else if (GET_CODE (VALUE) == SYMBOL_REF \
851 && XSTR (VALUE, 0)[0] == '.' \
852 && DEFAULT_ABI == ABI_AIX) \
854 const char *name = XSTR (VALUE, 0); \
855 while (*name == '.') \
856 name++; \
858 fprintf (FILE, "\t.long %s\n", name); \
860 else \
862 fprintf (FILE, "\t.long "); \
863 output_addr_const (FILE, (VALUE)); \
864 fprintf (FILE, "\n"); \
866 } while (0)
868 /* This is the end of what might become sysv4.h. */
870 /* Allow stabs and dwarf, for now, make stabs the default debugging type,
871 not dwarf since G++ doesn't support dwarf. */
872 #undef PREFERRED_DEBUGGING_TYPE
873 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
875 #define DBX_DEBUGGING_INFO
877 /* If we are referencing a function that is static or is known to be
878 in this file, make the SYMBOL_REF special. We can use this to indicate
879 that we can branch to this function without emitting a no-op after the
880 call. For real AIX calling sequences, we also replace the
881 function name with the real name (1 or 2 leading .'s), rather than
882 the function descriptor name. This saves a lot of overriding code
883 to read the prefixes. */
885 #undef ENCODE_SECTION_INFO
886 #define ENCODE_SECTION_INFO(DECL) rs6000_encode_section_info (DECL)
888 /* The ELF version doesn't encode [DS] or whatever at the end of symbols. */
890 #define RS6000_OUTPUT_BASENAME(FILE, NAME) \
891 assemble_name (FILE, NAME)
893 /* This macro gets just the user-specified name
894 out of the string in a SYMBOL_REF. Discard
895 a leading * or @. */
896 #define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
897 do { \
898 const char *_name = SYMBOL_NAME; \
899 while (*_name == '*' || *_name == '@') \
900 _name++; \
901 (VAR) = _name; \
902 } while (0)
904 /* This is how to output a reference to a user-level label named NAME.
905 `assemble_name' uses this. */
907 /* Override elfos.h definition. */
908 #undef ASM_OUTPUT_LABELREF
909 #define ASM_OUTPUT_LABELREF(FILE,NAME) \
910 do { \
911 const char *_name = NAME; \
912 if (*_name == '@') \
913 _name++; \
915 if (*_name == '*') \
916 fprintf (FILE, "%s", _name + 1); \
917 else \
918 asm_fprintf (FILE, "%U%s", _name); \
919 } while (0)
921 /* Switch into a generic section.
923 We make the section read-only and executable for a function decl,
924 read-only for a const data decl, and writable for a non-const data decl.
926 If the section has already been defined, we must not
927 emit the attributes here. The SVR4 assembler does not
928 recognize section redefinitions.
929 If DECL is NULL, no attributes are emitted.
931 Note, Solaris as doesn't like @nobits, and gas can handle .sbss without
932 needing @nobits. */
934 /* Override elfos.h definition. */
935 #undef ASM_OUTPUT_SECTION_NAME
936 #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
937 do { \
938 static struct section_info \
940 struct section_info *next; \
941 char *name; \
942 enum sect_enum {SECT_RW, SECT_RO, SECT_EXEC} type; \
943 } *sections; \
944 struct section_info *s; \
945 const char *mode; \
946 enum sect_enum type; \
948 for (s = sections; s; s = s->next) \
949 if (!strcmp (NAME, s->name)) \
950 break; \
952 if (DECL && TREE_CODE (DECL) == FUNCTION_DECL) \
953 type = SECT_EXEC, mode = "ax"; \
954 else if (DECL && DECL_READONLY_SECTION (DECL, RELOC) && !TARGET_RELOCATABLE && !flag_pic) \
955 type = SECT_RO, mode = "a"; \
956 else \
957 type = SECT_RW, mode = "aw"; \
959 if (s == 0) \
961 s = (struct section_info *) xmalloc (sizeof (struct section_info)); \
962 s->name = xmalloc ((strlen (NAME) + 1) * sizeof (*NAME)); \
963 strcpy (s->name, NAME); \
964 s->type = type; \
965 s->next = sections; \
966 sections = s; \
967 fprintf (FILE, "\t.section\t\"%s\",\"%s\"\n", NAME, mode); \
969 else \
971 if (DECL && s->type != type) \
972 error_with_decl (DECL, "%s causes a section type conflict"); \
974 fprintf (FILE, "\t.section\t\"%s\"\n", NAME); \
976 } while (0)
978 /* Override elfos.h definition. */
979 #undef ASM_OUTPUT_CONSTRUCTOR
980 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
981 do { \
982 if (DEFAULT_ABI != ABI_SOLARIS) \
984 ctors_section (); \
985 fprintf (FILE, "%s", INT_ASM_OP); \
986 assemble_name (FILE, NAME); \
988 else \
990 init_section (); \
991 fputs ("\tbl ", FILE); \
992 assemble_name (FILE, NAME); \
994 fputs ("\n", FILE); \
995 } while (0)
997 /* A C statement (sans semicolon) to output an element in the table of
998 global destructors. */
999 /* Override elfos.h definition. */
1000 #undef ASM_OUTPUT_DESTRUCTOR
1001 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
1002 do { \
1003 if (DEFAULT_ABI != ABI_SOLARIS) \
1005 dtors_section (); \
1006 fprintf (FILE, "%s", INT_ASM_OP); \
1007 assemble_name (FILE, NAME); \
1009 else \
1011 fini_section (); \
1012 fputs ("\tbl ", FILE); \
1013 assemble_name (FILE, NAME); \
1015 fputs ("\n", FILE); \
1016 } while (0)
1018 /* But, to make this work, we have to output the stabs for the function
1019 name *first*... */
1021 #define DBX_FUNCTION_FIRST
1023 /* This is the end of what might become sysv4dbx.h. */
1025 /* Override rs6000.h definition. */
1026 #undef TARGET_VERSION
1027 #define TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)");
1029 #define CPP_PREDEFINES \
1030 "-DPPC -Dunix -D__svr4__ -Asystem=unix -Asystem=svr4 -Acpu=powerpc -Amachine=powerpc"
1032 /* Pass various options to the assembler. */
1033 /* Override svr4.h definition. */
1034 #undef ASM_SPEC
1035 #define ASM_SPEC "%(asm_cpu) \
1036 %{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \
1037 %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
1038 %{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \
1039 %{memb} %{!memb: %{msdata: -memb} %{msdata=eabi: -memb}} \
1040 %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian} \
1041 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
1042 %{mcall-solaris: -mlittle -msolaris} \
1043 %{mcall-i960-old: -mlittle} \
1044 %{mcall-linux: -mbig} }}}}"
1046 #define CC1_ENDIAN_BIG_SPEC ""
1048 #define CC1_ENDIAN_LITTLE_SPEC "\
1049 %{!mstrict-align: %{!mno-strict-align: \
1050 %{!mcall-i960-old: \
1051 -mstrict-align \
1055 #define CC1_ENDIAN_DEFAULT_SPEC "%(cc1_endian_big_spec)"
1057 /* Pass -G xxx to the compiler and set correct endian mode. */
1058 #define CC1_SPEC "%{G*} \
1059 %{mlittle: %(cc1_endian_little)} %{!mlittle: %{mlittle-endian: %(cc1_endian_little)}} \
1060 %{mbig: %(cc1_endian_big)} %{!mbig: %{mbig-endian: %(cc1_endian_big)}} \
1061 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
1062 %{mcall-aixdesc: -mbig %(cc1_endian_big) } \
1063 %{mcall-solaris: -mlittle %(cc1_endian_little) } \
1064 %{mcall-i960-old: -mlittle %(cc1_endian_little) } \
1065 %{mcall-linux: -mbig %(cc1_endian_big) } \
1066 %{!mcall-aixdesc: %{!mcall-solaris: %{!mcall-i960-old: %{!mcall-linux: \
1067 %(cc1_endian_default) \
1068 }}}} \
1069 }}}} \
1070 %{mcall-solaris: -mregnames } \
1071 %{mno-sdata: -msdata=none } \
1072 %{meabi: %{!mcall-*: -mcall-sysv }} \
1073 %{!meabi: %{!mno-eabi: \
1074 %{mrelocatable: -meabi } \
1075 %{mcall-solaris: -mno-eabi } \
1076 %{mcall-i960-old: -meabi } \
1077 %{mcall-linux: -mno-eabi }}} \
1078 %{msdata: -msdata=default} \
1079 %{mno-sdata: -msdata=none} \
1080 %{profile: -p}"
1082 /* Don't put -Y P,<path> for cross compilers. */
1083 #ifndef CROSS_COMPILE
1084 #define LINK_PATH_SPEC "\
1085 %{!R*:%{L*:-R %*}} \
1086 %{!nostdlib: %{!YP,*: \
1087 %{compat-bsd: \
1088 %{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
1089 %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}} \
1090 %{!R*: %{!L*: -R /usr/ucblib}} \
1091 %{!compat-bsd: \
1092 %{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
1093 %{!p:-Y P,/usr/ccs/lib:/usr/lib}}}}"
1095 #else
1096 #define LINK_PATH_SPEC ""
1097 #endif
1099 /* Default starting address if specified. */
1100 #define LINK_START_SPEC "\
1101 %{mads: %(link_start_ads) } \
1102 %{myellowknife: %(link_start_yellowknife) } \
1103 %{mmvme: %(link_start_mvme) } \
1104 %{msim: %(link_start_sim) } \
1105 %{mcall-linux: %(link_start_linux) } \
1106 %{mcall-solaris: %(link_start_solaris) } \
1107 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(link_start_default) }}}}}}"
1109 #define LINK_START_DEFAULT_SPEC ""
1111 /* Override svr4.h definition. */
1112 #undef LINK_SPEC
1113 #define LINK_SPEC "\
1114 %{h*} %{v:-V} %{G*} \
1115 %{Wl,*:%*} %{YP,*} %{R*} \
1116 %{Qy:} %{!Qn:-Qy} \
1117 %(link_shlib) \
1118 %{!Wl,-T*: %{!T*: %(link_start) }} \
1119 %(link_target) \
1120 %(link_os)"
1122 /* For now, turn off shared libraries by default. */
1123 #ifndef SHARED_LIB_SUPPORT
1124 #define NO_SHARED_LIB_SUPPORT
1125 #endif
1127 #ifndef NO_SHARED_LIB_SUPPORT
1128 /* Shared libraries are default. */
1129 #define LINK_SHLIB_SPEC "\
1130 %{!static: %(link_path) %{!R*:%{L*:-R %*}}} \
1131 %{mshlib: } \
1132 %{static:-dn -Bstatic} \
1133 %{shared:-G -dy -z text} \
1134 %{symbolic:-Bsymbolic -G -dy -z text}"
1136 #else
1137 /* Shared libraries are not default. */
1138 #define LINK_SHLIB_SPEC "\
1139 %{mshlib: %(link_path) } \
1140 %{!mshlib: %{!shared: %{!symbolic: -dn -Bstatic}}} \
1141 %{static: } \
1142 %{shared:-G -dy -z text %(link_path) } \
1143 %{symbolic:-Bsymbolic -G -dy -z text %(link_path) }"
1144 #endif
1146 /* Override the default target of the linker. */
1147 #define LINK_TARGET_SPEC "\
1148 %{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } \
1149 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
1150 %{mcall-i960-old: --oformat elf32-powerpcle} \
1151 %{mcall-solaris: --oformat elf32-powerpcle} \
1152 }}}}"
1154 /* Any specific OS flags. */
1155 #define LINK_OS_SPEC "\
1156 %{mads: %(link_os_ads) } \
1157 %{myellowknife: %(link_os_yellowknife) } \
1158 %{mmvme: %(link_os_mvme) } \
1159 %{msim: %(link_os_sim) } \
1160 %{mcall-linux: %(link_os_linux) } \
1161 %{mcall-solaris: %(link_os_solaris) } \
1162 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(link_os_default) }}}}}}"
1164 #define LINK_OS_DEFAULT_SPEC ""
1166 #define CPP_SYSV_SPEC \
1167 "%{mrelocatable*: -D_RELOCATABLE} \
1168 %{fpic: -D__PIC__=1 -D__pic__=1} \
1169 %{!fpic: %{fPIC: -D__PIC__=2 -D__pic__=2}} \
1170 %{mlong-double-128: -D__LONG_DOUBLE_128__=1} \
1171 %{!mlong-double-64: %(cpp_longdouble_default)} \
1172 %{mcall-sysv: -D_CALL_SYSV} \
1173 %{mcall-aix: -D_CALL_AIX} %{mcall-aixdesc: -D_CALL_AIX -D_CALL_AIXDESC} \
1174 %{!mcall-sysv: %{!mcall-aix: %{!mcall-aixdesc: %(cpp_sysv_default) }}} \
1175 %{msoft-float: -D_SOFT_FLOAT} \
1176 %{!msoft-float: %{!mhard-float: \
1177 %{mcpu=401: -D_SOFT_FLOAT} \
1178 %{mcpu=403: -D_SOFT_FLOAT} \
1179 %{mcpu=ec603e: -D_SOFT_FLOAT} \
1180 %{mcpu=801: -D_SOFT_FLOAT} \
1181 %{mcpu=821: -D_SOFT_FLOAT} \
1182 %{mcpu=823: -D_SOFT_FLOAT} \
1183 %{mcpu=860: -D_SOFT_FLOAT} \
1184 %{!mcpu*: %(cpp_float_default) }}}"
1186 /* Whether floating point is disabled by default. */
1187 #define CPP_FLOAT_DEFAULT_SPEC ""
1189 /* Whether 'long double' is 128 bits by default. */
1190 #define CPP_LONGDOUBLE_DEFAULT_SPEC ""
1192 #define CPP_SYSV_DEFAULT_SPEC "-D_CALL_SYSV"
1194 #define CPP_ENDIAN_BIG_SPEC "-D_BIG_ENDIAN -D__BIG_ENDIAN__ -Amachine=bigendian"
1196 #define CPP_ENDIAN_LITTLE_SPEC "-D_LITTLE_ENDIAN -D__LITTLE_ENDIAN__ -Amachine=littleendian"
1198 #define CPP_ENDIAN_SOLARIS_SPEC "-D__LITTLE_ENDIAN__ -Amachine=littleendian"
1200 /* For solaris, don't define _LITTLE_ENDIAN, it conflicts with a header file. */
1201 #define CPP_ENDIAN_SPEC \
1202 "%{mlittle: %(cpp_endian_little) } \
1203 %{mlittle-endian: %(cpp_endian_little) } \
1204 %{mbig: %(cpp_endian_big) } \
1205 %{mbig-endian: %(cpp_endian_big) } \
1206 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
1207 %{mcall-solaris: %(cpp_endian_solaris) } \
1208 %{mcall-linux: %(cpp_endian_big) } \
1209 %{mcall-i960-old: %(cpp_endian_little) } \
1210 %{mcall-aixdesc: %(cpp_endian_big) } \
1211 %{!mcall-solaris: %{!mcall-linux: %{!mcall-aixdesc: %(cpp_endian_default) }}}}}}}"
1213 #define CPP_ENDIAN_DEFAULT_SPEC "%(cpp_endian_big)"
1215 /* Override rs6000.h definition. */
1216 #undef CPP_SPEC
1217 #define CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_sysv) %(cpp_endian) %(cpp_cpu) \
1218 %{mads: %(cpp_os_ads) } \
1219 %{myellowknife: %(cpp_os_yellowknife) } \
1220 %{mmvme: %(cpp_os_mvme) } \
1221 %{msim: %(cpp_os_sim) } \
1222 %{mcall-linux: %(cpp_os_linux) } \
1223 %{mcall-solaris: %(cpp_os_solaris) } \
1224 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(cpp_os_default) }}}}}}"
1226 #define CPP_OS_DEFAULT_SPEC ""
1228 /* Override svr4.h definition. */
1229 #undef STARTFILE_SPEC
1230 #define STARTFILE_SPEC "\
1231 %{mads: %(startfile_ads) } \
1232 %{myellowknife: %(startfile_yellowknife) } \
1233 %{mmvme: %(startfile_mvme) } \
1234 %{msim: %(startfile_sim) } \
1235 %{mcall-linux: %(startfile_linux) } \
1236 %{mcall-solaris: %(startfile_solaris) } \
1237 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(startfile_default) }}}}}}"
1239 #define STARTFILE_DEFAULT_SPEC ""
1241 /* Override svr4.h definition. */
1242 #undef LIB_SPEC
1243 #define LIB_SPEC "\
1244 %{mads: %(lib_ads) } \
1245 %{myellowknife: %(lib_yellowknife) } \
1246 %{mmvme: %(lib_mvme) } \
1247 %{msim: %(lib_sim) } \
1248 %{mcall-linux: %(lib_linux) } \
1249 %{mcall-solaris: %(lib_solaris) } \
1250 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(lib_default) }}}}}}"
1252 #define LIB_DEFAULT_SPEC ""
1254 /* Override svr4.h definition. */
1255 #undef ENDFILE_SPEC
1256 #define ENDFILE_SPEC "\
1257 %{mads: %(endfile_ads)} \
1258 %{myellowknife: %(endfile_yellowknife)} \
1259 %{mmvme: %(endfile_mvme)} \
1260 %{msim: %(endfile_sim)} \
1261 %{mcall-linux: %(endfile_linux) } \
1262 %{mcall-solaris: %(endfile_solaris)} \
1263 %{mvxworks: %(endfile_vxworks) } \
1264 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %{!mvxworks: %(endfile_default) }}}}}}}"
1266 #define ENDFILE_DEFAULT_SPEC ""
1268 /* Motorola ADS support. */
1269 #define LIB_ADS_SPEC "--start-group -lads -lc --end-group"
1271 #define STARTFILE_ADS_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
1273 #define ENDFILE_ADS_SPEC "crtend.o%s ecrtn.o%s"
1275 #define LINK_START_ADS_SPEC "-T ads.ld%s"
1277 #define LINK_OS_ADS_SPEC ""
1279 #define CPP_OS_ADS_SPEC ""
1281 /* Motorola Yellowknife support. */
1282 #define LIB_YELLOWKNIFE_SPEC "--start-group -lyk -lc --end-group"
1284 #define STARTFILE_YELLOWKNIFE_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
1286 #define ENDFILE_YELLOWKNIFE_SPEC "crtend.o%s ecrtn.o%s"
1288 #define LINK_START_YELLOWKNIFE_SPEC "-T yellowknife.ld%s"
1290 #define LINK_OS_YELLOWKNIFE_SPEC ""
1292 #define CPP_OS_YELLOWKNIFE_SPEC ""
1294 /* Motorola MVME support. */
1295 #define LIB_MVME_SPEC "--start-group -lmvme -lc --end-group"
1297 #define STARTFILE_MVME_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
1299 #define ENDFILE_MVME_SPEC "crtend.o%s ecrtn.o%s"
1301 #define LINK_START_MVME_SPEC "-Ttext 0x40000"
1303 #define LINK_OS_MVME_SPEC ""
1305 #define CPP_OS_MVME_SPEC ""
1307 /* PowerPC simulator based on netbsd system calls support. */
1308 #define LIB_SIM_SPEC "--start-group -lsim -lc --end-group"
1310 #define STARTFILE_SIM_SPEC "ecrti.o%s sim-crt0.o%s crtbegin.o%s"
1312 #define ENDFILE_SIM_SPEC "crtend.o%s ecrtn.o%s"
1314 #define LINK_START_SIM_SPEC ""
1316 #define LINK_OS_SIM_SPEC "-m elf32ppcsim"
1318 #define CPP_OS_SIM_SPEC ""
1320 /* GNU/Linux support. */
1321 #ifdef USE_GNULIBC_1
1322 #define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
1323 %{!mnewlib: -lc }"
1324 #else
1325 #define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
1326 %{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } \
1327 %{profile:-lc_p} %{!profile:-lc}}}"
1328 #endif
1330 #define STARTFILE_LINUX_SPEC "\
1331 %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
1332 %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \
1333 %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
1335 #define ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
1336 %{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}"
1338 #define LINK_START_LINUX_SPEC ""
1340 #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
1341 %{rdynamic:-export-dynamic} \
1342 %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
1344 #ifdef USE_GNULIBC_1
1345 #define CPP_OS_LINUX_SPEC "-D__unix__ -D__linux__ \
1346 %{!undef: \
1347 %{!ansi: \
1348 %{!std=*:-Dunix -D__unix -Dlinux -D__linux} \
1349 %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}} \
1350 -Asystem=unix -Asystem=posix"
1351 #else
1352 #define CPP_OS_LINUX_SPEC "-D__unix__ -D__linux__ \
1353 %{!undef: \
1354 %{!ansi: \
1355 %{!std=*:-Dunix -D__unix -Dlinux -D__linux} \
1356 %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}} \
1357 -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
1358 #endif
1360 /* Solaris support. */
1361 /* For Solaris, Gcc automatically adds in one of the files
1362 /usr/ccs/lib/values-Xc.o, /usr/ccs/lib/values-Xa.o, or
1363 /usr/ccs/lib/values-Xt.o for each final link step (depending upon the other
1364 gcc options selected, such as -traditional and -ansi). These files each
1365 contain one (initialized) copy of a special variable called `_lib_version'.
1366 Each one of these files has `_lib_version' initialized to a different (enum)
1367 value. The SVR4 library routines query the value of `_lib_version' at run
1368 to decide how they should behave. Specifically, they decide (based upon the
1369 value of `_lib_version') if they will act in a strictly ANSI conforming
1370 manner or not. */
1372 #define LIB_SOLARIS_SPEC "\
1373 %{mnewlib: --start-group -lsolaris -lc --end-group } \
1374 %{!mnewlib: \
1375 %{ansi:values-Xc.o%s} \
1376 %{!ansi: \
1377 %{traditional:values-Xt.o%s} \
1378 %{!traditional:values-Xa.o%s}} \
1379 %{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} \
1380 %{solaris-cclib: /opt/SUNWspro/SC4.0/lib/libabi.a} \
1381 %{!shared: %{!symbolic: -lc }}}"
1383 #define STARTFILE_SOLARIS_SPEC "\
1384 %{!msolaris-cclib: scrti.o%s scrt0.o%s} \
1385 %{msolaris-cclib: /opt/SUNWspro/SC4.0/lib/crti.o%s /opt/SUNWspro/SC4.0/lib/crt1.o%s} \
1386 %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
1388 #define ENDFILE_SOLARIS_SPEC "\
1389 %{!shared:crtend.o%s} %{shared:crtendS.o%s} \
1390 %{!msolaris-cclib: scrtn.o%s} \
1391 %{msolaris-cclib: /opt/SUNWspro/SC4.0/lib/crtn.o%s}"
1393 #define LINK_START_SOLARIS_SPEC ""
1395 #define LINK_OS_SOLARIS_SPEC ""
1397 #define CPP_OS_SOLARIS_SPEC "-D__ppc -D__sun__=1 -D__unix__ -D__svr4__ -D__SVR4__ \
1398 %{!undef:%{!ansi:%{!std=*:-Dsun=1 -Dunix -DSVR4 -D__EXTENSIONS__} \
1399 %{std=gnu*:-Dsun=1 -Dunix -DSVR4 -D__EXTENSIONS__}}} \
1400 -Amachine=prep"
1402 /* VxWorks support. */
1403 /* VxWorks does all the library stuff itself. */
1404 #define LIB_VXWORKS_SPEC ""
1406 /* VxWorks provides the functionality of crt0.o and friends itself. */
1408 #define STARTFILE_VXWORKS_SPEC ""
1410 #define ENDFILE_VXWORKS_SPEC ""
1412 /* Because it uses ld -r, vxworks has no start/end files, nor starting
1413 address. */
1415 #define LINK_START_VXWORKS_SPEC ""
1417 #define LINK_OS_VXWORKS_SPEC "-r"
1419 #define CPP_OS_VXWORKS_SPEC "\
1420 -DCPU_FAMILY=PPC \
1421 %{!mcpu*: \
1422 %{mpowerpc*: -DCPU=PPC603} \
1423 %{!mno-powerpc: -DCPU=PPC603}} \
1424 %{mcpu=powerpc: -DCPU=PPC603} \
1425 %{mcpu=401: -DCPU=PPC403} \
1426 %{mcpu=403: -DCPU=PPC403} \
1427 %{mcpu=601: -DCPU=PPC601} \
1428 %{mcpu=602: -DCPU=PPC603} \
1429 %{mcpu=603: -DCPU=PPC603} \
1430 %{mcpu=603e: -DCPU=PPC603} \
1431 %{mcpu=ec603e: -DCPU=PPC603} \
1432 %{mcpu=604: -DCPU=PPC604} \
1433 %{mcpu=604e: -DCPU=PPC604} \
1434 %{mcpu=620: -DCPU=PPC604} \
1435 %{mcpu=740: -DCPU=PPC603} \
1436 %{mcpu=750: -DCPU=PPC603} \
1437 %{mcpu=801: -DCPU=PPC603} \
1438 %{mcpu=821: -DCPU=PPC603} \
1439 %{mcpu=823: -DCPU=PPC603} \
1440 %{mcpu=860: -DCPU=PPC603}"
1442 /* Define any extra SPECS that the compiler needs to generate. */
1443 /* Override rs6000.h definition. */
1444 #undef SUBTARGET_EXTRA_SPECS
1445 #define SUBTARGET_EXTRA_SPECS \
1446 { "cpp_sysv", CPP_SYSV_SPEC }, \
1447 { "cpp_sysv_default", CPP_SYSV_DEFAULT_SPEC }, \
1448 { "cpp_endian_default", CPP_ENDIAN_DEFAULT_SPEC }, \
1449 { "cpp_endian", CPP_ENDIAN_SPEC }, \
1450 { "lib_ads", LIB_ADS_SPEC }, \
1451 { "lib_yellowknife", LIB_YELLOWKNIFE_SPEC }, \
1452 { "lib_mvme", LIB_MVME_SPEC }, \
1453 { "lib_sim", LIB_SIM_SPEC }, \
1454 { "lib_linux", LIB_LINUX_SPEC }, \
1455 { "lib_solaris", LIB_SOLARIS_SPEC }, \
1456 { "lib_vxworks", LIB_VXWORKS_SPEC }, \
1457 { "lib_default", LIB_DEFAULT_SPEC }, \
1458 { "startfile_ads", STARTFILE_ADS_SPEC }, \
1459 { "startfile_yellowknife", STARTFILE_YELLOWKNIFE_SPEC }, \
1460 { "startfile_mvme", STARTFILE_MVME_SPEC }, \
1461 { "startfile_sim", STARTFILE_SIM_SPEC }, \
1462 { "startfile_linux", STARTFILE_LINUX_SPEC }, \
1463 { "startfile_solaris", STARTFILE_SOLARIS_SPEC }, \
1464 { "startfile_vxworks", STARTFILE_VXWORKS_SPEC }, \
1465 { "startfile_default", STARTFILE_DEFAULT_SPEC }, \
1466 { "endfile_ads", ENDFILE_ADS_SPEC }, \
1467 { "endfile_yellowknife", ENDFILE_YELLOWKNIFE_SPEC }, \
1468 { "endfile_mvme", ENDFILE_MVME_SPEC }, \
1469 { "endfile_sim", ENDFILE_SIM_SPEC }, \
1470 { "endfile_linux", ENDFILE_LINUX_SPEC }, \
1471 { "endfile_solaris", ENDFILE_SOLARIS_SPEC }, \
1472 { "endfile_vxworks", ENDFILE_VXWORKS_SPEC }, \
1473 { "endfile_default", ENDFILE_DEFAULT_SPEC }, \
1474 { "link_path", LINK_PATH_SPEC }, \
1475 { "link_shlib", LINK_SHLIB_SPEC }, \
1476 { "link_target", LINK_TARGET_SPEC }, \
1477 { "link_start", LINK_START_SPEC }, \
1478 { "link_start_ads", LINK_START_ADS_SPEC }, \
1479 { "link_start_yellowknife", LINK_START_YELLOWKNIFE_SPEC }, \
1480 { "link_start_mvme", LINK_START_MVME_SPEC }, \
1481 { "link_start_sim", LINK_START_SIM_SPEC }, \
1482 { "link_start_linux", LINK_START_LINUX_SPEC }, \
1483 { "link_start_solaris", LINK_START_SOLARIS_SPEC }, \
1484 { "link_start_vxworks", LINK_START_VXWORKS_SPEC }, \
1485 { "link_start_default", LINK_START_DEFAULT_SPEC }, \
1486 { "link_os", LINK_OS_SPEC }, \
1487 { "link_os_ads", LINK_OS_ADS_SPEC }, \
1488 { "link_os_yellowknife", LINK_OS_YELLOWKNIFE_SPEC }, \
1489 { "link_os_mvme", LINK_OS_MVME_SPEC }, \
1490 { "link_os_sim", LINK_OS_SIM_SPEC }, \
1491 { "link_os_linux", LINK_OS_LINUX_SPEC }, \
1492 { "link_os_solaris", LINK_OS_SOLARIS_SPEC }, \
1493 { "link_os_vxworks", LINK_OS_VXWORKS_SPEC }, \
1494 { "link_os_default", LINK_OS_DEFAULT_SPEC }, \
1495 { "cc1_endian_big", CC1_ENDIAN_BIG_SPEC }, \
1496 { "cc1_endian_little", CC1_ENDIAN_LITTLE_SPEC }, \
1497 { "cc1_endian_default", CC1_ENDIAN_DEFAULT_SPEC }, \
1498 { "cpp_endian_big", CPP_ENDIAN_BIG_SPEC }, \
1499 { "cpp_endian_little", CPP_ENDIAN_LITTLE_SPEC }, \
1500 { "cpp_endian_solaris", CPP_ENDIAN_SOLARIS_SPEC }, \
1501 { "cpp_float_default", CPP_FLOAT_DEFAULT_SPEC }, \
1502 { "cpp_longdouble_default", CPP_LONGDOUBLE_DEFAULT_SPEC }, \
1503 { "cpp_os_ads", CPP_OS_ADS_SPEC }, \
1504 { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
1505 { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
1506 { "cpp_os_sim", CPP_OS_SIM_SPEC }, \
1507 { "cpp_os_linux", CPP_OS_LINUX_SPEC }, \
1508 { "cpp_os_solaris", CPP_OS_SOLARIS_SPEC }, \
1509 { "cpp_os_vxworks", CPP_OS_VXWORKS_SPEC }, \
1510 { "cpp_os_default", CPP_OS_DEFAULT_SPEC },
1512 /* Define this macro as a C expression for the initializer of an
1513 array of string to tell the driver program which options are
1514 defaults for this target and thus do not need to be handled
1515 specially when using `MULTILIB_OPTIONS'.
1517 Do not define this macro if `MULTILIB_OPTIONS' is not defined in
1518 the target makefile fragment or if none of the options listed in
1519 `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */
1521 #define MULTILIB_DEFAULTS { "mbig", "mcall-sysv" }
1523 /* Define this macro if the code for function profiling should come
1524 before the function prologue. Normally, the profiling code comes
1525 after. */
1526 #define PROFILE_BEFORE_PROLOGUE 1
1528 /* Function name to call to do profiling. */
1529 #define RS6000_MCOUNT "_mcount"
1531 /* Define this macro (to a value of 1) if you want to support the
1532 Win32 style pragmas #pragma pack(push,<n>)' and #pragma
1533 pack(pop)'. The pack(push,<n>) pragma specifies the maximum
1534 alignment (in bytes) of fields within a structure, in much the
1535 same way as the __aligned__' and __packed__' __attribute__'s
1536 do. A pack value of zero resets the behaviour to the default.
1537 Successive invocations of this pragma cause the previous values to
1538 be stacked, so that invocations of #pragma pack(pop)' will return
1539 to the previous value. */
1541 #define HANDLE_PRAGMA_PACK_PUSH_POP 1
1543 /* Define library calls for quad FP operations. These are all part of the
1544 PowerPC 32bit ABI. */
1545 #define ADDTF3_LIBCALL "_q_add"
1546 #define DIVTF3_LIBCALL "_q_div"
1547 #define EXTENDDFTF2_LIBCALL "_q_dtoq"
1548 #define EQTF2_LIBCALL "_q_feq"
1549 #define GETF2_LIBCALL "_q_fge"
1550 #define GTTF2_LIBCALL "_q_fgt"
1551 #define LETF2_LIBCALL "_q_fle"
1552 #define LTTF2_LIBCALL "_q_flt"
1553 #define NETF2_LIBCALL "_q_fne"
1554 #define FLOATSITF2_LIBCALL "_q_itoq"
1555 #define MULTF3_LIBCALL "_q_mul"
1556 #define NEGTF2_LIBCALL "_q_neg"
1557 #define TRUNCTFDF2_LIBCALL "_q_qtod"
1558 #define FIX_TRUNCTFSI2_LIBCALL "_q_qtoi"
1559 #define TRUNCTFSF2_LIBCALL "_q_qtos"
1560 #define FIXUNS_TRUNCTFSI2_LIBCALL "_q_qtou"
1561 #define SQRTTF_LIBCALL "_q_sqrt"
1562 #define EXTENDSFTF2_LIBCALL "_q_stoq"
1563 #define SUBTF3_LIBCALL "_q_sub"
1564 #define FLOATUNSSITF2_LIBCALL "_q_utoq"
1566 #define INIT_TARGET_OPTABS \
1567 do { \
1568 if (TARGET_HARD_FLOAT) \
1570 add_optab->handlers[(int) TFmode].libfunc \
1571 = init_one_libfunc (ADDTF3_LIBCALL); \
1572 sub_optab->handlers[(int) TFmode].libfunc \
1573 = init_one_libfunc (SUBTF3_LIBCALL); \
1574 neg_optab->handlers[(int) TFmode].libfunc \
1575 = init_one_libfunc (NEGTF2_LIBCALL); \
1576 smul_optab->handlers[(int) TFmode].libfunc \
1577 = init_one_libfunc (MULTF3_LIBCALL); \
1578 flodiv_optab->handlers[(int) TFmode].libfunc \
1579 = init_one_libfunc (DIVTF3_LIBCALL); \
1580 eqtf2_libfunc = init_one_libfunc (EQTF2_LIBCALL); \
1581 netf2_libfunc = init_one_libfunc (NETF2_LIBCALL); \
1582 gttf2_libfunc = init_one_libfunc (GTTF2_LIBCALL); \
1583 getf2_libfunc = init_one_libfunc (GETF2_LIBCALL); \
1584 lttf2_libfunc = init_one_libfunc (LTTF2_LIBCALL); \
1585 letf2_libfunc = init_one_libfunc (LETF2_LIBCALL); \
1586 trunctfsf2_libfunc = init_one_libfunc (TRUNCTFSF2_LIBCALL); \
1587 trunctfdf2_libfunc = init_one_libfunc (TRUNCTFDF2_LIBCALL); \
1588 extendsftf2_libfunc = init_one_libfunc (EXTENDSFTF2_LIBCALL); \
1589 extenddftf2_libfunc = init_one_libfunc (EXTENDDFTF2_LIBCALL); \
1590 floatsitf_libfunc = init_one_libfunc (FLOATSITF2_LIBCALL); \
1591 fixtfsi_libfunc = init_one_libfunc (FIX_TRUNCTFSI2_LIBCALL); \
1592 fixunstfsi_libfunc \
1593 = init_one_libfunc (FIXUNS_TRUNCTFSI2_LIBCALL); \
1594 if (TARGET_PPC_GPOPT || TARGET_POWER2) \
1595 sqrt_optab->handlers[(int) TFmode].libfunc \
1596 = init_one_libfunc (SQRTTF_LIBCALL); \
1598 } while (0)
1600 /* Select a format to encode pointers in exception handling data. CODE
1601 is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
1602 true if the symbol may be affected by dynamic relocations. */
1603 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
1604 ((flag_pic || TARGET_RELOCATABLE) \
1605 ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
1606 : DW_EH_PE_absptr)
1608 #define EXCEPTION_SECTION readonly_data_section