sysv4.h revision 96263
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.
5
6This file is part of GNU CC.
7
8GNU CC is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 2, or (at your option)
11any later version.
12
13GNU CC is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with GNU CC; see the file COPYING.  If not, write to
20the Free Software Foundation, 59 Temple Place - Suite 330,
21Boston, MA 02111-1307, USA.  */
22
23
24/* Yes!  We are ELF.  */
25#define	TARGET_OBJECT_FORMAT OBJECT_ELF
26
27/* Default ABI to compile code for.  */
28#define DEFAULT_ABI rs6000_current_abi
29
30/* Default ABI to use.  */
31#define RS6000_ABI_NAME "sysv"
32
33/* Override rs6000.h definition.  */
34#undef	ASM_DEFAULT_SPEC
35#define	ASM_DEFAULT_SPEC "-mppc"
36
37/* Override rs6000.h definition.  */
38#undef	CPP_DEFAULT_SPEC
39#define	CPP_DEFAULT_SPEC "-D_ARCH_PPC"
40
41/* Small data support types.  */
42enum 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.  */
47};
48
49extern enum rs6000_sdata_type rs6000_sdata;
50
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_NO_BITFIELD_WORD	0x00800000	/* Bitfields cannot cross word boundaries */
60
61#define	TARGET_NO_BITFIELD_TYPE	(target_flags & MASK_NO_BITFIELD_TYPE)
62#define	TARGET_STRICT_ALIGN	(target_flags & MASK_STRICT_ALIGN)
63#define	TARGET_RELOCATABLE	(target_flags & MASK_RELOCATABLE)
64#define	TARGET_EABI		(target_flags & MASK_EABI)
65#define	TARGET_LITTLE_ENDIAN	(target_flags & MASK_LITTLE_ENDIAN)
66#define	TARGET_REGNAMES		(target_flags & MASK_REGNAMES)
67#define	TARGET_PROTOTYPE	(target_flags & MASK_PROTOTYPE)
68#define TARGET_NO_BITFIELD_WORD	(target_flags & MASK_NO_BITFIELD_WORD)
69#define	TARGET_TOC		((target_flags & MASK_64BIT)		\
70				 || ((target_flags & (MASK_RELOCATABLE	\
71						      | MASK_MINIMAL_TOC)) \
72				     && flag_pic > 1)			\
73				 || DEFAULT_ABI == ABI_AIX)
74
75#define	TARGET_BITFIELD_TYPE	(! TARGET_NO_BITFIELD_TYPE)
76#define	TARGET_BIG_ENDIAN	(! TARGET_LITTLE_ENDIAN)
77#define	TARGET_NO_PROTOTYPE	(! TARGET_PROTOTYPE)
78#define	TARGET_NO_TOC		(! TARGET_TOC)
79#define	TARGET_NO_EABI		(! TARGET_EABI)
80
81/* Strings provided by SUBTARGET_OPTIONS */
82extern const char *rs6000_abi_name;
83extern const char *rs6000_sdata_name;
84
85/* Override rs6000.h definition.  */
86#undef	SUBTARGET_OPTIONS
87#define	SUBTARGET_OPTIONS						\
88  { "call-",  &rs6000_abi_name, N_("Select ABI calling convention") },	\
89  { "sdata=", &rs6000_sdata_name, N_("Select method for sdata handling") }
90
91/* Max # of bytes for variables to automatically be put into the .sdata
92   or .sdata2 sections.  */
93extern int g_switch_value;		/* Value of the -G xx switch.  */
94extern int g_switch_set;		/* Whether -G xx was passed.  */
95
96#define SDATA_DEFAULT_SIZE 8
97
98/* Note, V.4 no longer uses a normal TOC, so make -mfull-toc, be just
99   the same as -mminimal-toc.  */
100/* Override rs6000.h definition.  */
101#undef	SUBTARGET_SWITCHES
102#define SUBTARGET_SWITCHES						\
103  { "bit-align",	-MASK_NO_BITFIELD_TYPE,				\
104    N_("Align to the base type of the bit-field") },			\
105  { "no-bit-align",	 MASK_NO_BITFIELD_TYPE,				\
106    N_("Don't align to the base type of the bit-field") },		\
107  { "strict-align",	 MASK_STRICT_ALIGN,				\
108    N_("Don't assume that unaligned accesses are handled by the system") }, \
109  { "no-strict-align",	-MASK_STRICT_ALIGN,				\
110    N_("Assume that unaligned accesses are handled by the system") },	\
111  { "relocatable",	 MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, \
112    N_("Produce code relocatable at runtime") },			\
113  { "no-relocatable",	-MASK_RELOCATABLE,				\
114    N_("Don't produce code relocatable at runtime") },			\
115  { "relocatable-lib",	 MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, \
116    N_("Produce code relocatable at runtime") },			\
117  { "no-relocatable-lib", -MASK_RELOCATABLE,				\
118    N_("Don't produce code relocatable at runtime") },			\
119  { "little-endian",	 MASK_LITTLE_ENDIAN,				\
120    N_("Produce little endian code") },					\
121  { "little",		 MASK_LITTLE_ENDIAN,				\
122    N_("Produce little endian code") },					\
123  { "big-endian",	-MASK_LITTLE_ENDIAN,				\
124    N_("Produce big endian code") },					\
125  { "big",		-MASK_LITTLE_ENDIAN,				\
126    N_("Produce big endian code") },					\
127  { "no-toc",		 0, N_("no description yet") },			\
128  { "toc",		 MASK_MINIMAL_TOC, N_("no description yet") },	\
129  { "full-toc",		 MASK_MINIMAL_TOC, N_("no description yet") },	\
130  { "prototype",	 MASK_PROTOTYPE, N_("no description yet") },	\
131  { "no-prototype",	-MASK_PROTOTYPE, N_("no description yet") },	\
132  { "no-traceback",	 0, N_("no description yet") },			\
133  { "eabi",		 MASK_EABI, N_("Use EABI") },			\
134  { "no-eabi",		-MASK_EABI, N_("Don't use EABI") },		\
135  { "bit-word",		-MASK_NO_BITFIELD_WORD, "" },			\
136  { "no-bit-word",	 MASK_NO_BITFIELD_WORD,				\
137    N_("Do not allow bit-fields to cross word boundaries") },		\
138  { "regnames",		  MASK_REGNAMES,				\
139    N_("Use alternate register names") },				\
140  { "no-regnames",	 -MASK_REGNAMES,				\
141    N_("Don't use alternate register names") },				\
142  { "sdata",		 0, N_("no description yet") },			\
143  { "no-sdata",		 0, N_("no description yet") },			\
144  { "sim",		 0,						\
145    N_("Link with libsim.a, libc.a and sim-crt0.o") },			\
146  { "ads",		 0,						\
147    N_("Link with libads.a, libc.a and crt0.o") },			\
148  { "yellowknife",	 0,						\
149    N_("Link with libyk.a, libc.a and crt0.o") },			\
150  { "mvme",		 0,						\
151    N_("Link with libmvme.a, libc.a and crt0.o") },			\
152  { "emb",		 0,						\
153    N_("Set the PPC_EMB bit in the ELF flags header") },		\
154  { "vxworks",		 0, N_("no description yet") },			\
155  { "shlib",		 0, N_("no description yet") },			\
156  EXTRA_SUBTARGET_SWITCHES						\
157  { "newlib",		 0, N_("no description yet") },
158
159/* This is meant to be redefined in the host dependent files.  */
160#define EXTRA_SUBTARGET_SWITCHES
161
162/* Sometimes certain combinations of command options do not make sense
163   on a particular target machine.  You can define a macro
164   `OVERRIDE_OPTIONS' to take account of this.  This macro, if
165   defined, is executed once just after all the command options have
166   been parsed.
167
168   The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to
169   get control.  */
170
171#define SUBTARGET_OVERRIDE_OPTIONS					\
172do {									\
173  if (!g_switch_set)							\
174    g_switch_value = SDATA_DEFAULT_SIZE;				\
175									\
176  if (!strcmp (rs6000_abi_name, "sysv"))				\
177    rs6000_current_abi = ABI_V4;					\
178  else if (!strcmp (rs6000_abi_name, "sysv-noeabi"))			\
179    {									\
180      rs6000_current_abi = ABI_V4;					\
181      target_flags &= ~ MASK_EABI;					\
182    }									\
183  else if (!strcmp (rs6000_abi_name, "sysv-eabi")			\
184	   || !strcmp (rs6000_abi_name, "eabi"))			\
185    {									\
186      rs6000_current_abi = ABI_V4;					\
187      target_flags |= MASK_EABI;					\
188    }									\
189  else if (!strcmp (rs6000_abi_name, "aix"))				\
190    {									\
191      rs6000_current_abi = ABI_AIX_NODESC;				\
192      target_flags |= MASK_EABI;					\
193    }									\
194  else if (!strcmp (rs6000_abi_name, "aixdesc"))			\
195    rs6000_current_abi = ABI_AIX;					\
196  else if (!strcmp (rs6000_abi_name, "freebsd"))			\
197    rs6000_current_abi = ABI_V4;					\
198  else if (!strcmp (rs6000_abi_name, "linux"))				\
199    rs6000_current_abi = ABI_V4;					\
200  else if (!strcmp (rs6000_abi_name, "gnu"))				\
201    rs6000_current_abi = ABI_V4;					\
202  else if (!strcmp (rs6000_abi_name, "netbsd"))				\
203    rs6000_current_abi = ABI_V4;					\
204  else if (!strcmp (rs6000_abi_name, "i960-old"))			\
205    {									\
206      rs6000_current_abi = ABI_V4;					\
207      target_flags |= (MASK_LITTLE_ENDIAN | MASK_EABI			\
208		       | MASK_NO_BITFIELD_WORD);			\
209      target_flags &= ~MASK_STRICT_ALIGN;				\
210    }									\
211  else									\
212    {									\
213      rs6000_current_abi = ABI_V4;					\
214      error ("bad value for -mcall-%s", rs6000_abi_name);		\
215    }									\
216									\
217  if (rs6000_sdata_name)						\
218    {									\
219      if (!strcmp (rs6000_sdata_name, "none"))				\
220	rs6000_sdata = SDATA_NONE;					\
221      else if (!strcmp (rs6000_sdata_name, "data"))			\
222	rs6000_sdata = SDATA_DATA;					\
223      else if (!strcmp (rs6000_sdata_name, "default"))			\
224	rs6000_sdata = (TARGET_EABI) ? SDATA_EABI : SDATA_SYSV;		\
225      else if (!strcmp (rs6000_sdata_name, "sysv"))			\
226	rs6000_sdata = SDATA_SYSV;					\
227      else if (!strcmp (rs6000_sdata_name, "eabi"))			\
228	rs6000_sdata = SDATA_EABI;					\
229      else								\
230	error ("bad value for -msdata=%s", rs6000_sdata_name);		\
231    }									\
232  else if (DEFAULT_ABI == ABI_V4)					\
233    {									\
234      rs6000_sdata = SDATA_DATA;					\
235      rs6000_sdata_name = "data";					\
236    }									\
237  else									\
238    {									\
239      rs6000_sdata = SDATA_NONE;					\
240      rs6000_sdata_name = "none";					\
241    }									\
242									\
243  if (TARGET_RELOCATABLE &&						\
244      (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV))	\
245    {									\
246      rs6000_sdata = SDATA_DATA;					\
247      error ("-mrelocatable and -msdata=%s are incompatible",		\
248	     rs6000_sdata_name);					\
249    }									\
250									\
251  else if (flag_pic &&							\
252	   (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV))	\
253    {									\
254      rs6000_sdata = SDATA_DATA;					\
255      error ("-f%s and -msdata=%s are incompatible",			\
256	     (flag_pic > 1) ? "PIC" : "pic",				\
257	     rs6000_sdata_name);					\
258    }									\
259									\
260  if (rs6000_sdata != SDATA_NONE && DEFAULT_ABI != ABI_V4)		\
261    {									\
262      rs6000_sdata = SDATA_NONE;					\
263      error ("-msdata=%s and -mcall-%s are incompatible",		\
264	     rs6000_sdata_name, rs6000_abi_name);			\
265    }									\
266									\
267  if (TARGET_RELOCATABLE && !TARGET_MINIMAL_TOC)			\
268    {									\
269      target_flags |= MASK_MINIMAL_TOC;					\
270      error ("-mrelocatable and -mno-minimal-toc are incompatible");	\
271    }									\
272									\
273  if (TARGET_RELOCATABLE && rs6000_current_abi == ABI_AIX)		\
274    {									\
275      target_flags &= ~MASK_RELOCATABLE;				\
276      error ("-mrelocatable and -mcall-%s are incompatible",		\
277	     rs6000_abi_name);						\
278    }									\
279									\
280  if (flag_pic > 1 && rs6000_current_abi == ABI_AIX)			\
281    {									\
282      flag_pic = 0;							\
283      error ("-fPIC and -mcall-%s are incompatible",			\
284	     rs6000_abi_name);						\
285    }									\
286									\
287  if (rs6000_current_abi == ABI_AIX && TARGET_LITTLE_ENDIAN)		\
288    {									\
289      target_flags &= ~MASK_LITTLE_ENDIAN;				\
290      error ("-mcall-aixdesc must be big endian");			\
291    }									\
292									\
293  /* Treat -fPIC the same as -mrelocatable.  */				\
294  if (flag_pic > 1)							\
295    target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC; \
296									\
297  else if (TARGET_RELOCATABLE)						\
298    flag_pic = 2;							\
299									\
300} while (0)
301
302
303/* Override rs6000.h definition.  */
304#undef	TARGET_DEFAULT
305#define	TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS)
306
307/* Override rs6000.h definition.  */
308#undef	PROCESSOR_DEFAULT
309#define	PROCESSOR_DEFAULT PROCESSOR_PPC750
310
311#define FIXED_R2 1
312/* System V.4 uses register 13 as a pointer to the small data area,
313   so it is not available to the normal user.  */
314#define FIXED_R13 1
315
316/* Size of the V.4 varargs area if needed.  */
317/* Override rs6000.h definition.  */
318#undef	RS6000_VARARGS_AREA
319#define RS6000_VARARGS_AREA ((cfun->machine->sysv_varargs_p) ? RS6000_VARARGS_SIZE : 0)
320
321/* Override default big endianism definitions in rs6000.h.  */
322#undef	BYTES_BIG_ENDIAN
323#undef	WORDS_BIG_ENDIAN
324#define	BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN)
325#define	WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN)
326
327/* Define this to set the endianness to use in libgcc2.c, which can
328   not depend on target_flags.  */
329#if !defined(_LITTLE_ENDIAN) && !defined(__sun__)
330#define LIBGCC2_WORDS_BIG_ENDIAN 1
331#else
332#define LIBGCC2_WORDS_BIG_ENDIAN 0
333#endif
334
335/* Define cutoff for using external functions to save floating point.
336   Currently on V.4, always use inline stores.  */
337#define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 64)
338
339/* Put jump tables in read-only memory, rather than in .text.  */
340#define JUMP_TABLES_IN_TEXT_SECTION 0
341
342/* Prefix and suffix to use to saving floating point.  */
343#define	SAVE_FP_PREFIX "_savefpr_"
344#define SAVE_FP_SUFFIX "_l"
345
346/* Prefix and suffix to use to restoring floating point.  */
347#define	RESTORE_FP_PREFIX "_restfpr_"
348#define RESTORE_FP_SUFFIX "_l"
349
350/* Type used for ptrdiff_t, as a string used in a declaration.  */
351#define PTRDIFF_TYPE "int"
352
353/* Type used for wchar_t, as a string used in a declaration.  */
354/* Override svr4.h definition.  */
355#undef	WCHAR_TYPE
356#define WCHAR_TYPE "long int"
357
358/* Width of wchar_t in bits.  */
359/* Override svr4.h definition.  */
360#undef	WCHAR_TYPE_SIZE
361#define WCHAR_TYPE_SIZE 32
362
363/* Make int foo : 8 not cause structures to be aligned to an int boundary.  */
364/* Override elfos.h definition.  */
365#undef	PCC_BITFIELD_TYPE_MATTERS
366#define	PCC_BITFIELD_TYPE_MATTERS (TARGET_BITFIELD_TYPE)
367
368#undef	BITFIELD_NBYTES_LIMITED
369#define	BITFIELD_NBYTES_LIMITED (TARGET_NO_BITFIELD_WORD)
370
371/* Define this macro to be the value 1 if instructions will fail to
372   work if given data not on the nominal alignment.  If instructions
373   will merely go slower in that case, define this macro as 0.  */
374#undef	STRICT_ALIGNMENT
375#define	STRICT_ALIGNMENT (TARGET_STRICT_ALIGN)
376
377/* Alignment in bits of the stack boundary.  Note, in order to allow building
378   one set of libraries with -mno-eabi instead of eabi libraries and non-eabi
379   versions, just use 64 as the stack boundary.  */
380#undef	STACK_BOUNDARY
381#define	STACK_BOUNDARY	(TARGET_ALTIVEC_ABI ? 128 : 64)
382
383/* Real stack boundary as mandated by the appropriate ABI.  */
384#define ABI_STACK_BOUNDARY ((TARGET_EABI && !TARGET_ALTIVEC_ABI) ? 64 : 128)
385
386/* No data type wants to be aligned rounder than this.  */
387#undef	BIGGEST_ALIGNMENT
388#define BIGGEST_ALIGNMENT ((TARGET_EABI && !TARGET_ALTIVEC) ? 64 : 128)
389
390/* An expression for the alignment of a structure field FIELD if the
391   alignment computed in the usual way is COMPUTED.  */
392#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED)				      \
393	((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)     \
394	 ? 128 : COMPUTED)
395
396/* Define this macro as an expression for the alignment of a type
397   (given by TYPE as a tree node) if the alignment computed in the
398   usual way is COMPUTED and the alignment explicitly specified was
399   SPECIFIED.  */
400#define ROUND_TYPE_ALIGN(TYPE, COMPUTED, SPECIFIED)			\
401	((TARGET_ALTIVEC  && TREE_CODE (TYPE) == VECTOR_TYPE)	        \
402	 ? MAX (MAX ((COMPUTED), (SPECIFIED)), 128)                     \
403         : MAX (COMPUTED, SPECIFIED))
404
405#undef  BIGGEST_FIELD_ALIGNMENT
406#undef  ADJUST_FIELD_ALIGN
407
408/* Use ELF style section commands.  */
409
410#define	TEXT_SECTION_ASM_OP	"\t.section\t\".text\""
411
412#define	DATA_SECTION_ASM_OP	"\t.section\t\".data\""
413
414#define	BSS_SECTION_ASM_OP	"\t.section\t\".bss\""
415
416/* Override elfos.h definition.  */
417#undef	INIT_SECTION_ASM_OP
418#define	INIT_SECTION_ASM_OP "\t.section\t\".init\",\"ax\""
419
420/* Override elfos.h definition.  */
421#undef	FINI_SECTION_ASM_OP
422#define	FINI_SECTION_ASM_OP "\t.section\t\".fini\",\"ax\""
423
424#define	TOC_SECTION_ASM_OP "\t.section\t\".got\",\"aw\""
425
426/* Put PC relative got entries in .got2.  */
427#define	MINIMAL_TOC_SECTION_ASM_OP \
428  ((TARGET_RELOCATABLE || flag_pic) ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"")
429
430#define	SDATA_SECTION_ASM_OP "\t.section\t\".sdata\",\"aw\""
431#define	SDATA2_SECTION_ASM_OP "\t.section\t\".sdata2\",\"a\""
432#define	SBSS_SECTION_ASM_OP "\t.section\t\".sbss\",\"aw\",@nobits"
433
434/* Besides the usual ELF sections, we need a toc section.  */
435/* Override elfos.h definition.  */
436#undef	EXTRA_SECTIONS
437#define	EXTRA_SECTIONS in_const, in_toc, in_sdata, in_sdata2, in_sbss, in_init, in_fini
438
439/* Override elfos.h definition.  */
440#undef	EXTRA_SECTION_FUNCTIONS
441#define	EXTRA_SECTION_FUNCTIONS						\
442  CONST_SECTION_FUNCTION						\
443  TOC_SECTION_FUNCTION							\
444  SDATA_SECTION_FUNCTION						\
445  SDATA2_SECTION_FUNCTION						\
446  SBSS_SECTION_FUNCTION							\
447  INIT_SECTION_FUNCTION							\
448  FINI_SECTION_FUNCTION
449
450#define	TOC_SECTION_FUNCTION						\
451void									\
452toc_section ()								\
453{									\
454  if (in_section != in_toc)						\
455    {									\
456      in_section = in_toc;						\
457      if (DEFAULT_ABI == ABI_AIX					\
458	  && TARGET_MINIMAL_TOC						\
459	  && !TARGET_RELOCATABLE)					\
460	{								\
461	  if (! toc_initialized)					\
462	    {								\
463	      toc_initialized = 1;					\
464	      fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP);	\
465	      ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LCTOC", 0);	\
466	      fprintf (asm_out_file, "\t.tc ");				\
467	      ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1[TC],"); \
468	      ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
469	      fprintf (asm_out_file, "\n");				\
470									\
471	      fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
472	      ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
473	      fprintf (asm_out_file, " = .+32768\n");			\
474	    }								\
475	  else								\
476	    fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);	\
477	}								\
478      else if (DEFAULT_ABI == ABI_AIX && !TARGET_RELOCATABLE)		\
479	fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP);		\
480      else								\
481	{								\
482	  fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);	\
483	  if (! toc_initialized)					\
484	    {								\
485	      ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
486	      fprintf (asm_out_file, " = .+32768\n");			\
487	      toc_initialized = 1;					\
488	    }								\
489	}								\
490    }									\
491}									\
492									\
493extern int in_toc_section PARAMS ((void));				\
494int in_toc_section ()							\
495{									\
496  return in_section == in_toc;						\
497}
498
499#define	SDATA_SECTION_FUNCTION						\
500void									\
501sdata_section ()							\
502{									\
503  if (in_section != in_sdata)						\
504    {									\
505      in_section = in_sdata;						\
506      fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP);		\
507    }									\
508}
509
510#define	SDATA2_SECTION_FUNCTION						\
511void									\
512sdata2_section ()							\
513{									\
514  if (in_section != in_sdata2)						\
515    {									\
516      in_section = in_sdata2;						\
517      fprintf (asm_out_file, "%s\n", SDATA2_SECTION_ASM_OP);		\
518    }									\
519}
520
521#define	SBSS_SECTION_FUNCTION						\
522void									\
523sbss_section ()								\
524{									\
525  if (in_section != in_sbss)						\
526    {									\
527      in_section = in_sbss;						\
528      fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP);		\
529    }									\
530}
531
532#define	INIT_SECTION_FUNCTION						\
533void									\
534init_section ()								\
535{									\
536  if (in_section != in_init)						\
537    {									\
538      in_section = in_init;						\
539      fprintf (asm_out_file, "%s\n", INIT_SECTION_ASM_OP);		\
540    }									\
541}
542
543#define	FINI_SECTION_FUNCTION						\
544void									\
545fini_section ()								\
546{									\
547  if (in_section != in_fini)						\
548    {									\
549      in_section = in_fini;						\
550      fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP);		\
551    }									\
552}
553
554/* A C statement or statements to switch to the appropriate section
555   for output of RTX in mode MODE.  You can assume that RTX is some
556   kind of constant in RTL.  The argument MODE is redundant except in
557   the case of a `const_int' rtx.  Select the section by calling
558   `text_section' or one of the alternatives for other sections.
559
560   Do not define this macro if you put all constants in the read-only
561   data section.  */
562
563/* Override elfos.h definition.  */
564#undef	SELECT_RTX_SECTION
565#define	SELECT_RTX_SECTION(MODE, X, ALIGN) rs6000_select_rtx_section (MODE, X)
566
567/* A C statement or statements to switch to the appropriate
568   section for output of DECL.  DECL is either a `VAR_DECL' node
569   or a constant of some sort.  RELOC indicates whether forming
570   the initial value of DECL requires link-time relocations.  */
571
572/* Override elfos.h definition.  */
573#undef	SELECT_SECTION
574#define	SELECT_SECTION(DECL, RELOC, ALIGN) rs6000_select_section (DECL, RELOC)
575
576/* A C statement to build up a unique section name, expressed as a
577   STRING_CST node, and assign it to DECL_SECTION_NAME (decl).
578   RELOC indicates whether the initial value of EXP requires
579   link-time relocations.  If you do not define this macro, GCC will use
580   the symbol name prefixed by `.' as the section name.  Note - this
581   macro can now be called for uninitialized data items as well as
582   initialised data and functions.  */
583
584/* Override elfos.h definition.  */
585#undef	UNIQUE_SECTION
586#define UNIQUE_SECTION(DECL, RELOC) rs6000_unique_section (DECL, RELOC)
587
588/* Return non-zero if this entry is to be written into the constant pool
589   in a special way.  We do so if this is a SYMBOL_REF, LABEL_REF or a CONST
590   containing one of them.  If -mfp-in-toc (the default), we also do
591   this for floating-point constants.  We actually can only do this
592   if the FP formats of the target and host machines are the same, but
593   we can't check that since not every file that uses
594   GO_IF_LEGITIMATE_ADDRESS_P includes real.h.
595
596   Unlike AIX, we don't key off of -mminimal-toc, but instead do not
597   allow floating point constants in the TOC if -mrelocatable.  */
598
599#undef	ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
600#define	ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE)			\
601  (TARGET_TOC								\
602   && (GET_CODE (X) == SYMBOL_REF					\
603       || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS	\
604	   && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF)		\
605       || GET_CODE (X) == LABEL_REF					\
606       || (GET_CODE (X) == CONST_INT 					\
607	   && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode))	\
608       || (!TARGET_NO_FP_IN_TOC						\
609	   && !TARGET_RELOCATABLE					\
610	   && GET_CODE (X) == CONST_DOUBLE				\
611	   && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT		\
612	   && BITS_PER_WORD == HOST_BITS_PER_INT)))
613
614/* These macros generate the special .type and .size directives which
615   are used to set the corresponding fields of the linker symbol table
616   entries in an ELF object file under SVR4.  These macros also output
617   the starting labels for the relevant functions/objects.  */
618
619/* Write the extra assembler code needed to declare a function properly.
620   Some svr4 assemblers need to also have something extra said about the
621   function's return value.  We allow for that here.  */
622
623extern int rs6000_pic_labelno;
624
625/* Override elfos.h definition.  */
626#undef	ASM_DECLARE_FUNCTION_NAME
627#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)			\
628  do {									\
629    const char *const init_ptr = (TARGET_64BIT) ? ".quad" : ".long";	\
630									\
631    if (TARGET_RELOCATABLE 						\
632	&& (get_pool_size () != 0 || current_function_profile)		\
633	&& uses_TOC())							\
634      {									\
635	char buf[256];							\
636									\
637	ASM_OUTPUT_INTERNAL_LABEL (FILE, "LCL", rs6000_pic_labelno);	\
638									\
639	ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1);			\
640	fprintf (FILE, "\t%s ", init_ptr);				\
641	assemble_name (FILE, buf);					\
642	putc ('-', FILE);						\
643	ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno);	\
644	assemble_name (FILE, buf);					\
645	putc ('\n', FILE);						\
646      }									\
647									\
648    fprintf (FILE, "%s", TYPE_ASM_OP);					\
649    assemble_name (FILE, NAME);						\
650    putc (',', FILE);							\
651    fprintf (FILE, TYPE_OPERAND_FMT, "function");			\
652    putc ('\n', FILE);							\
653    ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL));			\
654									\
655    if (DEFAULT_ABI == ABI_AIX)						\
656      {									\
657	const char *desc_name, *orig_name;				\
658									\
659        STRIP_NAME_ENCODING (orig_name, NAME);				\
660        desc_name = orig_name;						\
661	while (*desc_name == '.')					\
662	  desc_name++;							\
663									\
664	if (TREE_PUBLIC (DECL))						\
665	  fprintf (FILE, "\t.globl %s\n", desc_name);			\
666									\
667	fprintf (FILE, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);		\
668	fprintf (FILE, "%s:\n", desc_name);				\
669	fprintf (FILE, "\t%s %s\n", init_ptr, orig_name);		\
670	fprintf (FILE, "\t%s _GLOBAL_OFFSET_TABLE_\n", init_ptr);	\
671	if (DEFAULT_ABI == ABI_AIX)					\
672	  fprintf (FILE, "\t%s 0\n", init_ptr);				\
673	fprintf (FILE, "\t.previous\n");				\
674      }									\
675    ASM_OUTPUT_LABEL (FILE, NAME);					\
676  } while (0)
677
678/* A C compound statement that outputs the assembler code for a thunk function,
679    used to implement C++ virtual function calls with multiple inheritance.  The
680    thunk acts as a wrapper around a virtual function, adjusting the implicit
681    object parameter before handing control off to the real function.
682
683    First, emit code to add the integer DELTA to the location that contains the
684    incoming first argument.  Assume that this argument contains a pointer, and
685    is the one used to pass the this' pointer in C++.  This is the incoming
686    argument *before* the function prologue, e.g. %o0' on a sparc.  The
687    addition must preserve the values of all other incoming arguments.
688
689    After the addition, emit code to jump to FUNCTION, which is a
690    FUNCTION_DECL'.  This is a direct pure jump, not a call, and does not touch
691    the return address.  Hence returning from FUNCTION will return to whoever
692    called the current thunk'.
693
694    The effect must be as if FUNCTION had been called directly with the adjusted
695    first argument.  This macro is responsible for emitting all of the code for
696    a thunk function; FUNCTION_PROLOGUE' and FUNCTION_EPILOGUE' are not
697    invoked.
698
699    The THUNK_FNDECL is redundant.  (DELTA and FUNCTION have already been
700    extracted from it.)  It might possibly be useful on some targets, but
701    probably not.
702
703    If you do not define this macro, the target-independent code in the C++
704    frontend will generate a less efficient heavyweight thunk that calls
705    FUNCTION instead of jumping to it.  The generic approach does not support
706    varargs.  */
707
708#define	ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
709  output_mi_thunk (FILE, THUNK_FNDECL, DELTA, FUNCTION)
710
711/* The USER_LABEL_PREFIX stuff is affected by the -fleading-underscore
712   flag.  The LOCAL_LABEL_PREFIX variable is used by dbxelf.h.  */
713
714#define	LOCAL_LABEL_PREFIX "."
715#define	USER_LABEL_PREFIX ""
716
717/* svr4.h overrides ASM_OUTPUT_INTERNAL_LABEL.  */
718
719#define	ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX)	\
720  asm_fprintf (FILE, "%L%s", PREFIX)
721
722#define	ASM_OUTPUT_LABEL(FILE,NAME)	\
723  (assemble_name (FILE, NAME), fputs (":\n", FILE))
724
725/* This is how to output a command to make the user-level label named NAME
726   defined for reference from other files.  */
727
728#define	ASM_GLOBALIZE_LABEL(FILE,NAME)	\
729  do { fputs ("\t.globl ", FILE);	\
730       assemble_name (FILE, NAME); putc ('\n', FILE);} while (0)
731
732/* This says how to output assembler code to declare an
733   uninitialized internal linkage data object.  Under SVR4,
734   the linker seems to want the alignment of data objects
735   to depend on their types.  We do exactly that here.  */
736
737#define	LOCAL_ASM_OP	"\t.local\t"
738
739#define	LCOMM_ASM_OP	"\t.lcomm\t"
740
741/* Override elfos.h definition.  */
742#undef	ASM_OUTPUT_ALIGNED_LOCAL
743#define	ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN)		\
744do {									\
745  if (rs6000_sdata != SDATA_NONE && (SIZE) > 0				\
746      && (SIZE) <= g_switch_value)					\
747    {									\
748      sbss_section ();							\
749      ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT));	\
750      ASM_OUTPUT_LABEL (FILE, NAME);					\
751      ASM_OUTPUT_SKIP (FILE, SIZE);					\
752      if (!flag_inhibit_size_directive && (SIZE) > 0)			\
753	{								\
754	  fprintf (FILE, "%s", SIZE_ASM_OP);				\
755	  assemble_name (FILE, NAME);					\
756	  fprintf (FILE, ",%d\n",  SIZE);				\
757	}								\
758    }									\
759  else									\
760    {									\
761      fprintf (FILE, "%s", LCOMM_ASM_OP);				\
762      assemble_name ((FILE), (NAME));					\
763      fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT);	\
764    }									\
765} while (0)
766
767/* Describe how to emit uninitialized external linkage items.  */
768#define	ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN)		\
769do {									\
770  ASM_GLOBALIZE_LABEL (FILE, NAME);					\
771  ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN);			\
772} while (0)
773
774/* Switch  Recognition by gcc.c.  Add -G xx support.  */
775
776/* Override svr4.h definition.  */
777#undef	SWITCH_TAKES_ARG
778#define	SWITCH_TAKES_ARG(CHAR)						\
779  ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o'			\
780   || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u'			\
781   || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x'			\
782   || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V'			\
783   || (CHAR) == 'B' || (CHAR) == 'b' || (CHAR) == 'G')
784
785/* Output .file.  */
786/* Override elfos.h definition.  */
787#undef	ASM_FILE_START
788#define	ASM_FILE_START(FILE)						\
789do {									\
790  output_file_directive ((FILE), main_input_filename);			\
791  rs6000_file_start (FILE, TARGET_CPU_DEFAULT);				\
792} while (0)
793
794
795extern int fixuplabelno;
796
797/* Handle constructors specially for -mrelocatable.  */
798#define TARGET_ASM_CONSTRUCTOR  rs6000_elf_asm_out_constructor
799#define TARGET_ASM_DESTRUCTOR   rs6000_elf_asm_out_destructor
800
801/* This is the end of what might become sysv4.h.  */
802
803/* Use DWARF 2 debugging information by default.  */
804#undef	PREFERRED_DEBUGGING_TYPE
805#define	PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
806
807/* Historically we have also supported stabs debugging.  */
808#define	DBX_DEBUGGING_INFO
809
810/* If we are referencing a function that is static or is known to be
811   in this file, make the SYMBOL_REF special.  We can use this to indicate
812   that we can branch to this function without emitting a no-op after the
813   call.  For real AIX calling sequences, we also replace the
814   function name with the real name (1 or 2 leading .'s), rather than
815   the function descriptor name.  This saves a lot of overriding code
816   to read the prefixes.  */
817
818#undef	ENCODE_SECTION_INFO
819#define	ENCODE_SECTION_INFO(DECL) rs6000_encode_section_info (DECL)
820
821/* The ELF version doesn't encode [DS] or whatever at the end of symbols.  */
822
823#define	RS6000_OUTPUT_BASENAME(FILE, NAME)	\
824    assemble_name (FILE, NAME)
825
826/* This macro gets just the user-specified name
827   out of the string in a SYMBOL_REF.  Discard
828   a leading * or @.  */
829#define	STRIP_NAME_ENCODING(VAR,SYMBOL_NAME)				\
830do {									\
831  const char *_name = SYMBOL_NAME;					\
832  while (*_name == '*' || *_name == '@')				\
833    _name++;								\
834  (VAR) = _name;							\
835} while (0)
836
837/* This is how to output a reference to a user-level label named NAME.
838   `assemble_name' uses this.  */
839
840/* Override elfos.h definition.  */
841#undef	ASM_OUTPUT_LABELREF
842#define	ASM_OUTPUT_LABELREF(FILE,NAME)		\
843do {						\
844  const char *_name = NAME;			\
845  if (*_name == '@')				\
846    _name++;					\
847 						\
848  if (*_name == '*')				\
849    fprintf (FILE, "%s", _name + 1);		\
850  else						\
851    asm_fprintf (FILE, "%U%s", _name);		\
852} while (0)
853
854/* But, to make this work, we have to output the stabs for the function
855   name *first*...  */
856
857#define	DBX_FUNCTION_FIRST
858
859/* This is the end of what might become sysv4dbx.h.  */
860
861#ifndef	TARGET_VERSION
862#define	TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)");
863#endif
864
865#ifndef	CPP_PREDEFINES
866#define	CPP_PREDEFINES \
867  "-DPPC -Dunix -D__svr4__ -Asystem=unix -Asystem=svr4 -Acpu=powerpc -Amachine=powerpc"
868#endif
869
870/* Pass various options to the assembler.  */
871/* Override svr4.h definition.  */
872#undef	ASM_SPEC
873#define	ASM_SPEC "%(asm_cpu) \
874%{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \
875%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
876%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \
877%{memb} %{!memb: %{msdata: -memb} %{msdata=eabi: -memb}} \
878%{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian} \
879%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
880    %{mcall-freebsd: -mbig} \
881    %{mcall-i960-old: -mlittle} \
882    %{mcall-linux: -mbig} \
883    %{mcall-gnu: -mbig} \
884    %{mcall-netbsd: -mbig} \
885}}}}"
886
887#define	CC1_ENDIAN_BIG_SPEC ""
888
889#define	CC1_ENDIAN_LITTLE_SPEC "\
890%{!mstrict-align: %{!mno-strict-align: \
891    %{!mcall-i960-old: \
892	-mstrict-align \
893    } \
894}}"
895
896#define	CC1_ENDIAN_DEFAULT_SPEC "%(cc1_endian_big)"
897
898/* Pass -G xxx to the compiler and set correct endian mode.  */
899#define	CC1_SPEC "%{G*} \
900%{mlittle: %(cc1_endian_little)} %{!mlittle: %{mlittle-endian: %(cc1_endian_little)}} \
901%{mbig: %(cc1_endian_big)} %{!mbig: %{mbig-endian: %(cc1_endian_big)}} \
902%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
903    %{mcall-aixdesc: -mbig %(cc1_endian_big) } \
904    %{mcall-freebsd: -mbig %(cc1_endian_big) } \
905    %{mcall-i960-old: -mlittle %(cc1_endian_little) } \
906    %{mcall-linux: -mbig %(cc1_endian_big) } \
907    %{mcall-gnu: -mbig %(cc1_endian_big) } \
908    %{mcall-netbsd: -mbig %(cc1_endian_big) } \
909    %{!mcall-aixdesc: %{!mcall-freebsd: %{!mcall-i960-old: %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd: \
910	    %(cc1_endian_default) \
911    }}}}}} \
912}}}} \
913%{mno-sdata: -msdata=none } \
914%{meabi: %{!mcall-*: -mcall-sysv }} \
915%{!meabi: %{!mno-eabi: \
916    %{mrelocatable: -meabi } \
917    %{mcall-freebsd: -mno-eabi } \
918    %{mcall-i960-old: -meabi } \
919    %{mcall-linux: -mno-eabi } \
920    %{mcall-gnu: -mno-eabi } \
921    %{mcall-netbsd: -mno-eabi }}} \
922%{msdata: -msdata=default} \
923%{mno-sdata: -msdata=none} \
924%{profile: -p}"
925
926/* Don't put -Y P,<path> for cross compilers.  */
927#ifndef CROSS_COMPILE
928#define LINK_PATH_SPEC "\
929%{!R*:%{L*:-R %*}} \
930%{!nostdlib: %{!YP,*: \
931    %{compat-bsd: \
932	%{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
933	%{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}} \
934	%{!R*: %{!L*: -R /usr/ucblib}} \
935    %{!compat-bsd: \
936	%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
937	%{!p:-Y P,/usr/ccs/lib:/usr/lib}}}}"
938
939#else
940#define LINK_PATH_SPEC ""
941#endif
942
943/* Default starting address if specified.  */
944#define LINK_START_SPEC "\
945%{mads: %(link_start_ads) } \
946%{myellowknife: %(link_start_yellowknife) } \
947%{mmvme: %(link_start_mvme) } \
948%{msim: %(link_start_sim) } \
949%{mcall-freebsd: %(link_start_freebsd) } \
950%{mcall-linux: %(link_start_linux) } \
951%{mcall-gnu: %(link_start_gnu) } \
952%{mcall-netbsd: %(link_start_netbsd) } \
953%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-gnu: \
954	%{!mcall-netbsd: %{!mcall-freebsd: %(link_start_default) }}}}}}}}"
955
956#define LINK_START_DEFAULT_SPEC ""
957
958/* Override svr4.h definition.  */
959#undef	LINK_SPEC
960#define	LINK_SPEC "\
961%{h*} %{v:-V} %{!msdata=none:%{G*}} %{msdata=none:-G0} \
962%{YP,*} %{R*} \
963%{Qy:} %{!Qn:-Qy} \
964%(link_shlib) \
965%{!Wl,-T*: %{!T*: %(link_start) }} \
966%(link_target) \
967%(link_os)"
968
969/* For now, turn off shared libraries by default.  */
970#ifndef SHARED_LIB_SUPPORT
971#define NO_SHARED_LIB_SUPPORT
972#endif
973
974#ifndef NO_SHARED_LIB_SUPPORT
975/* Shared libraries are default.  */
976#define LINK_SHLIB_SPEC "\
977%{!static: %(link_path) %{!R*:%{L*:-R %*}}} \
978%{mshlib: } \
979%{static:-dn -Bstatic} \
980%{shared:-G -dy -z text} \
981%{symbolic:-Bsymbolic -G -dy -z text}"
982
983#else
984/* Shared libraries are not default.  */
985#define LINK_SHLIB_SPEC "\
986%{mshlib: %(link_path) } \
987%{!mshlib: %{!shared: %{!symbolic: -dn -Bstatic}}} \
988%{static: } \
989%{shared:-G -dy -z text %(link_path) } \
990%{symbolic:-Bsymbolic -G -dy -z text %(link_path) }"
991#endif
992
993/* Override the default target of the linker.  */
994#define	LINK_TARGET_SPEC "\
995%{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } \
996%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
997    %{mcall-i960-old: --oformat elf32-powerpcle} \
998  }}}}"
999
1000/* Any specific OS flags.  */
1001#define LINK_OS_SPEC "\
1002%{mads: %(link_os_ads) } \
1003%{myellowknife: %(link_os_yellowknife) } \
1004%{mmvme: %(link_os_mvme) } \
1005%{msim: %(link_os_sim) } \
1006%{mcall-freebsd: %(link_os_freebsd) } \
1007%{mcall-linux: %(link_os_linux) } \
1008%{mcall-gnu: %(link_os_gnu) } \
1009%{mcall-netbsd: %(link_os_netbsd) } \
1010%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd: %(link_os_default) }}}}}}}}"
1011
1012#define LINK_OS_DEFAULT_SPEC ""
1013
1014#define CPP_SYSV_SPEC \
1015"%{mrelocatable*: -D_RELOCATABLE} \
1016%{fpic: -D__PIC__=1 -D__pic__=1} \
1017%{!fpic: %{fPIC: -D__PIC__=2 -D__pic__=2}} \
1018%{mlong-double-128: -D__LONG_DOUBLE_128__=1} \
1019%{!mlong-double-64: %(cpp_longdouble_default)} \
1020%{mcall-sysv: -D_CALL_SYSV} \
1021%{mcall-aix: -D_CALL_AIX} %{mcall-aixdesc: -D_CALL_AIX -D_CALL_AIXDESC} \
1022%{!mcall-sysv: %{!mcall-aix: %{!mcall-aixdesc: %(cpp_sysv_default) }}} \
1023%{msoft-float: -D_SOFT_FLOAT} \
1024%{!msoft-float: %{!mhard-float: \
1025    %{mcpu=401: -D_SOFT_FLOAT} \
1026    %{mcpu=403: -D_SOFT_FLOAT} \
1027    %{mcpu=405: -D_SOFT_FLOAT} \
1028    %{mcpu=ec603e: -D_SOFT_FLOAT} \
1029    %{mcpu=801: -D_SOFT_FLOAT} \
1030    %{mcpu=821: -D_SOFT_FLOAT} \
1031    %{mcpu=823: -D_SOFT_FLOAT} \
1032    %{mcpu=860: -D_SOFT_FLOAT} \
1033    %{!mcpu*: %(cpp_float_default) }}}"
1034
1035/* Whether floating point is disabled by default.  */
1036#define	CPP_FLOAT_DEFAULT_SPEC ""
1037
1038/* Whether 'long double' is 128 bits by default.  */
1039#define	CPP_LONGDOUBLE_DEFAULT_SPEC ""
1040
1041#define	CPP_SYSV_DEFAULT_SPEC "-D_CALL_SYSV"
1042
1043#define CPP_ENDIAN_BIG_SPEC "-D_BIG_ENDIAN -D__BIG_ENDIAN__ -Amachine=bigendian"
1044
1045#define CPP_ENDIAN_LITTLE_SPEC "-D_LITTLE_ENDIAN -D__LITTLE_ENDIAN__ -Amachine=littleendian"
1046
1047#define	CPP_ENDIAN_SPEC \
1048"%{mlittle: %(cpp_endian_little) } \
1049%{mlittle-endian: %(cpp_endian_little) } \
1050%{mbig: %(cpp_endian_big) } \
1051%{mbig-endian: %(cpp_endian_big) } \
1052%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
1053    %{mcall-freebsd: %(cpp_endian_big) } \
1054    %{mcall-linux: %(cpp_endian_big) } \
1055    %{mcall-gnu: %(cpp_endian_big) } \
1056    %{mcall-netbsd: %(cpp_endian_big) } \
1057    %{mcall-i960-old: %(cpp_endian_little) } \
1058    %{mcall-aixdesc:  %(cpp_endian_big) } \
1059    %{!mcall-linux: %{!mcall-gnu: %{!mcall-freebsd: %{!mcall-netbsd: %{!mcall-aixdesc: %(cpp_endian_default) }}}}}}}}}"
1060
1061#define	CPP_ENDIAN_DEFAULT_SPEC "%(cpp_endian_big)"
1062
1063/* Override rs6000.h definition.  */
1064#undef	CPP_SPEC
1065#define	CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_sysv) %(cpp_endian) %(cpp_cpu) \
1066%{mads: %(cpp_os_ads) } \
1067%{myellowknife: %(cpp_os_yellowknife) } \
1068%{mmvme: %(cpp_os_mvme) } \
1069%{msim: %(cpp_os_sim) } \
1070%{mcall-freebsd: %(cpp_os_freebsd) } \
1071%{mcall-linux: %(cpp_os_linux) } \
1072%{mcall-gnu: %(cpp_os_gnu) } \
1073%{mcall-netbsd: %(cpp_os_netbsd) } \
1074%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd: %(cpp_os_default) }}}}}}}}"
1075
1076#define	CPP_OS_DEFAULT_SPEC ""
1077
1078/* Override svr4.h definition.  */
1079#undef	STARTFILE_SPEC
1080#define	STARTFILE_SPEC "\
1081%{mads: %(startfile_ads) } \
1082%{myellowknife: %(startfile_yellowknife) } \
1083%{mmvme: %(startfile_mvme) } \
1084%{msim: %(startfile_sim) } \
1085%{mcall-freebsd: %(startfile_freebsd) } \
1086%{mcall-linux: %(startfile_linux) } \
1087%{mcall-gnu: %(startfile_gnu) } \
1088%{mcall-netbsd: %(startfile_netbsd) } \
1089%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd: %(startfile_default) }}}}}}}}"
1090
1091#define	STARTFILE_DEFAULT_SPEC ""
1092
1093/* Override svr4.h definition.  */
1094#undef	LIB_SPEC
1095#define	LIB_SPEC "\
1096%{mads: %(lib_ads) } \
1097%{myellowknife: %(lib_yellowknife) } \
1098%{mmvme: %(lib_mvme) } \
1099%{msim: %(lib_sim) } \
1100%{mcall-freebsd: %(lib_freebsd) } \
1101%{mcall-linux: %(lib_linux) } \
1102%{mcall-gnu: %(lib_gnu) } \
1103%{mcall-netbsd: %(lib_netbsd) } \
1104%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd: %(lib_default) }}}}}}}}"
1105
1106#define LIB_DEFAULT_SPEC ""
1107
1108/* Override svr4.h definition.  */
1109#undef	ENDFILE_SPEC
1110#define	ENDFILE_SPEC "crtsavres.o%s \
1111%{mads: %(endfile_ads)} \
1112%{myellowknife: %(endfile_yellowknife)} \
1113%{mmvme: %(endfile_mvme)} \
1114%{msim: %(endfile_sim)} \
1115%{mcall-freebsd: %(endfile_freebsd) } \
1116%{mcall-linux: %(endfile_linux) } \
1117%{mcall-gnu: %(endfile_gnu) } \
1118%{mcall-netbsd: %(endfile_netbsd) } \
1119%{mvxworks: %(endfile_vxworks) } \
1120%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd: %{!mvxworks: %(endfile_default) }}}}}}}}}"
1121
1122#define	ENDFILE_DEFAULT_SPEC ""
1123
1124/* Motorola ADS support.  */
1125#define LIB_ADS_SPEC "--start-group -lads -lc --end-group"
1126
1127#define	STARTFILE_ADS_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
1128
1129#define	ENDFILE_ADS_SPEC "crtend.o%s ecrtn.o%s"
1130
1131#define LINK_START_ADS_SPEC "-T ads.ld%s"
1132
1133#define LINK_OS_ADS_SPEC ""
1134
1135#define CPP_OS_ADS_SPEC ""
1136
1137/* Motorola Yellowknife support.  */
1138#define LIB_YELLOWKNIFE_SPEC "--start-group -lyk -lc --end-group"
1139
1140#define	STARTFILE_YELLOWKNIFE_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
1141
1142#define	ENDFILE_YELLOWKNIFE_SPEC "crtend.o%s ecrtn.o%s"
1143
1144#define LINK_START_YELLOWKNIFE_SPEC "-T yellowknife.ld%s"
1145
1146#define LINK_OS_YELLOWKNIFE_SPEC ""
1147
1148#define CPP_OS_YELLOWKNIFE_SPEC ""
1149
1150/* Motorola MVME support.  */
1151#define LIB_MVME_SPEC "--start-group -lmvme -lc --end-group"
1152
1153#define	STARTFILE_MVME_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
1154
1155#define	ENDFILE_MVME_SPEC "crtend.o%s ecrtn.o%s"
1156
1157#define LINK_START_MVME_SPEC "-Ttext 0x40000"
1158
1159#define LINK_OS_MVME_SPEC ""
1160
1161#define CPP_OS_MVME_SPEC ""
1162
1163/* PowerPC simulator based on netbsd system calls support.  */
1164#define LIB_SIM_SPEC "--start-group -lsim -lc --end-group"
1165
1166#define	STARTFILE_SIM_SPEC "ecrti.o%s sim-crt0.o%s crtbegin.o%s"
1167
1168#define	ENDFILE_SIM_SPEC "crtend.o%s ecrtn.o%s"
1169
1170#define LINK_START_SIM_SPEC ""
1171
1172#define LINK_OS_SIM_SPEC "-m elf32ppcsim"
1173
1174#define CPP_OS_SIM_SPEC ""
1175
1176/* FreeBSD support.  */
1177
1178#define CPP_OS_FREEBSD_SPEC	"\
1179  -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ \
1180  -Acpu=powerpc -Amachine=powerpc"
1181
1182#define	STARTFILE_FREEBSD_SPEC	FBSD_STARTFILE_SPEC
1183#define ENDFILE_FREEBSD_SPEC	FBSD_ENDFILE_SPEC
1184#define LIB_FREEBSD_SPEC	FBSD_LIB_SPEC
1185#define LINK_START_FREEBSD_SPEC	""
1186
1187#define LINK_OS_FREEBSD_SPEC "\
1188  %{symbolic:-Bsymbolic}"
1189
1190/* GNU/Linux support.  */
1191#ifdef USE_GNULIBC_1
1192#define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
1193%{!mnewlib: -lc }"
1194#else
1195#define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
1196%{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } \
1197%{profile:-lc_p} %{!profile:-lc}}}"
1198#endif
1199
1200#ifdef USE_GNULIBC_1
1201#define	STARTFILE_LINUX_SPEC "\
1202%{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
1203%{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \
1204%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
1205#else
1206#define	STARTFILE_LINUX_SPEC "\
1207%{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
1208%{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \
1209%{static:crtbeginT.o%s} \
1210%{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
1211#endif
1212
1213#define	ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
1214%{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}"
1215
1216#define LINK_START_LINUX_SPEC ""
1217
1218#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
1219  %{rdynamic:-export-dynamic} \
1220  %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
1221
1222#if !defined(USE_GNULIBC_1) && defined(HAVE_LD_EH_FRAME_HDR)
1223# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
1224#endif
1225
1226#ifdef USE_GNULIBC_1
1227#define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
1228%{!undef:							  \
1229  %{!ansi:							  \
1230    %{!std=*:-Dunix -D__unix -Dlinux -D__linux}	                  \
1231    %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}}		  \
1232-Asystem=unix -Asystem=posix"
1233#else
1234#define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
1235%{!undef:							  \
1236  %{!ansi:							  \
1237    %{!std=*:-Dunix -D__unix -Dlinux -D__linux}			  \
1238    %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}}		  \
1239-Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
1240#endif
1241
1242/* GNU/Hurd support.  */
1243#define LIB_GNU_SPEC "%{mnewlib: --start-group -lgnu -lc --end-group } \
1244%{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } \
1245%{profile:-lc_p} %{!profile:-lc}}}"
1246
1247#define	STARTFILE_GNU_SPEC "\
1248%{!shared: %{!static: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}} \
1249%{static: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} \
1250%{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \
1251%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
1252
1253#define	ENDFILE_GNU_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
1254%{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}"
1255
1256#define LINK_START_GNU_SPEC ""
1257
1258#define LINK_OS_GNU_SPEC "-m elf32ppclinux %{!shared: %{!static: \
1259  %{rdynamic:-export-dynamic} \
1260  %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
1261
1262#define CPP_OS_GNU_SPEC "-D__unix__ -D__gnu_hurd__ -D__GNU__	\
1263%{!undef:					                \
1264  %{!ansi: -Dunix -D__unix}}			                \
1265-Asystem=gnu -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
1266
1267/* NetBSD support.  */
1268#define LIB_NETBSD_SPEC "\
1269%{profile:-lgmon -lc_p} %{!profile:-lc}"
1270
1271#define	STARTFILE_NETBSD_SPEC "\
1272ncrti.o%s crt0.o%s \
1273%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
1274
1275#define ENDFILE_NETBSD_SPEC "\
1276%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
1277ncrtn.o%s"
1278
1279#define LINK_START_NETBSD_SPEC "\
1280"
1281
1282#define LINK_OS_NETBSD_SPEC "\
1283%{!shared: %{!static: \
1284  %{rdynamic:-export-dynamic} \
1285  %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}}}"
1286
1287#define CPP_OS_NETBSD_SPEC "\
1288-D__powerpc__ -D__NetBSD__ -D__ELF__ -D__KPRINTF_ATTRIBUTE__"
1289
1290/* VxWorks support.  */
1291/* VxWorks does all the library stuff itself.  */
1292#define LIB_VXWORKS_SPEC ""
1293
1294/* VxWorks provides the functionality of crt0.o and friends itself.  */
1295
1296#define	STARTFILE_VXWORKS_SPEC ""
1297
1298#define	ENDFILE_VXWORKS_SPEC ""
1299
1300/* Because it uses ld -r, vxworks has no start/end files, nor starting
1301   address.  */
1302
1303#define LINK_START_VXWORKS_SPEC ""
1304
1305#define LINK_OS_VXWORKS_SPEC "-r"
1306
1307#define CPP_OS_VXWORKS_SPEC "\
1308-DCPU_FAMILY=PPC \
1309%{!mcpu*: \
1310  %{mpowerpc*: -DCPU=PPC603} \
1311  %{!mno-powerpc: -DCPU=PPC603}} \
1312%{mcpu=powerpc: -DCPU=PPC603} \
1313%{mcpu=401: -DCPU=PPC403} \
1314%{mcpu=403: -DCPU=PPC403} \
1315%{mcpu=405: -DCPU=PPC405} \
1316%{mcpu=601: -DCPU=PPC601} \
1317%{mcpu=602: -DCPU=PPC603} \
1318%{mcpu=603: -DCPU=PPC603} \
1319%{mcpu=603e: -DCPU=PPC603} \
1320%{mcpu=ec603e: -DCPU=PPC603} \
1321%{mcpu=604: -DCPU=PPC604} \
1322%{mcpu=604e: -DCPU=PPC604} \
1323%{mcpu=620: -DCPU=PPC604} \
1324%{mcpu=740: -DCPU=PPC603} \
1325%{mcpu=7450: -DCPU=PPC603} \
1326%{mcpu=750: -DCPU=PPC603} \
1327%{mcpu=801: -DCPU=PPC603} \
1328%{mcpu=821: -DCPU=PPC603} \
1329%{mcpu=823: -DCPU=PPC603} \
1330%{mcpu=860: -DCPU=PPC603}"
1331
1332/* Define any extra SPECS that the compiler needs to generate.  */
1333/* Override rs6000.h definition.  */
1334#undef	SUBTARGET_EXTRA_SPECS
1335#define	SUBTARGET_EXTRA_SPECS						\
1336  { "cpp_sysv",			CPP_SYSV_SPEC },			\
1337  { "cpp_sysv_default",		CPP_SYSV_DEFAULT_SPEC },		\
1338  { "cpp_endian_default",	CPP_ENDIAN_DEFAULT_SPEC },		\
1339  { "cpp_endian",		CPP_ENDIAN_SPEC },			\
1340  { "lib_ads",			LIB_ADS_SPEC },				\
1341  { "lib_yellowknife",		LIB_YELLOWKNIFE_SPEC },			\
1342  { "lib_mvme",			LIB_MVME_SPEC },			\
1343  { "lib_sim",			LIB_SIM_SPEC },				\
1344  { "lib_freebsd",		LIB_FREEBSD_SPEC },			\
1345  { "lib_gnu",			LIB_GNU_SPEC },				\
1346  { "lib_linux",		LIB_LINUX_SPEC },			\
1347  { "lib_netbsd",		LIB_NETBSD_SPEC },			\
1348  { "lib_vxworks",		LIB_VXWORKS_SPEC },			\
1349  { "lib_default",		LIB_DEFAULT_SPEC },			\
1350  { "startfile_ads",		STARTFILE_ADS_SPEC },			\
1351  { "startfile_yellowknife",	STARTFILE_YELLOWKNIFE_SPEC },		\
1352  { "startfile_mvme",		STARTFILE_MVME_SPEC },			\
1353  { "startfile_sim",		STARTFILE_SIM_SPEC },			\
1354  { "startfile_freebsd",	STARTFILE_FREEBSD_SPEC },		\
1355  { "startfile_gnu",		STARTFILE_GNU_SPEC },			\
1356  { "startfile_linux",		STARTFILE_LINUX_SPEC },			\
1357  { "startfile_netbsd",		STARTFILE_NETBSD_SPEC },		\
1358  { "startfile_vxworks",	STARTFILE_VXWORKS_SPEC },		\
1359  { "startfile_default",	STARTFILE_DEFAULT_SPEC },		\
1360  { "endfile_ads",		ENDFILE_ADS_SPEC },			\
1361  { "endfile_yellowknife",	ENDFILE_YELLOWKNIFE_SPEC },		\
1362  { "endfile_mvme",		ENDFILE_MVME_SPEC },			\
1363  { "endfile_sim",		ENDFILE_SIM_SPEC },			\
1364  { "endfile_freebsd",		ENDFILE_FREEBSD_SPEC },			\
1365  { "endfile_gnu",		ENDFILE_GNU_SPEC },			\
1366  { "endfile_linux",		ENDFILE_LINUX_SPEC },			\
1367  { "endfile_netbsd",		ENDFILE_NETBSD_SPEC },			\
1368  { "endfile_vxworks",		ENDFILE_VXWORKS_SPEC },			\
1369  { "endfile_default",		ENDFILE_DEFAULT_SPEC },			\
1370  { "link_path",		LINK_PATH_SPEC },			\
1371  { "link_shlib",		LINK_SHLIB_SPEC },			\
1372  { "link_target",		LINK_TARGET_SPEC },			\
1373  { "link_start",		LINK_START_SPEC },			\
1374  { "link_start_ads",		LINK_START_ADS_SPEC },			\
1375  { "link_start_yellowknife",	LINK_START_YELLOWKNIFE_SPEC },		\
1376  { "link_start_mvme",		LINK_START_MVME_SPEC },			\
1377  { "link_start_sim",		LINK_START_SIM_SPEC },			\
1378  { "link_start_freebsd",	LINK_START_FREEBSD_SPEC },		\
1379  { "link_start_gnu",		LINK_START_GNU_SPEC },			\
1380  { "link_start_linux",		LINK_START_LINUX_SPEC },		\
1381  { "link_start_netbsd",	LINK_START_NETBSD_SPEC },		\
1382  { "link_start_vxworks",	LINK_START_VXWORKS_SPEC },		\
1383  { "link_start_default",	LINK_START_DEFAULT_SPEC },		\
1384  { "link_os",			LINK_OS_SPEC },				\
1385  { "link_os_ads",		LINK_OS_ADS_SPEC },			\
1386  { "link_os_yellowknife",	LINK_OS_YELLOWKNIFE_SPEC },		\
1387  { "link_os_mvme",		LINK_OS_MVME_SPEC },			\
1388  { "link_os_sim",		LINK_OS_SIM_SPEC },			\
1389  { "link_os_freebsd",		LINK_OS_FREEBSD_SPEC },			\
1390  { "link_os_linux",		LINK_OS_LINUX_SPEC },			\
1391  { "link_os_gnu",		LINK_OS_GNU_SPEC },			\
1392  { "link_os_netbsd",		LINK_OS_NETBSD_SPEC },			\
1393  { "link_os_vxworks",		LINK_OS_VXWORKS_SPEC },			\
1394  { "link_os_default",		LINK_OS_DEFAULT_SPEC },			\
1395  { "cc1_endian_big",		CC1_ENDIAN_BIG_SPEC },			\
1396  { "cc1_endian_little",	CC1_ENDIAN_LITTLE_SPEC },		\
1397  { "cc1_endian_default",	CC1_ENDIAN_DEFAULT_SPEC },		\
1398  { "cpp_endian_big",		CPP_ENDIAN_BIG_SPEC },			\
1399  { "cpp_endian_little",	CPP_ENDIAN_LITTLE_SPEC },		\
1400  { "cpp_float_default",	CPP_FLOAT_DEFAULT_SPEC },		\
1401  { "cpp_longdouble_default",	CPP_LONGDOUBLE_DEFAULT_SPEC },		\
1402  { "cpp_os_ads",		CPP_OS_ADS_SPEC },			\
1403  { "cpp_os_yellowknife",	CPP_OS_YELLOWKNIFE_SPEC },		\
1404  { "cpp_os_mvme",		CPP_OS_MVME_SPEC },			\
1405  { "cpp_os_sim",		CPP_OS_SIM_SPEC },			\
1406  { "cpp_os_freebsd",		CPP_OS_FREEBSD_SPEC },			\
1407  { "cpp_os_gnu",		CPP_OS_GNU_SPEC },			\
1408  { "cpp_os_linux",		CPP_OS_LINUX_SPEC },			\
1409  { "cpp_os_netbsd",		CPP_OS_NETBSD_SPEC },			\
1410  { "cpp_os_vxworks",		CPP_OS_VXWORKS_SPEC },			\
1411  { "cpp_os_default",		CPP_OS_DEFAULT_SPEC },
1412
1413/* Define this macro as a C expression for the initializer of an
1414   array of string to tell the driver program which options are
1415   defaults for this target and thus do not need to be handled
1416   specially when using `MULTILIB_OPTIONS'.
1417
1418   Do not define this macro if `MULTILIB_OPTIONS' is not defined in
1419   the target makefile fragment or if none of the options listed in
1420   `MULTILIB_OPTIONS' are set by default.  *Note Target Fragment::.  */
1421
1422#define	MULTILIB_DEFAULTS { "mbig", "mcall-sysv" }
1423
1424/* Define this macro if the code for function profiling should come
1425   before the function prologue.  Normally, the profiling code comes
1426   after.  */
1427#define PROFILE_BEFORE_PROLOGUE 1
1428
1429/* Function name to call to do profiling.  */
1430#define RS6000_MCOUNT "_mcount"
1431
1432/* Define this macro (to a value of 1) if you want to support the
1433   Win32 style pragmas #pragma pack(push,<n>)' and #pragma
1434   pack(pop)'.  The pack(push,<n>) pragma specifies the maximum
1435   alignment (in bytes) of fields within a structure, in much the
1436   same way as the __aligned__' and __packed__' __attribute__'s
1437   do.  A pack value of zero resets the behaviour to the default.
1438   Successive invocations of this pragma cause the previous values to
1439   be stacked, so that invocations of #pragma pack(pop)' will return
1440   to the previous value.  */
1441
1442#define HANDLE_PRAGMA_PACK_PUSH_POP 1
1443
1444/* Define library calls for quad FP operations.  These are all part of the
1445   PowerPC 32bit ABI.  */
1446#define ADDTF3_LIBCALL "_q_add"
1447#define DIVTF3_LIBCALL "_q_div"
1448#define EXTENDDFTF2_LIBCALL "_q_dtoq"
1449#define EQTF2_LIBCALL "_q_feq"
1450#define GETF2_LIBCALL "_q_fge"
1451#define GTTF2_LIBCALL "_q_fgt"
1452#define LETF2_LIBCALL "_q_fle"
1453#define LTTF2_LIBCALL "_q_flt"
1454#define NETF2_LIBCALL "_q_fne"
1455#define FLOATSITF2_LIBCALL "_q_itoq"
1456#define MULTF3_LIBCALL "_q_mul"
1457#define NEGTF2_LIBCALL "_q_neg"
1458#define TRUNCTFDF2_LIBCALL "_q_qtod"
1459#define FIX_TRUNCTFSI2_LIBCALL "_q_qtoi"
1460#define TRUNCTFSF2_LIBCALL "_q_qtos"
1461#define FIXUNS_TRUNCTFSI2_LIBCALL "_q_qtou"
1462#define SQRTTF_LIBCALL "_q_sqrt"
1463#define EXTENDSFTF2_LIBCALL "_q_stoq"
1464#define SUBTF3_LIBCALL "_q_sub"
1465#define FLOATUNSSITF2_LIBCALL "_q_utoq"
1466
1467#define INIT_TARGET_OPTABS						\
1468  do {									\
1469    if (TARGET_HARD_FLOAT)						\
1470      {									\
1471	add_optab->handlers[(int) TFmode].libfunc			\
1472	  = init_one_libfunc (ADDTF3_LIBCALL);				\
1473	sub_optab->handlers[(int) TFmode].libfunc			\
1474	  = init_one_libfunc (SUBTF3_LIBCALL);				\
1475	neg_optab->handlers[(int) TFmode].libfunc			\
1476	  = init_one_libfunc (NEGTF2_LIBCALL);				\
1477	smul_optab->handlers[(int) TFmode].libfunc			\
1478	  = init_one_libfunc (MULTF3_LIBCALL);				\
1479	sdiv_optab->handlers[(int) TFmode].libfunc			\
1480	  = init_one_libfunc (DIVTF3_LIBCALL);				\
1481	eqtf2_libfunc = init_one_libfunc (EQTF2_LIBCALL);		\
1482	netf2_libfunc = init_one_libfunc (NETF2_LIBCALL);		\
1483	gttf2_libfunc = init_one_libfunc (GTTF2_LIBCALL);		\
1484	getf2_libfunc = init_one_libfunc (GETF2_LIBCALL);		\
1485	lttf2_libfunc = init_one_libfunc (LTTF2_LIBCALL);		\
1486	letf2_libfunc = init_one_libfunc (LETF2_LIBCALL);		\
1487	trunctfsf2_libfunc = init_one_libfunc (TRUNCTFSF2_LIBCALL);	\
1488	trunctfdf2_libfunc = init_one_libfunc (TRUNCTFDF2_LIBCALL);	\
1489	extendsftf2_libfunc = init_one_libfunc (EXTENDSFTF2_LIBCALL);	\
1490	extenddftf2_libfunc = init_one_libfunc (EXTENDDFTF2_LIBCALL);	\
1491	floatsitf_libfunc = init_one_libfunc (FLOATSITF2_LIBCALL);	\
1492	fixtfsi_libfunc = init_one_libfunc (FIX_TRUNCTFSI2_LIBCALL);	\
1493	fixunstfsi_libfunc						\
1494	  = init_one_libfunc (FIXUNS_TRUNCTFSI2_LIBCALL);		\
1495	if (TARGET_PPC_GPOPT || TARGET_POWER2) 				\
1496	  sqrt_optab->handlers[(int) TFmode].libfunc			\
1497	    = init_one_libfunc (SQRTTF_LIBCALL);			\
1498      }									\
1499  } while (0)
1500
1501/* Select a format to encode pointers in exception handling data.  CODE
1502   is 0 for data, 1 for code labels, 2 for function pointers.  GLOBAL is
1503   true if the symbol may be affected by dynamic relocations.  */
1504#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)			     \
1505  ((flag_pic || TARGET_RELOCATABLE)					     \
1506   ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
1507   : DW_EH_PE_absptr)
1508
1509#define TARGET_ASM_EXCEPTION_SECTION readonly_data_section
1510
1511#define DOUBLE_INT_ASM_OP "\t.quad\t"
1512
1513/* Generate entries in .fixup for relocatable addresses.  */
1514#define RELOCATABLE_NEEDS_FIXUP
1515