sysv4.h revision 110611
190075Sobrien/* Target definitions for GNU compiler for PowerPC running System V.4
2110611Skan   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003
390075Sobrien   Free Software Foundation, Inc.
490075Sobrien   Contributed by Cygnus Support.
590075Sobrien
690075SobrienThis file is part of GNU CC.
790075Sobrien
890075SobrienGNU CC is free software; you can redistribute it and/or modify
990075Sobrienit under the terms of the GNU General Public License as published by
1090075Sobrienthe Free Software Foundation; either version 2, or (at your option)
1190075Sobrienany later version.
1290075Sobrien
1390075SobrienGNU CC is distributed in the hope that it will be useful,
1490075Sobrienbut WITHOUT ANY WARRANTY; without even the implied warranty of
1590075SobrienMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1690075SobrienGNU General Public License for more details.
1790075Sobrien
1890075SobrienYou should have received a copy of the GNU General Public License
1990075Sobrienalong with GNU CC; see the file COPYING.  If not, write to
2090075Sobrienthe Free Software Foundation, 59 Temple Place - Suite 330,
2190075SobrienBoston, MA 02111-1307, USA.  */
2290075Sobrien
2390075Sobrien
2490075Sobrien/* Yes!  We are ELF.  */
2590075Sobrien#define	TARGET_OBJECT_FORMAT OBJECT_ELF
2690075Sobrien
2790075Sobrien/* Default ABI to compile code for.  */
2890075Sobrien#define DEFAULT_ABI rs6000_current_abi
2990075Sobrien
3090075Sobrien/* Default ABI to use.  */
3190075Sobrien#define RS6000_ABI_NAME "sysv"
3290075Sobrien
3390075Sobrien/* Override rs6000.h definition.  */
3490075Sobrien#undef	ASM_DEFAULT_SPEC
3590075Sobrien#define	ASM_DEFAULT_SPEC "-mppc"
3690075Sobrien
3790075Sobrien/* Override rs6000.h definition.  */
3890075Sobrien#undef	CPP_DEFAULT_SPEC
3990075Sobrien#define	CPP_DEFAULT_SPEC "-D_ARCH_PPC"
4090075Sobrien
4190075Sobrien/* Small data support types.  */
4290075Sobrienenum rs6000_sdata_type {
4390075Sobrien  SDATA_NONE,			/* No small data support.  */
4490075Sobrien  SDATA_DATA,			/* Just put data in .sbss/.sdata, don't use relocs.  */
4590075Sobrien  SDATA_SYSV,			/* Use r13 to point to .sdata/.sbss.  */
4690075Sobrien  SDATA_EABI			/* Use r13 like above, r2 points to .sdata2/.sbss2.  */
4790075Sobrien};
4890075Sobrien
4990075Sobrienextern enum rs6000_sdata_type rs6000_sdata;
5090075Sobrien
5190075Sobrien/* V.4/eabi switches.  */
5290075Sobrien#define	MASK_NO_BITFIELD_TYPE	0x40000000	/* Set PCC_BITFIELD_TYPE_MATTERS to 0.  */
5390075Sobrien#define	MASK_STRICT_ALIGN	0x20000000	/* Set STRICT_ALIGNMENT to 1.  */
5490075Sobrien#define	MASK_RELOCATABLE	0x10000000	/* GOT pointers are PC relative.  */
5590075Sobrien#define	MASK_EABI		0x08000000	/* Adhere to eabi, not System V spec.  */
5690075Sobrien#define	MASK_LITTLE_ENDIAN	0x04000000	/* Target is little endian.  */
5790075Sobrien#define	MASK_REGNAMES		0x02000000	/* Use alternate register names.  */
5890075Sobrien#define	MASK_PROTOTYPE		0x01000000	/* Only prototyped fcns pass variable args.  */
5990075Sobrien#define MASK_NO_BITFIELD_WORD	0x00800000	/* Bitfields cannot cross word boundaries */
6090075Sobrien
6190075Sobrien#define	TARGET_NO_BITFIELD_TYPE	(target_flags & MASK_NO_BITFIELD_TYPE)
6290075Sobrien#define	TARGET_STRICT_ALIGN	(target_flags & MASK_STRICT_ALIGN)
6390075Sobrien#define	TARGET_RELOCATABLE	(target_flags & MASK_RELOCATABLE)
6490075Sobrien#define	TARGET_EABI		(target_flags & MASK_EABI)
6590075Sobrien#define	TARGET_LITTLE_ENDIAN	(target_flags & MASK_LITTLE_ENDIAN)
6690075Sobrien#define	TARGET_REGNAMES		(target_flags & MASK_REGNAMES)
6790075Sobrien#define	TARGET_PROTOTYPE	(target_flags & MASK_PROTOTYPE)
6890075Sobrien#define TARGET_NO_BITFIELD_WORD	(target_flags & MASK_NO_BITFIELD_WORD)
6990075Sobrien#define	TARGET_TOC		((target_flags & MASK_64BIT)		\
7090075Sobrien				 || ((target_flags & (MASK_RELOCATABLE	\
7190075Sobrien						      | MASK_MINIMAL_TOC)) \
7290075Sobrien				     && flag_pic > 1)			\
7390075Sobrien				 || DEFAULT_ABI == ABI_AIX)
7490075Sobrien
7590075Sobrien#define	TARGET_BITFIELD_TYPE	(! TARGET_NO_BITFIELD_TYPE)
7690075Sobrien#define	TARGET_BIG_ENDIAN	(! TARGET_LITTLE_ENDIAN)
7790075Sobrien#define	TARGET_NO_PROTOTYPE	(! TARGET_PROTOTYPE)
7890075Sobrien#define	TARGET_NO_TOC		(! TARGET_TOC)
7990075Sobrien#define	TARGET_NO_EABI		(! TARGET_EABI)
8090075Sobrien
8190075Sobrien/* Strings provided by SUBTARGET_OPTIONS */
8290075Sobrienextern const char *rs6000_abi_name;
8390075Sobrienextern const char *rs6000_sdata_name;
8490075Sobrien
8590075Sobrien/* Override rs6000.h definition.  */
8690075Sobrien#undef	SUBTARGET_OPTIONS
8790075Sobrien#define	SUBTARGET_OPTIONS						\
8890075Sobrien  { "call-",  &rs6000_abi_name, N_("Select ABI calling convention") },	\
8990075Sobrien  { "sdata=", &rs6000_sdata_name, N_("Select method for sdata handling") }
9090075Sobrien
9190075Sobrien/* Max # of bytes for variables to automatically be put into the .sdata
9290075Sobrien   or .sdata2 sections.  */
9390075Sobrienextern int g_switch_value;		/* Value of the -G xx switch.  */
9490075Sobrienextern int g_switch_set;		/* Whether -G xx was passed.  */
9590075Sobrien
9690075Sobrien#define SDATA_DEFAULT_SIZE 8
9790075Sobrien
9890075Sobrien/* Note, V.4 no longer uses a normal TOC, so make -mfull-toc, be just
9990075Sobrien   the same as -mminimal-toc.  */
10090075Sobrien/* Override rs6000.h definition.  */
10190075Sobrien#undef	SUBTARGET_SWITCHES
10290075Sobrien#define SUBTARGET_SWITCHES						\
10390075Sobrien  { "bit-align",	-MASK_NO_BITFIELD_TYPE,				\
10490075Sobrien    N_("Align to the base type of the bit-field") },			\
10590075Sobrien  { "no-bit-align",	 MASK_NO_BITFIELD_TYPE,				\
10690075Sobrien    N_("Don't align to the base type of the bit-field") },		\
10790075Sobrien  { "strict-align",	 MASK_STRICT_ALIGN,				\
10890075Sobrien    N_("Don't assume that unaligned accesses are handled by the system") }, \
10990075Sobrien  { "no-strict-align",	-MASK_STRICT_ALIGN,				\
11090075Sobrien    N_("Assume that unaligned accesses are handled by the system") },	\
11190075Sobrien  { "relocatable",	 MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, \
11290075Sobrien    N_("Produce code relocatable at runtime") },			\
11390075Sobrien  { "no-relocatable",	-MASK_RELOCATABLE,				\
11490075Sobrien    N_("Don't produce code relocatable at runtime") },			\
11590075Sobrien  { "relocatable-lib",	 MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, \
11690075Sobrien    N_("Produce code relocatable at runtime") },			\
11790075Sobrien  { "no-relocatable-lib", -MASK_RELOCATABLE,				\
11890075Sobrien    N_("Don't produce code relocatable at runtime") },			\
11990075Sobrien  { "little-endian",	 MASK_LITTLE_ENDIAN,				\
12090075Sobrien    N_("Produce little endian code") },					\
12190075Sobrien  { "little",		 MASK_LITTLE_ENDIAN,				\
12290075Sobrien    N_("Produce little endian code") },					\
12390075Sobrien  { "big-endian",	-MASK_LITTLE_ENDIAN,				\
12490075Sobrien    N_("Produce big endian code") },					\
12590075Sobrien  { "big",		-MASK_LITTLE_ENDIAN,				\
12690075Sobrien    N_("Produce big endian code") },					\
12790075Sobrien  { "no-toc",		 0, N_("no description yet") },			\
12890075Sobrien  { "toc",		 MASK_MINIMAL_TOC, N_("no description yet") },	\
12990075Sobrien  { "full-toc",		 MASK_MINIMAL_TOC, N_("no description yet") },	\
13090075Sobrien  { "prototype",	 MASK_PROTOTYPE, N_("no description yet") },	\
13190075Sobrien  { "no-prototype",	-MASK_PROTOTYPE, N_("no description yet") },	\
13290075Sobrien  { "no-traceback",	 0, N_("no description yet") },			\
13390075Sobrien  { "eabi",		 MASK_EABI, N_("Use EABI") },			\
13490075Sobrien  { "no-eabi",		-MASK_EABI, N_("Don't use EABI") },		\
13590075Sobrien  { "bit-word",		-MASK_NO_BITFIELD_WORD, "" },			\
13690075Sobrien  { "no-bit-word",	 MASK_NO_BITFIELD_WORD,				\
13790075Sobrien    N_("Do not allow bit-fields to cross word boundaries") },		\
13890075Sobrien  { "regnames",		  MASK_REGNAMES,				\
13990075Sobrien    N_("Use alternate register names") },				\
14090075Sobrien  { "no-regnames",	 -MASK_REGNAMES,				\
14190075Sobrien    N_("Don't use alternate register names") },				\
14290075Sobrien  { "sdata",		 0, N_("no description yet") },			\
14390075Sobrien  { "no-sdata",		 0, N_("no description yet") },			\
14490075Sobrien  { "sim",		 0,						\
14590075Sobrien    N_("Link with libsim.a, libc.a and sim-crt0.o") },			\
14690075Sobrien  { "ads",		 0,						\
14790075Sobrien    N_("Link with libads.a, libc.a and crt0.o") },			\
14890075Sobrien  { "yellowknife",	 0,						\
14990075Sobrien    N_("Link with libyk.a, libc.a and crt0.o") },			\
15090075Sobrien  { "mvme",		 0,						\
15190075Sobrien    N_("Link with libmvme.a, libc.a and crt0.o") },			\
15290075Sobrien  { "emb",		 0,						\
15390075Sobrien    N_("Set the PPC_EMB bit in the ELF flags header") },		\
15490075Sobrien  { "vxworks",		 0, N_("no description yet") },			\
15590075Sobrien  { "shlib",		 0, N_("no description yet") },			\
15690075Sobrien  EXTRA_SUBTARGET_SWITCHES						\
15790075Sobrien  { "newlib",		 0, N_("no description yet") },
15890075Sobrien
15990075Sobrien/* This is meant to be redefined in the host dependent files.  */
16090075Sobrien#define EXTRA_SUBTARGET_SWITCHES
16190075Sobrien
16290075Sobrien/* Sometimes certain combinations of command options do not make sense
16390075Sobrien   on a particular target machine.  You can define a macro
16490075Sobrien   `OVERRIDE_OPTIONS' to take account of this.  This macro, if
16590075Sobrien   defined, is executed once just after all the command options have
16690075Sobrien   been parsed.
16790075Sobrien
16890075Sobrien   The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to
16990075Sobrien   get control.  */
17090075Sobrien
17190075Sobrien#define SUBTARGET_OVERRIDE_OPTIONS					\
17290075Sobriendo {									\
17390075Sobrien  if (!g_switch_set)							\
17490075Sobrien    g_switch_value = SDATA_DEFAULT_SIZE;				\
17590075Sobrien									\
17690075Sobrien  if (!strcmp (rs6000_abi_name, "sysv"))				\
17790075Sobrien    rs6000_current_abi = ABI_V4;					\
17890075Sobrien  else if (!strcmp (rs6000_abi_name, "sysv-noeabi"))			\
17990075Sobrien    {									\
18090075Sobrien      rs6000_current_abi = ABI_V4;					\
18190075Sobrien      target_flags &= ~ MASK_EABI;					\
18290075Sobrien    }									\
18390075Sobrien  else if (!strcmp (rs6000_abi_name, "sysv-eabi")			\
18490075Sobrien	   || !strcmp (rs6000_abi_name, "eabi"))			\
18590075Sobrien    {									\
18690075Sobrien      rs6000_current_abi = ABI_V4;					\
18790075Sobrien      target_flags |= MASK_EABI;					\
18890075Sobrien    }									\
18990075Sobrien  else if (!strcmp (rs6000_abi_name, "aix"))				\
19090075Sobrien    {									\
19190075Sobrien      rs6000_current_abi = ABI_AIX_NODESC;				\
19290075Sobrien      target_flags |= MASK_EABI;					\
19390075Sobrien    }									\
19490075Sobrien  else if (!strcmp (rs6000_abi_name, "aixdesc"))			\
19590075Sobrien    rs6000_current_abi = ABI_AIX;					\
19690075Sobrien  else if (!strcmp (rs6000_abi_name, "freebsd"))			\
19790075Sobrien    rs6000_current_abi = ABI_V4;					\
19890075Sobrien  else if (!strcmp (rs6000_abi_name, "linux"))				\
19990075Sobrien    rs6000_current_abi = ABI_V4;					\
20096263Sobrien  else if (!strcmp (rs6000_abi_name, "gnu"))				\
20196263Sobrien    rs6000_current_abi = ABI_V4;					\
20290075Sobrien  else if (!strcmp (rs6000_abi_name, "netbsd"))				\
20390075Sobrien    rs6000_current_abi = ABI_V4;					\
20490075Sobrien  else if (!strcmp (rs6000_abi_name, "i960-old"))			\
20590075Sobrien    {									\
20690075Sobrien      rs6000_current_abi = ABI_V4;					\
20790075Sobrien      target_flags |= (MASK_LITTLE_ENDIAN | MASK_EABI			\
20890075Sobrien		       | MASK_NO_BITFIELD_WORD);			\
20990075Sobrien      target_flags &= ~MASK_STRICT_ALIGN;				\
21090075Sobrien    }									\
21190075Sobrien  else									\
21290075Sobrien    {									\
21390075Sobrien      rs6000_current_abi = ABI_V4;					\
21490075Sobrien      error ("bad value for -mcall-%s", rs6000_abi_name);		\
21590075Sobrien    }									\
21690075Sobrien									\
21790075Sobrien  if (rs6000_sdata_name)						\
21890075Sobrien    {									\
21990075Sobrien      if (!strcmp (rs6000_sdata_name, "none"))				\
22090075Sobrien	rs6000_sdata = SDATA_NONE;					\
22190075Sobrien      else if (!strcmp (rs6000_sdata_name, "data"))			\
22290075Sobrien	rs6000_sdata = SDATA_DATA;					\
22390075Sobrien      else if (!strcmp (rs6000_sdata_name, "default"))			\
22490075Sobrien	rs6000_sdata = (TARGET_EABI) ? SDATA_EABI : SDATA_SYSV;		\
22590075Sobrien      else if (!strcmp (rs6000_sdata_name, "sysv"))			\
22690075Sobrien	rs6000_sdata = SDATA_SYSV;					\
22790075Sobrien      else if (!strcmp (rs6000_sdata_name, "eabi"))			\
22890075Sobrien	rs6000_sdata = SDATA_EABI;					\
22990075Sobrien      else								\
23090075Sobrien	error ("bad value for -msdata=%s", rs6000_sdata_name);		\
23190075Sobrien    }									\
23290075Sobrien  else if (DEFAULT_ABI == ABI_V4)					\
23390075Sobrien    {									\
23490075Sobrien      rs6000_sdata = SDATA_DATA;					\
23590075Sobrien      rs6000_sdata_name = "data";					\
23690075Sobrien    }									\
23790075Sobrien  else									\
23890075Sobrien    {									\
23990075Sobrien      rs6000_sdata = SDATA_NONE;					\
24090075Sobrien      rs6000_sdata_name = "none";					\
24190075Sobrien    }									\
24290075Sobrien									\
24390075Sobrien  if (TARGET_RELOCATABLE &&						\
24490075Sobrien      (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV))	\
24590075Sobrien    {									\
24690075Sobrien      rs6000_sdata = SDATA_DATA;					\
24790075Sobrien      error ("-mrelocatable and -msdata=%s are incompatible",		\
24890075Sobrien	     rs6000_sdata_name);					\
24990075Sobrien    }									\
25090075Sobrien									\
25190075Sobrien  else if (flag_pic &&							\
25290075Sobrien	   (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV))	\
25390075Sobrien    {									\
25490075Sobrien      rs6000_sdata = SDATA_DATA;					\
25590075Sobrien      error ("-f%s and -msdata=%s are incompatible",			\
25690075Sobrien	     (flag_pic > 1) ? "PIC" : "pic",				\
25790075Sobrien	     rs6000_sdata_name);					\
25890075Sobrien    }									\
25990075Sobrien									\
26090075Sobrien  if (rs6000_sdata != SDATA_NONE && DEFAULT_ABI != ABI_V4)		\
26190075Sobrien    {									\
26290075Sobrien      rs6000_sdata = SDATA_NONE;					\
26390075Sobrien      error ("-msdata=%s and -mcall-%s are incompatible",		\
26490075Sobrien	     rs6000_sdata_name, rs6000_abi_name);			\
26590075Sobrien    }									\
26690075Sobrien									\
26790075Sobrien  if (TARGET_RELOCATABLE && !TARGET_MINIMAL_TOC)			\
26890075Sobrien    {									\
26990075Sobrien      target_flags |= MASK_MINIMAL_TOC;					\
27090075Sobrien      error ("-mrelocatable and -mno-minimal-toc are incompatible");	\
27190075Sobrien    }									\
27290075Sobrien									\
27390075Sobrien  if (TARGET_RELOCATABLE && rs6000_current_abi == ABI_AIX)		\
27490075Sobrien    {									\
27590075Sobrien      target_flags &= ~MASK_RELOCATABLE;				\
27690075Sobrien      error ("-mrelocatable and -mcall-%s are incompatible",		\
27790075Sobrien	     rs6000_abi_name);						\
27890075Sobrien    }									\
27990075Sobrien									\
28090075Sobrien  if (flag_pic > 1 && rs6000_current_abi == ABI_AIX)			\
28190075Sobrien    {									\
28290075Sobrien      flag_pic = 0;							\
28390075Sobrien      error ("-fPIC and -mcall-%s are incompatible",			\
28490075Sobrien	     rs6000_abi_name);						\
28590075Sobrien    }									\
28690075Sobrien									\
28790075Sobrien  if (rs6000_current_abi == ABI_AIX && TARGET_LITTLE_ENDIAN)		\
28890075Sobrien    {									\
28990075Sobrien      target_flags &= ~MASK_LITTLE_ENDIAN;				\
29090075Sobrien      error ("-mcall-aixdesc must be big endian");			\
29190075Sobrien    }									\
29290075Sobrien									\
29390075Sobrien  /* Treat -fPIC the same as -mrelocatable.  */				\
29490075Sobrien  if (flag_pic > 1)							\
29590075Sobrien    target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC; \
29690075Sobrien									\
29790075Sobrien  else if (TARGET_RELOCATABLE)						\
29890075Sobrien    flag_pic = 2;							\
29990075Sobrien									\
30090075Sobrien} while (0)
30190075Sobrien
30290075Sobrien
30390075Sobrien/* Override rs6000.h definition.  */
30490075Sobrien#undef	TARGET_DEFAULT
30590075Sobrien#define	TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS)
30690075Sobrien
30790075Sobrien/* Override rs6000.h definition.  */
30890075Sobrien#undef	PROCESSOR_DEFAULT
30990075Sobrien#define	PROCESSOR_DEFAULT PROCESSOR_PPC750
31090075Sobrien
31190075Sobrien#define FIXED_R2 1
31290075Sobrien/* System V.4 uses register 13 as a pointer to the small data area,
31390075Sobrien   so it is not available to the normal user.  */
31490075Sobrien#define FIXED_R13 1
31590075Sobrien
31690075Sobrien/* Size of the V.4 varargs area if needed.  */
31790075Sobrien/* Override rs6000.h definition.  */
31890075Sobrien#undef	RS6000_VARARGS_AREA
31990075Sobrien#define RS6000_VARARGS_AREA ((cfun->machine->sysv_varargs_p) ? RS6000_VARARGS_SIZE : 0)
32090075Sobrien
32190075Sobrien/* Override default big endianism definitions in rs6000.h.  */
32290075Sobrien#undef	BYTES_BIG_ENDIAN
32390075Sobrien#undef	WORDS_BIG_ENDIAN
32490075Sobrien#define	BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN)
32590075Sobrien#define	WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN)
32690075Sobrien
32790075Sobrien/* Define this to set the endianness to use in libgcc2.c, which can
32890075Sobrien   not depend on target_flags.  */
32990075Sobrien#if !defined(_LITTLE_ENDIAN) && !defined(__sun__)
33090075Sobrien#define LIBGCC2_WORDS_BIG_ENDIAN 1
33190075Sobrien#else
33290075Sobrien#define LIBGCC2_WORDS_BIG_ENDIAN 0
33390075Sobrien#endif
33490075Sobrien
33590075Sobrien/* Define cutoff for using external functions to save floating point.
33690075Sobrien   Currently on V.4, always use inline stores.  */
33790075Sobrien#define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 64)
33890075Sobrien
33990075Sobrien/* Put jump tables in read-only memory, rather than in .text.  */
34090075Sobrien#define JUMP_TABLES_IN_TEXT_SECTION 0
34190075Sobrien
34290075Sobrien/* Prefix and suffix to use to saving floating point.  */
34390075Sobrien#define	SAVE_FP_PREFIX "_savefpr_"
34490075Sobrien#define SAVE_FP_SUFFIX "_l"
34590075Sobrien
34690075Sobrien/* Prefix and suffix to use to restoring floating point.  */
34790075Sobrien#define	RESTORE_FP_PREFIX "_restfpr_"
34890075Sobrien#define RESTORE_FP_SUFFIX "_l"
34990075Sobrien
35090075Sobrien/* Type used for ptrdiff_t, as a string used in a declaration.  */
35190075Sobrien#define PTRDIFF_TYPE "int"
35290075Sobrien
35390075Sobrien/* Type used for wchar_t, as a string used in a declaration.  */
35490075Sobrien/* Override svr4.h definition.  */
35590075Sobrien#undef	WCHAR_TYPE
35690075Sobrien#define WCHAR_TYPE "long int"
35790075Sobrien
35890075Sobrien/* Width of wchar_t in bits.  */
35990075Sobrien/* Override svr4.h definition.  */
36090075Sobrien#undef	WCHAR_TYPE_SIZE
36190075Sobrien#define WCHAR_TYPE_SIZE 32
36290075Sobrien
36390075Sobrien/* Make int foo : 8 not cause structures to be aligned to an int boundary.  */
36490075Sobrien/* Override elfos.h definition.  */
36590075Sobrien#undef	PCC_BITFIELD_TYPE_MATTERS
36690075Sobrien#define	PCC_BITFIELD_TYPE_MATTERS (TARGET_BITFIELD_TYPE)
36790075Sobrien
36890075Sobrien#undef	BITFIELD_NBYTES_LIMITED
36990075Sobrien#define	BITFIELD_NBYTES_LIMITED (TARGET_NO_BITFIELD_WORD)
37090075Sobrien
37190075Sobrien/* Define this macro to be the value 1 if instructions will fail to
37290075Sobrien   work if given data not on the nominal alignment.  If instructions
37390075Sobrien   will merely go slower in that case, define this macro as 0.  */
37490075Sobrien#undef	STRICT_ALIGNMENT
37590075Sobrien#define	STRICT_ALIGNMENT (TARGET_STRICT_ALIGN)
37690075Sobrien
37790075Sobrien/* Alignment in bits of the stack boundary.  Note, in order to allow building
37890075Sobrien   one set of libraries with -mno-eabi instead of eabi libraries and non-eabi
37990075Sobrien   versions, just use 64 as the stack boundary.  */
38090075Sobrien#undef	STACK_BOUNDARY
38190075Sobrien#define	STACK_BOUNDARY	(TARGET_ALTIVEC_ABI ? 128 : 64)
38290075Sobrien
38390075Sobrien/* Real stack boundary as mandated by the appropriate ABI.  */
38490075Sobrien#define ABI_STACK_BOUNDARY ((TARGET_EABI && !TARGET_ALTIVEC_ABI) ? 64 : 128)
38590075Sobrien
38690075Sobrien/* No data type wants to be aligned rounder than this.  */
38790075Sobrien#undef	BIGGEST_ALIGNMENT
38896263Sobrien#define BIGGEST_ALIGNMENT ((TARGET_EABI && !TARGET_ALTIVEC) ? 64 : 128)
38990075Sobrien
39090075Sobrien/* An expression for the alignment of a structure field FIELD if the
39190075Sobrien   alignment computed in the usual way is COMPUTED.  */
39290075Sobrien#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED)				      \
39390075Sobrien	((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)     \
39490075Sobrien	 ? 128 : COMPUTED)
39590075Sobrien
39690075Sobrien/* Define this macro as an expression for the alignment of a type
39790075Sobrien   (given by TYPE as a tree node) if the alignment computed in the
39890075Sobrien   usual way is COMPUTED and the alignment explicitly specified was
39990075Sobrien   SPECIFIED.  */
40090075Sobrien#define ROUND_TYPE_ALIGN(TYPE, COMPUTED, SPECIFIED)			\
40190075Sobrien	((TARGET_ALTIVEC  && TREE_CODE (TYPE) == VECTOR_TYPE)	        \
40296263Sobrien	 ? MAX (MAX ((COMPUTED), (SPECIFIED)), 128)                     \
40396263Sobrien         : MAX (COMPUTED, SPECIFIED))
40490075Sobrien
40590075Sobrien#undef  BIGGEST_FIELD_ALIGNMENT
40690075Sobrien
40790075Sobrien/* Use ELF style section commands.  */
40890075Sobrien
40990075Sobrien#define	TEXT_SECTION_ASM_OP	"\t.section\t\".text\""
41090075Sobrien
41190075Sobrien#define	DATA_SECTION_ASM_OP	"\t.section\t\".data\""
41290075Sobrien
41390075Sobrien#define	BSS_SECTION_ASM_OP	"\t.section\t\".bss\""
41490075Sobrien
41590075Sobrien/* Override elfos.h definition.  */
41690075Sobrien#undef	INIT_SECTION_ASM_OP
41790075Sobrien#define	INIT_SECTION_ASM_OP "\t.section\t\".init\",\"ax\""
41890075Sobrien
41990075Sobrien/* Override elfos.h definition.  */
42090075Sobrien#undef	FINI_SECTION_ASM_OP
42190075Sobrien#define	FINI_SECTION_ASM_OP "\t.section\t\".fini\",\"ax\""
42290075Sobrien
42390075Sobrien#define	TOC_SECTION_ASM_OP "\t.section\t\".got\",\"aw\""
42490075Sobrien
42590075Sobrien/* Put PC relative got entries in .got2.  */
42690075Sobrien#define	MINIMAL_TOC_SECTION_ASM_OP \
42790075Sobrien  ((TARGET_RELOCATABLE || flag_pic) ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"")
42890075Sobrien
42990075Sobrien#define	SDATA_SECTION_ASM_OP "\t.section\t\".sdata\",\"aw\""
43090075Sobrien#define	SDATA2_SECTION_ASM_OP "\t.section\t\".sdata2\",\"a\""
43190075Sobrien#define	SBSS_SECTION_ASM_OP "\t.section\t\".sbss\",\"aw\",@nobits"
43290075Sobrien
43390075Sobrien/* Besides the usual ELF sections, we need a toc section.  */
43490075Sobrien/* Override elfos.h definition.  */
43590075Sobrien#undef	EXTRA_SECTIONS
43690075Sobrien#define	EXTRA_SECTIONS in_const, in_toc, in_sdata, in_sdata2, in_sbss, in_init, in_fini
43790075Sobrien
43890075Sobrien/* Override elfos.h definition.  */
43990075Sobrien#undef	EXTRA_SECTION_FUNCTIONS
44090075Sobrien#define	EXTRA_SECTION_FUNCTIONS						\
44190075Sobrien  CONST_SECTION_FUNCTION						\
44290075Sobrien  TOC_SECTION_FUNCTION							\
44390075Sobrien  SDATA_SECTION_FUNCTION						\
44490075Sobrien  SDATA2_SECTION_FUNCTION						\
44590075Sobrien  SBSS_SECTION_FUNCTION							\
44690075Sobrien  INIT_SECTION_FUNCTION							\
44790075Sobrien  FINI_SECTION_FUNCTION
44890075Sobrien
44990075Sobrien#define	TOC_SECTION_FUNCTION						\
45090075Sobrienvoid									\
45190075Sobrientoc_section ()								\
45290075Sobrien{									\
45390075Sobrien  if (in_section != in_toc)						\
45490075Sobrien    {									\
45590075Sobrien      in_section = in_toc;						\
45690075Sobrien      if (DEFAULT_ABI == ABI_AIX					\
45790075Sobrien	  && TARGET_MINIMAL_TOC						\
45890075Sobrien	  && !TARGET_RELOCATABLE)					\
45990075Sobrien	{								\
46090075Sobrien	  if (! toc_initialized)					\
46190075Sobrien	    {								\
46290075Sobrien	      toc_initialized = 1;					\
46390075Sobrien	      fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP);	\
46490075Sobrien	      ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LCTOC", 0);	\
46590075Sobrien	      fprintf (asm_out_file, "\t.tc ");				\
46690075Sobrien	      ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1[TC],"); \
46790075Sobrien	      ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
46890075Sobrien	      fprintf (asm_out_file, "\n");				\
46990075Sobrien									\
47090075Sobrien	      fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
47190075Sobrien	      ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
47290075Sobrien	      fprintf (asm_out_file, " = .+32768\n");			\
47390075Sobrien	    }								\
47490075Sobrien	  else								\
47590075Sobrien	    fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);	\
47690075Sobrien	}								\
47790075Sobrien      else if (DEFAULT_ABI == ABI_AIX && !TARGET_RELOCATABLE)		\
47890075Sobrien	fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP);		\
47990075Sobrien      else								\
48090075Sobrien	{								\
48190075Sobrien	  fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);	\
48290075Sobrien	  if (! toc_initialized)					\
48390075Sobrien	    {								\
48490075Sobrien	      ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
48590075Sobrien	      fprintf (asm_out_file, " = .+32768\n");			\
48690075Sobrien	      toc_initialized = 1;					\
48790075Sobrien	    }								\
48890075Sobrien	}								\
48990075Sobrien    }									\
49090075Sobrien}									\
49190075Sobrien									\
49290075Sobrienextern int in_toc_section PARAMS ((void));				\
49390075Sobrienint in_toc_section ()							\
49490075Sobrien{									\
49590075Sobrien  return in_section == in_toc;						\
49690075Sobrien}
49790075Sobrien
49890075Sobrien#define	SDATA_SECTION_FUNCTION						\
49990075Sobrienvoid									\
50090075Sobriensdata_section ()							\
50190075Sobrien{									\
50290075Sobrien  if (in_section != in_sdata)						\
50390075Sobrien    {									\
50490075Sobrien      in_section = in_sdata;						\
50590075Sobrien      fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP);		\
50690075Sobrien    }									\
50790075Sobrien}
50890075Sobrien
50990075Sobrien#define	SDATA2_SECTION_FUNCTION						\
51090075Sobrienvoid									\
51190075Sobriensdata2_section ()							\
51290075Sobrien{									\
51390075Sobrien  if (in_section != in_sdata2)						\
51490075Sobrien    {									\
51590075Sobrien      in_section = in_sdata2;						\
51690075Sobrien      fprintf (asm_out_file, "%s\n", SDATA2_SECTION_ASM_OP);		\
51790075Sobrien    }									\
51890075Sobrien}
51990075Sobrien
52090075Sobrien#define	SBSS_SECTION_FUNCTION						\
52190075Sobrienvoid									\
52290075Sobriensbss_section ()								\
52390075Sobrien{									\
52490075Sobrien  if (in_section != in_sbss)						\
52590075Sobrien    {									\
52690075Sobrien      in_section = in_sbss;						\
52790075Sobrien      fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP);		\
52890075Sobrien    }									\
52990075Sobrien}
53090075Sobrien
53190075Sobrien#define	INIT_SECTION_FUNCTION						\
53290075Sobrienvoid									\
53390075Sobrieninit_section ()								\
53490075Sobrien{									\
53590075Sobrien  if (in_section != in_init)						\
53690075Sobrien    {									\
53790075Sobrien      in_section = in_init;						\
53890075Sobrien      fprintf (asm_out_file, "%s\n", INIT_SECTION_ASM_OP);		\
53990075Sobrien    }									\
54090075Sobrien}
54190075Sobrien
54290075Sobrien#define	FINI_SECTION_FUNCTION						\
54390075Sobrienvoid									\
54490075Sobrienfini_section ()								\
54590075Sobrien{									\
54690075Sobrien  if (in_section != in_fini)						\
54790075Sobrien    {									\
54890075Sobrien      in_section = in_fini;						\
54990075Sobrien      fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP);		\
55090075Sobrien    }									\
55190075Sobrien}
55290075Sobrien
55390075Sobrien/* A C statement or statements to switch to the appropriate section
55490075Sobrien   for output of RTX in mode MODE.  You can assume that RTX is some
55590075Sobrien   kind of constant in RTL.  The argument MODE is redundant except in
55690075Sobrien   the case of a `const_int' rtx.  Select the section by calling
55790075Sobrien   `text_section' or one of the alternatives for other sections.
55890075Sobrien
55990075Sobrien   Do not define this macro if you put all constants in the read-only
56090075Sobrien   data section.  */
56190075Sobrien
56290075Sobrien/* Override elfos.h definition.  */
56390075Sobrien#undef	SELECT_RTX_SECTION
56490075Sobrien#define	SELECT_RTX_SECTION(MODE, X, ALIGN) rs6000_select_rtx_section (MODE, X)
56590075Sobrien
56690075Sobrien/* A C statement or statements to switch to the appropriate
56790075Sobrien   section for output of DECL.  DECL is either a `VAR_DECL' node
56890075Sobrien   or a constant of some sort.  RELOC indicates whether forming
56990075Sobrien   the initial value of DECL requires link-time relocations.  */
57090075Sobrien
57190075Sobrien/* Override elfos.h definition.  */
57290075Sobrien#undef	SELECT_SECTION
57390075Sobrien#define	SELECT_SECTION(DECL, RELOC, ALIGN) rs6000_select_section (DECL, RELOC)
57490075Sobrien
57590075Sobrien/* A C statement to build up a unique section name, expressed as a
57690075Sobrien   STRING_CST node, and assign it to DECL_SECTION_NAME (decl).
57790075Sobrien   RELOC indicates whether the initial value of EXP requires
57890075Sobrien   link-time relocations.  If you do not define this macro, GCC will use
57990075Sobrien   the symbol name prefixed by `.' as the section name.  Note - this
58090075Sobrien   macro can now be called for uninitialized data items as well as
58190075Sobrien   initialised data and functions.  */
58290075Sobrien
58390075Sobrien/* Override elfos.h definition.  */
58490075Sobrien#undef	UNIQUE_SECTION
58590075Sobrien#define UNIQUE_SECTION(DECL, RELOC) rs6000_unique_section (DECL, RELOC)
58690075Sobrien
58790075Sobrien/* Return non-zero if this entry is to be written into the constant pool
58890075Sobrien   in a special way.  We do so if this is a SYMBOL_REF, LABEL_REF or a CONST
58990075Sobrien   containing one of them.  If -mfp-in-toc (the default), we also do
59090075Sobrien   this for floating-point constants.  We actually can only do this
59190075Sobrien   if the FP formats of the target and host machines are the same, but
59290075Sobrien   we can't check that since not every file that uses
59390075Sobrien   GO_IF_LEGITIMATE_ADDRESS_P includes real.h.
59490075Sobrien
59590075Sobrien   Unlike AIX, we don't key off of -mminimal-toc, but instead do not
59690075Sobrien   allow floating point constants in the TOC if -mrelocatable.  */
59790075Sobrien
59890075Sobrien#undef	ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
59990075Sobrien#define	ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE)			\
60090075Sobrien  (TARGET_TOC								\
60190075Sobrien   && (GET_CODE (X) == SYMBOL_REF					\
60290075Sobrien       || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS	\
60390075Sobrien	   && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF)		\
60490075Sobrien       || GET_CODE (X) == LABEL_REF					\
60590075Sobrien       || (GET_CODE (X) == CONST_INT 					\
60690075Sobrien	   && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode))	\
60790075Sobrien       || (!TARGET_NO_FP_IN_TOC						\
60890075Sobrien	   && !TARGET_RELOCATABLE					\
60990075Sobrien	   && GET_CODE (X) == CONST_DOUBLE				\
61090075Sobrien	   && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT		\
61190075Sobrien	   && BITS_PER_WORD == HOST_BITS_PER_INT)))
61290075Sobrien
61390075Sobrien/* These macros generate the special .type and .size directives which
61490075Sobrien   are used to set the corresponding fields of the linker symbol table
61590075Sobrien   entries in an ELF object file under SVR4.  These macros also output
61690075Sobrien   the starting labels for the relevant functions/objects.  */
61790075Sobrien
61890075Sobrien/* Write the extra assembler code needed to declare a function properly.
61990075Sobrien   Some svr4 assemblers need to also have something extra said about the
62090075Sobrien   function's return value.  We allow for that here.  */
62190075Sobrien
62290075Sobrienextern int rs6000_pic_labelno;
62390075Sobrien
62490075Sobrien/* Override elfos.h definition.  */
62590075Sobrien#undef	ASM_DECLARE_FUNCTION_NAME
62690075Sobrien#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)			\
62790075Sobrien  do {									\
62890075Sobrien    const char *const init_ptr = (TARGET_64BIT) ? ".quad" : ".long";	\
62990075Sobrien									\
63090075Sobrien    if (TARGET_RELOCATABLE 						\
63190075Sobrien	&& (get_pool_size () != 0 || current_function_profile)		\
63290075Sobrien	&& uses_TOC())							\
63390075Sobrien      {									\
63490075Sobrien	char buf[256];							\
63590075Sobrien									\
63690075Sobrien	ASM_OUTPUT_INTERNAL_LABEL (FILE, "LCL", rs6000_pic_labelno);	\
63790075Sobrien									\
63890075Sobrien	ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1);			\
63990075Sobrien	fprintf (FILE, "\t%s ", init_ptr);				\
64090075Sobrien	assemble_name (FILE, buf);					\
64190075Sobrien	putc ('-', FILE);						\
64290075Sobrien	ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno);	\
64390075Sobrien	assemble_name (FILE, buf);					\
64490075Sobrien	putc ('\n', FILE);						\
64590075Sobrien      }									\
64690075Sobrien									\
64790075Sobrien    fprintf (FILE, "%s", TYPE_ASM_OP);					\
64890075Sobrien    assemble_name (FILE, NAME);						\
64990075Sobrien    putc (',', FILE);							\
65090075Sobrien    fprintf (FILE, TYPE_OPERAND_FMT, "function");			\
65190075Sobrien    putc ('\n', FILE);							\
65290075Sobrien    ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL));			\
65390075Sobrien									\
65490075Sobrien    if (DEFAULT_ABI == ABI_AIX)						\
65590075Sobrien      {									\
65690075Sobrien	const char *desc_name, *orig_name;				\
65790075Sobrien									\
65890075Sobrien        STRIP_NAME_ENCODING (orig_name, NAME);				\
65990075Sobrien        desc_name = orig_name;						\
66090075Sobrien	while (*desc_name == '.')					\
66190075Sobrien	  desc_name++;							\
66290075Sobrien									\
66390075Sobrien	if (TREE_PUBLIC (DECL))						\
66490075Sobrien	  fprintf (FILE, "\t.globl %s\n", desc_name);			\
66590075Sobrien									\
66690075Sobrien	fprintf (FILE, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);		\
66790075Sobrien	fprintf (FILE, "%s:\n", desc_name);				\
66890075Sobrien	fprintf (FILE, "\t%s %s\n", init_ptr, orig_name);		\
66990075Sobrien	fprintf (FILE, "\t%s _GLOBAL_OFFSET_TABLE_\n", init_ptr);	\
67090075Sobrien	if (DEFAULT_ABI == ABI_AIX)					\
67190075Sobrien	  fprintf (FILE, "\t%s 0\n", init_ptr);				\
67290075Sobrien	fprintf (FILE, "\t.previous\n");				\
67390075Sobrien      }									\
67490075Sobrien    ASM_OUTPUT_LABEL (FILE, NAME);					\
67590075Sobrien  } while (0)
67690075Sobrien
67790075Sobrien/* A C compound statement that outputs the assembler code for a thunk function,
67890075Sobrien    used to implement C++ virtual function calls with multiple inheritance.  The
67990075Sobrien    thunk acts as a wrapper around a virtual function, adjusting the implicit
68090075Sobrien    object parameter before handing control off to the real function.
68190075Sobrien
68290075Sobrien    First, emit code to add the integer DELTA to the location that contains the
68390075Sobrien    incoming first argument.  Assume that this argument contains a pointer, and
68490075Sobrien    is the one used to pass the this' pointer in C++.  This is the incoming
68590075Sobrien    argument *before* the function prologue, e.g. %o0' on a sparc.  The
68690075Sobrien    addition must preserve the values of all other incoming arguments.
68790075Sobrien
68890075Sobrien    After the addition, emit code to jump to FUNCTION, which is a
68990075Sobrien    FUNCTION_DECL'.  This is a direct pure jump, not a call, and does not touch
69090075Sobrien    the return address.  Hence returning from FUNCTION will return to whoever
69190075Sobrien    called the current thunk'.
69290075Sobrien
69390075Sobrien    The effect must be as if FUNCTION had been called directly with the adjusted
69490075Sobrien    first argument.  This macro is responsible for emitting all of the code for
69590075Sobrien    a thunk function; FUNCTION_PROLOGUE' and FUNCTION_EPILOGUE' are not
69690075Sobrien    invoked.
69790075Sobrien
69890075Sobrien    The THUNK_FNDECL is redundant.  (DELTA and FUNCTION have already been
69990075Sobrien    extracted from it.)  It might possibly be useful on some targets, but
70090075Sobrien    probably not.
70190075Sobrien
70290075Sobrien    If you do not define this macro, the target-independent code in the C++
70390075Sobrien    frontend will generate a less efficient heavyweight thunk that calls
70490075Sobrien    FUNCTION instead of jumping to it.  The generic approach does not support
70590075Sobrien    varargs.  */
70690075Sobrien
70790075Sobrien#define	ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
70890075Sobrien  output_mi_thunk (FILE, THUNK_FNDECL, DELTA, FUNCTION)
70990075Sobrien
71090075Sobrien/* The USER_LABEL_PREFIX stuff is affected by the -fleading-underscore
71190075Sobrien   flag.  The LOCAL_LABEL_PREFIX variable is used by dbxelf.h.  */
71290075Sobrien
71390075Sobrien#define	LOCAL_LABEL_PREFIX "."
71490075Sobrien#define	USER_LABEL_PREFIX ""
71590075Sobrien
71690075Sobrien/* svr4.h overrides ASM_OUTPUT_INTERNAL_LABEL.  */
71790075Sobrien
71890075Sobrien#define	ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX)	\
71990075Sobrien  asm_fprintf (FILE, "%L%s", PREFIX)
72090075Sobrien
72190075Sobrien#define	ASM_OUTPUT_LABEL(FILE,NAME)	\
72290075Sobrien  (assemble_name (FILE, NAME), fputs (":\n", FILE))
72390075Sobrien
72490075Sobrien/* This is how to output a command to make the user-level label named NAME
72590075Sobrien   defined for reference from other files.  */
72690075Sobrien
72790075Sobrien#define	ASM_GLOBALIZE_LABEL(FILE,NAME)	\
72890075Sobrien  do { fputs ("\t.globl ", FILE);	\
72990075Sobrien       assemble_name (FILE, NAME); putc ('\n', FILE);} while (0)
73090075Sobrien
73190075Sobrien/* This says how to output assembler code to declare an
73290075Sobrien   uninitialized internal linkage data object.  Under SVR4,
73390075Sobrien   the linker seems to want the alignment of data objects
73490075Sobrien   to depend on their types.  We do exactly that here.  */
73590075Sobrien
73690075Sobrien#define	LOCAL_ASM_OP	"\t.local\t"
73790075Sobrien
73890075Sobrien#define	LCOMM_ASM_OP	"\t.lcomm\t"
73990075Sobrien
74090075Sobrien/* Override elfos.h definition.  */
74190075Sobrien#undef	ASM_OUTPUT_ALIGNED_LOCAL
74290075Sobrien#define	ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN)		\
74390075Sobriendo {									\
74490075Sobrien  if (rs6000_sdata != SDATA_NONE && (SIZE) > 0				\
74590075Sobrien      && (SIZE) <= g_switch_value)					\
74690075Sobrien    {									\
74790075Sobrien      sbss_section ();							\
74890075Sobrien      ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT));	\
74990075Sobrien      ASM_OUTPUT_LABEL (FILE, NAME);					\
75090075Sobrien      ASM_OUTPUT_SKIP (FILE, SIZE);					\
75190075Sobrien      if (!flag_inhibit_size_directive && (SIZE) > 0)			\
75290075Sobrien	{								\
75390075Sobrien	  fprintf (FILE, "%s", SIZE_ASM_OP);				\
75490075Sobrien	  assemble_name (FILE, NAME);					\
75590075Sobrien	  fprintf (FILE, ",%d\n",  SIZE);				\
75690075Sobrien	}								\
75790075Sobrien    }									\
75890075Sobrien  else									\
75990075Sobrien    {									\
76090075Sobrien      fprintf (FILE, "%s", LCOMM_ASM_OP);				\
76190075Sobrien      assemble_name ((FILE), (NAME));					\
76290075Sobrien      fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT);	\
76390075Sobrien    }									\
76490075Sobrien} while (0)
76590075Sobrien
76690075Sobrien/* Describe how to emit uninitialized external linkage items.  */
76790075Sobrien#define	ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN)		\
76890075Sobriendo {									\
76990075Sobrien  ASM_GLOBALIZE_LABEL (FILE, NAME);					\
77090075Sobrien  ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN);			\
77190075Sobrien} while (0)
77290075Sobrien
773103445Skan/* This is how to output code to push a register on the stack.
774103445Skan   It need not be very fast code.
775103445Skan
776103445Skan   On the rs6000, we must keep the backchain up to date.  In order
777103445Skan   to simplify things, always allocate 16 bytes for a push (System V
778103445Skan   wants to keep stack aligned to a 16 byte boundary).  */
779103445Skan
780103445Skan#define	ASM_OUTPUT_REG_PUSH(FILE, REGNO)				\
781103445Skando {									\
782103445Skan  if (DEFAULT_ABI == ABI_V4)						\
783103445Skan    asm_fprintf (FILE,							\
784103445Skan		 (TARGET_32BIT						\
785103445Skan		  ? "\t{stu|stwu} %s,-16(%s)\n\t{st|stw} %s,12(%s)\n"	\
786103445Skan		  : "\tstdu %s,-32(%s)\n\tstd %s,24(%s)\n"),		\
787103445Skan		 reg_names[1], reg_names[1], reg_names[REGNO],		\
788103445Skan		 reg_names[1]);						\
789103445Skan} while (0)
790103445Skan
791103445Skan/* This is how to output an insn to pop a register from the stack.
792103445Skan   It need not be very fast code.  */
793103445Skan
794103445Skan#define	ASM_OUTPUT_REG_POP(FILE, REGNO)					\
795103445Skando {									\
796103445Skan  if (DEFAULT_ABI == ABI_V4)						\
797103445Skan    asm_fprintf (FILE,							\
798103445Skan		 (TARGET_32BIT						\
799103445Skan		  ? "\t{l|lwz} %s,12(%s)\n\t{ai|addic} %s,%s,16\n"	\
800103445Skan		  : "\tld %s,24(%s)\n\t{ai|addic} %s,%s,32\n"),		\
801103445Skan		 reg_names[REGNO], reg_names[1], reg_names[1],		\
802103445Skan		 reg_names[1]);						\
803103445Skan} while (0)
804103445Skan
80590075Sobrien/* Switch  Recognition by gcc.c.  Add -G xx support.  */
80690075Sobrien
80790075Sobrien/* Override svr4.h definition.  */
80890075Sobrien#undef	SWITCH_TAKES_ARG
80990075Sobrien#define	SWITCH_TAKES_ARG(CHAR)						\
81090075Sobrien  ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o'			\
81190075Sobrien   || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u'			\
81290075Sobrien   || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x'			\
81390075Sobrien   || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V'			\
81490075Sobrien   || (CHAR) == 'B' || (CHAR) == 'b' || (CHAR) == 'G')
81590075Sobrien
81690075Sobrien/* Output .file.  */
81790075Sobrien/* Override elfos.h definition.  */
81890075Sobrien#undef	ASM_FILE_START
81990075Sobrien#define	ASM_FILE_START(FILE)						\
82090075Sobriendo {									\
82190075Sobrien  output_file_directive ((FILE), main_input_filename);			\
82290075Sobrien  rs6000_file_start (FILE, TARGET_CPU_DEFAULT);				\
82390075Sobrien} while (0)
82490075Sobrien
82590075Sobrien
82690075Sobrienextern int fixuplabelno;
82790075Sobrien
82890075Sobrien/* Handle constructors specially for -mrelocatable.  */
82990075Sobrien#define TARGET_ASM_CONSTRUCTOR  rs6000_elf_asm_out_constructor
83090075Sobrien#define TARGET_ASM_DESTRUCTOR   rs6000_elf_asm_out_destructor
83190075Sobrien
83290075Sobrien/* This is the end of what might become sysv4.h.  */
83390075Sobrien
83490075Sobrien/* Use DWARF 2 debugging information by default.  */
83590075Sobrien#undef	PREFERRED_DEBUGGING_TYPE
83690075Sobrien#define	PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
83790075Sobrien
83890075Sobrien/* Historically we have also supported stabs debugging.  */
83990075Sobrien#define	DBX_DEBUGGING_INFO
84090075Sobrien
84190075Sobrien/* If we are referencing a function that is static or is known to be
84290075Sobrien   in this file, make the SYMBOL_REF special.  We can use this to indicate
84390075Sobrien   that we can branch to this function without emitting a no-op after the
84490075Sobrien   call.  For real AIX calling sequences, we also replace the
84590075Sobrien   function name with the real name (1 or 2 leading .'s), rather than
84690075Sobrien   the function descriptor name.  This saves a lot of overriding code
84790075Sobrien   to read the prefixes.  */
84890075Sobrien
84990075Sobrien#undef	ENCODE_SECTION_INFO
85090075Sobrien#define	ENCODE_SECTION_INFO(DECL) rs6000_encode_section_info (DECL)
85190075Sobrien
85290075Sobrien/* The ELF version doesn't encode [DS] or whatever at the end of symbols.  */
85390075Sobrien
85490075Sobrien#define	RS6000_OUTPUT_BASENAME(FILE, NAME)	\
85590075Sobrien    assemble_name (FILE, NAME)
85690075Sobrien
85790075Sobrien/* This macro gets just the user-specified name
85890075Sobrien   out of the string in a SYMBOL_REF.  Discard
85990075Sobrien   a leading * or @.  */
86090075Sobrien#define	STRIP_NAME_ENCODING(VAR,SYMBOL_NAME)				\
86190075Sobriendo {									\
86290075Sobrien  const char *_name = SYMBOL_NAME;					\
86390075Sobrien  while (*_name == '*' || *_name == '@')				\
86490075Sobrien    _name++;								\
86590075Sobrien  (VAR) = _name;							\
86690075Sobrien} while (0)
86790075Sobrien
86890075Sobrien/* This is how to output a reference to a user-level label named NAME.
86990075Sobrien   `assemble_name' uses this.  */
87090075Sobrien
87190075Sobrien/* Override elfos.h definition.  */
87290075Sobrien#undef	ASM_OUTPUT_LABELREF
87390075Sobrien#define	ASM_OUTPUT_LABELREF(FILE,NAME)		\
87490075Sobriendo {						\
87590075Sobrien  const char *_name = NAME;			\
87690075Sobrien  if (*_name == '@')				\
87790075Sobrien    _name++;					\
87890075Sobrien 						\
87990075Sobrien  if (*_name == '*')				\
88090075Sobrien    fprintf (FILE, "%s", _name + 1);		\
88190075Sobrien  else						\
88290075Sobrien    asm_fprintf (FILE, "%U%s", _name);		\
88390075Sobrien} while (0)
88490075Sobrien
88590075Sobrien/* But, to make this work, we have to output the stabs for the function
88690075Sobrien   name *first*...  */
88790075Sobrien
88890075Sobrien#define	DBX_FUNCTION_FIRST
88990075Sobrien
89090075Sobrien/* This is the end of what might become sysv4dbx.h.  */
89190075Sobrien
89290075Sobrien#ifndef	TARGET_VERSION
89390075Sobrien#define	TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)");
89490075Sobrien#endif
89590075Sobrien
89690075Sobrien#ifndef	CPP_PREDEFINES
89790075Sobrien#define	CPP_PREDEFINES \
89890075Sobrien  "-DPPC -Dunix -D__svr4__ -Asystem=unix -Asystem=svr4 -Acpu=powerpc -Amachine=powerpc"
89990075Sobrien#endif
90090075Sobrien
90190075Sobrien/* Pass various options to the assembler.  */
90290075Sobrien/* Override svr4.h definition.  */
90390075Sobrien#undef	ASM_SPEC
90490075Sobrien#define	ASM_SPEC "%(asm_cpu) \
90590075Sobrien%{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \
90690075Sobrien%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
90790075Sobrien%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \
90890075Sobrien%{memb} %{!memb: %{msdata: -memb} %{msdata=eabi: -memb}} \
90990075Sobrien%{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian} \
91090075Sobrien%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
91190075Sobrien    %{mcall-freebsd: -mbig} \
91290075Sobrien    %{mcall-i960-old: -mlittle} \
91390075Sobrien    %{mcall-linux: -mbig} \
91496263Sobrien    %{mcall-gnu: -mbig} \
91590075Sobrien    %{mcall-netbsd: -mbig} \
91690075Sobrien}}}}"
91790075Sobrien
91890075Sobrien#define	CC1_ENDIAN_BIG_SPEC ""
91990075Sobrien
92090075Sobrien#define	CC1_ENDIAN_LITTLE_SPEC "\
92190075Sobrien%{!mstrict-align: %{!mno-strict-align: \
92290075Sobrien    %{!mcall-i960-old: \
92390075Sobrien	-mstrict-align \
92490075Sobrien    } \
92590075Sobrien}}"
92690075Sobrien
92796263Sobrien#define	CC1_ENDIAN_DEFAULT_SPEC "%(cc1_endian_big)"
92890075Sobrien
92990075Sobrien/* Pass -G xxx to the compiler and set correct endian mode.  */
93090075Sobrien#define	CC1_SPEC "%{G*} \
93190075Sobrien%{mlittle: %(cc1_endian_little)} %{!mlittle: %{mlittle-endian: %(cc1_endian_little)}} \
93290075Sobrien%{mbig: %(cc1_endian_big)} %{!mbig: %{mbig-endian: %(cc1_endian_big)}} \
93390075Sobrien%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
93490075Sobrien    %{mcall-aixdesc: -mbig %(cc1_endian_big) } \
93590075Sobrien    %{mcall-freebsd: -mbig %(cc1_endian_big) } \
93690075Sobrien    %{mcall-i960-old: -mlittle %(cc1_endian_little) } \
93790075Sobrien    %{mcall-linux: -mbig %(cc1_endian_big) } \
93896263Sobrien    %{mcall-gnu: -mbig %(cc1_endian_big) } \
93990075Sobrien    %{mcall-netbsd: -mbig %(cc1_endian_big) } \
94096263Sobrien    %{!mcall-aixdesc: %{!mcall-freebsd: %{!mcall-i960-old: %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd: \
94190075Sobrien	    %(cc1_endian_default) \
94296263Sobrien    }}}}}} \
94390075Sobrien}}}} \
94490075Sobrien%{mno-sdata: -msdata=none } \
94590075Sobrien%{meabi: %{!mcall-*: -mcall-sysv }} \
94690075Sobrien%{!meabi: %{!mno-eabi: \
94790075Sobrien    %{mrelocatable: -meabi } \
94890075Sobrien    %{mcall-freebsd: -mno-eabi } \
94990075Sobrien    %{mcall-i960-old: -meabi } \
95090075Sobrien    %{mcall-linux: -mno-eabi } \
95196263Sobrien    %{mcall-gnu: -mno-eabi } \
95290075Sobrien    %{mcall-netbsd: -mno-eabi }}} \
95390075Sobrien%{msdata: -msdata=default} \
95490075Sobrien%{mno-sdata: -msdata=none} \
95590075Sobrien%{profile: -p}"
95690075Sobrien
95790075Sobrien/* Don't put -Y P,<path> for cross compilers.  */
95890075Sobrien#ifndef CROSS_COMPILE
95990075Sobrien#define LINK_PATH_SPEC "\
96090075Sobrien%{!R*:%{L*:-R %*}} \
96190075Sobrien%{!nostdlib: %{!YP,*: \
96290075Sobrien    %{compat-bsd: \
96390075Sobrien	%{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
96490075Sobrien	%{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}} \
96590075Sobrien	%{!R*: %{!L*: -R /usr/ucblib}} \
96690075Sobrien    %{!compat-bsd: \
96790075Sobrien	%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
96890075Sobrien	%{!p:-Y P,/usr/ccs/lib:/usr/lib}}}}"
96990075Sobrien
97090075Sobrien#else
97190075Sobrien#define LINK_PATH_SPEC ""
97290075Sobrien#endif
97390075Sobrien
97490075Sobrien/* Default starting address if specified.  */
97590075Sobrien#define LINK_START_SPEC "\
97690075Sobrien%{mads: %(link_start_ads) } \
97790075Sobrien%{myellowknife: %(link_start_yellowknife) } \
97890075Sobrien%{mmvme: %(link_start_mvme) } \
97990075Sobrien%{msim: %(link_start_sim) } \
98090075Sobrien%{mcall-freebsd: %(link_start_freebsd) } \
98190075Sobrien%{mcall-linux: %(link_start_linux) } \
98296263Sobrien%{mcall-gnu: %(link_start_gnu) } \
98390075Sobrien%{mcall-netbsd: %(link_start_netbsd) } \
98496263Sobrien%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-gnu: \
98596263Sobrien	%{!mcall-netbsd: %{!mcall-freebsd: %(link_start_default) }}}}}}}}"
98690075Sobrien
98790075Sobrien#define LINK_START_DEFAULT_SPEC ""
98890075Sobrien
98990075Sobrien/* Override svr4.h definition.  */
99090075Sobrien#undef	LINK_SPEC
99190075Sobrien#define	LINK_SPEC "\
99290075Sobrien%{h*} %{v:-V} %{!msdata=none:%{G*}} %{msdata=none:-G0} \
99390075Sobrien%{YP,*} %{R*} \
99490075Sobrien%{Qy:} %{!Qn:-Qy} \
99590075Sobrien%(link_shlib) \
99690075Sobrien%{!Wl,-T*: %{!T*: %(link_start) }} \
99790075Sobrien%(link_target) \
99890075Sobrien%(link_os)"
99990075Sobrien
100090075Sobrien/* For now, turn off shared libraries by default.  */
100190075Sobrien#ifndef SHARED_LIB_SUPPORT
100290075Sobrien#define NO_SHARED_LIB_SUPPORT
100390075Sobrien#endif
100490075Sobrien
100590075Sobrien#ifndef NO_SHARED_LIB_SUPPORT
100690075Sobrien/* Shared libraries are default.  */
100790075Sobrien#define LINK_SHLIB_SPEC "\
100890075Sobrien%{!static: %(link_path) %{!R*:%{L*:-R %*}}} \
100990075Sobrien%{mshlib: } \
101090075Sobrien%{static:-dn -Bstatic} \
101190075Sobrien%{shared:-G -dy -z text} \
101290075Sobrien%{symbolic:-Bsymbolic -G -dy -z text}"
101390075Sobrien
101490075Sobrien#else
101590075Sobrien/* Shared libraries are not default.  */
101690075Sobrien#define LINK_SHLIB_SPEC "\
101790075Sobrien%{mshlib: %(link_path) } \
101890075Sobrien%{!mshlib: %{!shared: %{!symbolic: -dn -Bstatic}}} \
101990075Sobrien%{static: } \
102090075Sobrien%{shared:-G -dy -z text %(link_path) } \
102190075Sobrien%{symbolic:-Bsymbolic -G -dy -z text %(link_path) }"
102290075Sobrien#endif
102390075Sobrien
102490075Sobrien/* Override the default target of the linker.  */
102590075Sobrien#define	LINK_TARGET_SPEC "\
102690075Sobrien%{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } \
102790075Sobrien%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
102890075Sobrien    %{mcall-i960-old: --oformat elf32-powerpcle} \
102990075Sobrien  }}}}"
103090075Sobrien
103190075Sobrien/* Any specific OS flags.  */
103290075Sobrien#define LINK_OS_SPEC "\
103390075Sobrien%{mads: %(link_os_ads) } \
103490075Sobrien%{myellowknife: %(link_os_yellowknife) } \
103590075Sobrien%{mmvme: %(link_os_mvme) } \
103690075Sobrien%{msim: %(link_os_sim) } \
103790075Sobrien%{mcall-freebsd: %(link_os_freebsd) } \
103890075Sobrien%{mcall-linux: %(link_os_linux) } \
103996263Sobrien%{mcall-gnu: %(link_os_gnu) } \
104090075Sobrien%{mcall-netbsd: %(link_os_netbsd) } \
104196263Sobrien%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd: %(link_os_default) }}}}}}}}"
104290075Sobrien
104390075Sobrien#define LINK_OS_DEFAULT_SPEC ""
104490075Sobrien
104590075Sobrien#define CPP_SYSV_SPEC \
104690075Sobrien"%{mrelocatable*: -D_RELOCATABLE} \
104790075Sobrien%{fpic: -D__PIC__=1 -D__pic__=1} \
104890075Sobrien%{!fpic: %{fPIC: -D__PIC__=2 -D__pic__=2}} \
104990075Sobrien%{mlong-double-128: -D__LONG_DOUBLE_128__=1} \
105090075Sobrien%{!mlong-double-64: %(cpp_longdouble_default)} \
105190075Sobrien%{mcall-sysv: -D_CALL_SYSV} \
105290075Sobrien%{mcall-aix: -D_CALL_AIX} %{mcall-aixdesc: -D_CALL_AIX -D_CALL_AIXDESC} \
105390075Sobrien%{!mcall-sysv: %{!mcall-aix: %{!mcall-aixdesc: %(cpp_sysv_default) }}} \
105490075Sobrien%{msoft-float: -D_SOFT_FLOAT} \
105590075Sobrien%{!msoft-float: %{!mhard-float: \
105690075Sobrien    %{mcpu=401: -D_SOFT_FLOAT} \
105790075Sobrien    %{mcpu=403: -D_SOFT_FLOAT} \
105890075Sobrien    %{mcpu=405: -D_SOFT_FLOAT} \
105990075Sobrien    %{mcpu=ec603e: -D_SOFT_FLOAT} \
106090075Sobrien    %{mcpu=801: -D_SOFT_FLOAT} \
106190075Sobrien    %{mcpu=821: -D_SOFT_FLOAT} \
106290075Sobrien    %{mcpu=823: -D_SOFT_FLOAT} \
106390075Sobrien    %{mcpu=860: -D_SOFT_FLOAT} \
106490075Sobrien    %{!mcpu*: %(cpp_float_default) }}}"
106590075Sobrien
106690075Sobrien/* Whether floating point is disabled by default.  */
106790075Sobrien#define	CPP_FLOAT_DEFAULT_SPEC ""
106890075Sobrien
106990075Sobrien/* Whether 'long double' is 128 bits by default.  */
107090075Sobrien#define	CPP_LONGDOUBLE_DEFAULT_SPEC ""
107190075Sobrien
107290075Sobrien#define	CPP_SYSV_DEFAULT_SPEC "-D_CALL_SYSV"
107390075Sobrien
107490075Sobrien#define CPP_ENDIAN_BIG_SPEC "-D_BIG_ENDIAN -D__BIG_ENDIAN__ -Amachine=bigendian"
107590075Sobrien
107690075Sobrien#define CPP_ENDIAN_LITTLE_SPEC "-D_LITTLE_ENDIAN -D__LITTLE_ENDIAN__ -Amachine=littleendian"
107790075Sobrien
107890075Sobrien#define	CPP_ENDIAN_SPEC \
107990075Sobrien"%{mlittle: %(cpp_endian_little) } \
108090075Sobrien%{mlittle-endian: %(cpp_endian_little) } \
108190075Sobrien%{mbig: %(cpp_endian_big) } \
108290075Sobrien%{mbig-endian: %(cpp_endian_big) } \
108390075Sobrien%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
108490075Sobrien    %{mcall-freebsd: %(cpp_endian_big) } \
108590075Sobrien    %{mcall-linux: %(cpp_endian_big) } \
108696263Sobrien    %{mcall-gnu: %(cpp_endian_big) } \
108790075Sobrien    %{mcall-netbsd: %(cpp_endian_big) } \
108890075Sobrien    %{mcall-i960-old: %(cpp_endian_little) } \
108990075Sobrien    %{mcall-aixdesc:  %(cpp_endian_big) } \
109096263Sobrien    %{!mcall-linux: %{!mcall-gnu: %{!mcall-freebsd: %{!mcall-netbsd: %{!mcall-aixdesc: %(cpp_endian_default) }}}}}}}}}"
109190075Sobrien
109290075Sobrien#define	CPP_ENDIAN_DEFAULT_SPEC "%(cpp_endian_big)"
109390075Sobrien
109490075Sobrien/* Override rs6000.h definition.  */
109590075Sobrien#undef	CPP_SPEC
109690075Sobrien#define	CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_sysv) %(cpp_endian) %(cpp_cpu) \
109790075Sobrien%{mads: %(cpp_os_ads) } \
109890075Sobrien%{myellowknife: %(cpp_os_yellowknife) } \
109990075Sobrien%{mmvme: %(cpp_os_mvme) } \
110090075Sobrien%{msim: %(cpp_os_sim) } \
110190075Sobrien%{mcall-freebsd: %(cpp_os_freebsd) } \
110290075Sobrien%{mcall-linux: %(cpp_os_linux) } \
110396263Sobrien%{mcall-gnu: %(cpp_os_gnu) } \
110490075Sobrien%{mcall-netbsd: %(cpp_os_netbsd) } \
110596263Sobrien%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd: %(cpp_os_default) }}}}}}}}"
110690075Sobrien
110790075Sobrien#define	CPP_OS_DEFAULT_SPEC ""
110890075Sobrien
110990075Sobrien/* Override svr4.h definition.  */
111090075Sobrien#undef	STARTFILE_SPEC
111190075Sobrien#define	STARTFILE_SPEC "\
111290075Sobrien%{mads: %(startfile_ads) } \
111390075Sobrien%{myellowknife: %(startfile_yellowknife) } \
111490075Sobrien%{mmvme: %(startfile_mvme) } \
111590075Sobrien%{msim: %(startfile_sim) } \
111690075Sobrien%{mcall-freebsd: %(startfile_freebsd) } \
111790075Sobrien%{mcall-linux: %(startfile_linux) } \
111896263Sobrien%{mcall-gnu: %(startfile_gnu) } \
111990075Sobrien%{mcall-netbsd: %(startfile_netbsd) } \
112096263Sobrien%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd: %(startfile_default) }}}}}}}}"
112190075Sobrien
112290075Sobrien#define	STARTFILE_DEFAULT_SPEC ""
112390075Sobrien
112490075Sobrien/* Override svr4.h definition.  */
112590075Sobrien#undef	LIB_SPEC
112690075Sobrien#define	LIB_SPEC "\
112790075Sobrien%{mads: %(lib_ads) } \
112890075Sobrien%{myellowknife: %(lib_yellowknife) } \
112990075Sobrien%{mmvme: %(lib_mvme) } \
113090075Sobrien%{msim: %(lib_sim) } \
113190075Sobrien%{mcall-freebsd: %(lib_freebsd) } \
113290075Sobrien%{mcall-linux: %(lib_linux) } \
113396263Sobrien%{mcall-gnu: %(lib_gnu) } \
113490075Sobrien%{mcall-netbsd: %(lib_netbsd) } \
113596263Sobrien%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd: %(lib_default) }}}}}}}}"
113690075Sobrien
113790075Sobrien#define LIB_DEFAULT_SPEC ""
113890075Sobrien
113990075Sobrien/* Override svr4.h definition.  */
114090075Sobrien#undef	ENDFILE_SPEC
114196263Sobrien#define	ENDFILE_SPEC "crtsavres.o%s \
114290075Sobrien%{mads: %(endfile_ads)} \
114390075Sobrien%{myellowknife: %(endfile_yellowknife)} \
114490075Sobrien%{mmvme: %(endfile_mvme)} \
114590075Sobrien%{msim: %(endfile_sim)} \
114690075Sobrien%{mcall-freebsd: %(endfile_freebsd) } \
114790075Sobrien%{mcall-linux: %(endfile_linux) } \
114896263Sobrien%{mcall-gnu: %(endfile_gnu) } \
114990075Sobrien%{mcall-netbsd: %(endfile_netbsd) } \
115090075Sobrien%{mvxworks: %(endfile_vxworks) } \
115196263Sobrien%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd: %{!mvxworks: %(endfile_default) }}}}}}}}}"
115290075Sobrien
115390075Sobrien#define	ENDFILE_DEFAULT_SPEC ""
115490075Sobrien
115590075Sobrien/* Motorola ADS support.  */
115690075Sobrien#define LIB_ADS_SPEC "--start-group -lads -lc --end-group"
115790075Sobrien
115890075Sobrien#define	STARTFILE_ADS_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
115990075Sobrien
116090075Sobrien#define	ENDFILE_ADS_SPEC "crtend.o%s ecrtn.o%s"
116190075Sobrien
116290075Sobrien#define LINK_START_ADS_SPEC "-T ads.ld%s"
116390075Sobrien
116490075Sobrien#define LINK_OS_ADS_SPEC ""
116590075Sobrien
116690075Sobrien#define CPP_OS_ADS_SPEC ""
116790075Sobrien
116890075Sobrien/* Motorola Yellowknife support.  */
116990075Sobrien#define LIB_YELLOWKNIFE_SPEC "--start-group -lyk -lc --end-group"
117090075Sobrien
117190075Sobrien#define	STARTFILE_YELLOWKNIFE_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
117290075Sobrien
117390075Sobrien#define	ENDFILE_YELLOWKNIFE_SPEC "crtend.o%s ecrtn.o%s"
117490075Sobrien
117590075Sobrien#define LINK_START_YELLOWKNIFE_SPEC "-T yellowknife.ld%s"
117690075Sobrien
117790075Sobrien#define LINK_OS_YELLOWKNIFE_SPEC ""
117890075Sobrien
117990075Sobrien#define CPP_OS_YELLOWKNIFE_SPEC ""
118090075Sobrien
118190075Sobrien/* Motorola MVME support.  */
118290075Sobrien#define LIB_MVME_SPEC "--start-group -lmvme -lc --end-group"
118390075Sobrien
118490075Sobrien#define	STARTFILE_MVME_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
118590075Sobrien
118690075Sobrien#define	ENDFILE_MVME_SPEC "crtend.o%s ecrtn.o%s"
118790075Sobrien
118890075Sobrien#define LINK_START_MVME_SPEC "-Ttext 0x40000"
118990075Sobrien
119090075Sobrien#define LINK_OS_MVME_SPEC ""
119190075Sobrien
119290075Sobrien#define CPP_OS_MVME_SPEC ""
119390075Sobrien
119490075Sobrien/* PowerPC simulator based on netbsd system calls support.  */
119590075Sobrien#define LIB_SIM_SPEC "--start-group -lsim -lc --end-group"
119690075Sobrien
119790075Sobrien#define	STARTFILE_SIM_SPEC "ecrti.o%s sim-crt0.o%s crtbegin.o%s"
119890075Sobrien
119990075Sobrien#define	ENDFILE_SIM_SPEC "crtend.o%s ecrtn.o%s"
120090075Sobrien
120190075Sobrien#define LINK_START_SIM_SPEC ""
120290075Sobrien
120390075Sobrien#define LINK_OS_SIM_SPEC "-m elf32ppcsim"
120490075Sobrien
120590075Sobrien#define CPP_OS_SIM_SPEC ""
120690075Sobrien
120790075Sobrien/* FreeBSD support.  */
120890075Sobrien
120990075Sobrien#define CPP_OS_FREEBSD_SPEC	"\
121090075Sobrien  -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ \
121190075Sobrien  -Acpu=powerpc -Amachine=powerpc"
121290075Sobrien
121390075Sobrien#define	STARTFILE_FREEBSD_SPEC	FBSD_STARTFILE_SPEC
121490075Sobrien#define ENDFILE_FREEBSD_SPEC	FBSD_ENDFILE_SPEC
121590075Sobrien#define LIB_FREEBSD_SPEC	FBSD_LIB_SPEC
121690075Sobrien#define LINK_START_FREEBSD_SPEC	""
121790075Sobrien
121890075Sobrien#define LINK_OS_FREEBSD_SPEC "\
121990075Sobrien  %{symbolic:-Bsymbolic}"
122090075Sobrien
122190075Sobrien/* GNU/Linux support.  */
122290075Sobrien#ifdef USE_GNULIBC_1
122390075Sobrien#define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
122490075Sobrien%{!mnewlib: -lc }"
122590075Sobrien#else
122690075Sobrien#define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
122790075Sobrien%{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } \
122890075Sobrien%{profile:-lc_p} %{!profile:-lc}}}"
122990075Sobrien#endif
123090075Sobrien
123196263Sobrien#ifdef USE_GNULIBC_1
123290075Sobrien#define	STARTFILE_LINUX_SPEC "\
123390075Sobrien%{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
123490075Sobrien%{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \
123590075Sobrien%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
123696263Sobrien#else
123796263Sobrien#define	STARTFILE_LINUX_SPEC "\
123896263Sobrien%{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
123996263Sobrien%{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \
124096263Sobrien%{static:crtbeginT.o%s} \
124196263Sobrien%{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
124296263Sobrien#endif
124390075Sobrien
124490075Sobrien#define	ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
124590075Sobrien%{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}"
124690075Sobrien
124790075Sobrien#define LINK_START_LINUX_SPEC ""
124890075Sobrien
124990075Sobrien#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
125090075Sobrien  %{rdynamic:-export-dynamic} \
125190075Sobrien  %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
125290075Sobrien
125396263Sobrien#if !defined(USE_GNULIBC_1) && defined(HAVE_LD_EH_FRAME_HDR)
125496263Sobrien# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
125596263Sobrien#endif
125696263Sobrien
125790075Sobrien#ifdef USE_GNULIBC_1
125896263Sobrien#define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
125996263Sobrien%{!undef:							  \
126096263Sobrien  %{!ansi:							  \
126196263Sobrien    %{!std=*:-Dunix -D__unix -Dlinux -D__linux}	                  \
126296263Sobrien    %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}}		  \
126390075Sobrien-Asystem=unix -Asystem=posix"
126490075Sobrien#else
126596263Sobrien#define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
126696263Sobrien%{!undef:							  \
126796263Sobrien  %{!ansi:							  \
126896263Sobrien    %{!std=*:-Dunix -D__unix -Dlinux -D__linux}			  \
126996263Sobrien    %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}}		  \
127090075Sobrien-Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
127190075Sobrien#endif
127290075Sobrien
127396263Sobrien/* GNU/Hurd support.  */
127496263Sobrien#define LIB_GNU_SPEC "%{mnewlib: --start-group -lgnu -lc --end-group } \
127596263Sobrien%{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } \
127696263Sobrien%{profile:-lc_p} %{!profile:-lc}}}"
127796263Sobrien
127896263Sobrien#define	STARTFILE_GNU_SPEC "\
127996263Sobrien%{!shared: %{!static: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}} \
128096263Sobrien%{static: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} \
128196263Sobrien%{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \
128296263Sobrien%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
128396263Sobrien
128496263Sobrien#define	ENDFILE_GNU_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
128596263Sobrien%{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}"
128696263Sobrien
128796263Sobrien#define LINK_START_GNU_SPEC ""
128896263Sobrien
128996263Sobrien#define LINK_OS_GNU_SPEC "-m elf32ppclinux %{!shared: %{!static: \
129096263Sobrien  %{rdynamic:-export-dynamic} \
129196263Sobrien  %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
129296263Sobrien
129396263Sobrien#define CPP_OS_GNU_SPEC "-D__unix__ -D__gnu_hurd__ -D__GNU__	\
129496263Sobrien%{!undef:					                \
129596263Sobrien  %{!ansi: -Dunix -D__unix}}			                \
129696263Sobrien-Asystem=gnu -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
129796263Sobrien
129890075Sobrien/* NetBSD support.  */
129990075Sobrien#define LIB_NETBSD_SPEC "\
130090075Sobrien%{profile:-lgmon -lc_p} %{!profile:-lc}"
130190075Sobrien
130290075Sobrien#define	STARTFILE_NETBSD_SPEC "\
130390075Sobrienncrti.o%s crt0.o%s \
130490075Sobrien%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
130590075Sobrien
130690075Sobrien#define ENDFILE_NETBSD_SPEC "\
130790075Sobrien%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
130890075Sobrienncrtn.o%s"
130990075Sobrien
131090075Sobrien#define LINK_START_NETBSD_SPEC "\
131190075Sobrien"
131290075Sobrien
131390075Sobrien#define LINK_OS_NETBSD_SPEC "\
131490075Sobrien%{!shared: %{!static: \
131590075Sobrien  %{rdynamic:-export-dynamic} \
131690075Sobrien  %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}}}"
131790075Sobrien
131890075Sobrien#define CPP_OS_NETBSD_SPEC "\
131990075Sobrien-D__powerpc__ -D__NetBSD__ -D__ELF__ -D__KPRINTF_ATTRIBUTE__"
132090075Sobrien
1321110611Skan/* RTEMS support.  */
1322110611Skan
1323110611Skan#define CPP_OS_RTEMS_SPEC "\
1324110611Skan%{!mcpu*:  %{!Dppc*: %{!Dmpc*: -Dmpc750} } }\
1325110611Skan%{mcpu=403:  %{!Dppc*: %{!Dmpc*: -Dppc403}  } } \
1326110611Skan%{mcpu=505:  %{!Dppc*: %{!Dmpc*: -Dmpc505}  } } \
1327110611Skan%{mcpu=601:  %{!Dppc*: %{!Dmpc*: -Dppc601}  } } \
1328110611Skan%{mcpu=602:  %{!Dppc*: %{!Dmpc*: -Dppc602}  } } \
1329110611Skan%{mcpu=603:  %{!Dppc*: %{!Dmpc*: -Dppc603}  } } \
1330110611Skan%{mcpu=603e: %{!Dppc*: %{!Dmpc*: -Dppc603e} } } \
1331110611Skan%{mcpu=604:  %{!Dppc*: %{!Dmpc*: -Dmpc604}  } } \
1332110611Skan%{mcpu=750:  %{!Dppc*: %{!Dmpc*: -Dmpc750}  } } \
1333110611Skan%{mcpu=821:  %{!Dppc*: %{!Dmpc*: -Dmpc821}  } } \
1334110611Skan%{mcpu=860:  %{!Dppc*: %{!Dmpc*: -Dmpc860}  } }"
1335110611Skan
133690075Sobrien/* VxWorks support.  */
133790075Sobrien/* VxWorks does all the library stuff itself.  */
133890075Sobrien#define LIB_VXWORKS_SPEC ""
133990075Sobrien
134090075Sobrien/* VxWorks provides the functionality of crt0.o and friends itself.  */
134190075Sobrien
134290075Sobrien#define	STARTFILE_VXWORKS_SPEC ""
134390075Sobrien
134490075Sobrien#define	ENDFILE_VXWORKS_SPEC ""
134590075Sobrien
134690075Sobrien/* Because it uses ld -r, vxworks has no start/end files, nor starting
134790075Sobrien   address.  */
134890075Sobrien
134990075Sobrien#define LINK_START_VXWORKS_SPEC ""
135090075Sobrien
135190075Sobrien#define LINK_OS_VXWORKS_SPEC "-r"
135290075Sobrien
135390075Sobrien#define CPP_OS_VXWORKS_SPEC "\
135490075Sobrien-DCPU_FAMILY=PPC \
135590075Sobrien%{!mcpu*: \
135690075Sobrien  %{mpowerpc*: -DCPU=PPC603} \
135790075Sobrien  %{!mno-powerpc: -DCPU=PPC603}} \
135890075Sobrien%{mcpu=powerpc: -DCPU=PPC603} \
135990075Sobrien%{mcpu=401: -DCPU=PPC403} \
136090075Sobrien%{mcpu=403: -DCPU=PPC403} \
136190075Sobrien%{mcpu=405: -DCPU=PPC405} \
136290075Sobrien%{mcpu=601: -DCPU=PPC601} \
136390075Sobrien%{mcpu=602: -DCPU=PPC603} \
136490075Sobrien%{mcpu=603: -DCPU=PPC603} \
136590075Sobrien%{mcpu=603e: -DCPU=PPC603} \
136690075Sobrien%{mcpu=ec603e: -DCPU=PPC603} \
136790075Sobrien%{mcpu=604: -DCPU=PPC604} \
136890075Sobrien%{mcpu=604e: -DCPU=PPC604} \
136990075Sobrien%{mcpu=620: -DCPU=PPC604} \
137090075Sobrien%{mcpu=740: -DCPU=PPC603} \
137190075Sobrien%{mcpu=7450: -DCPU=PPC603} \
137290075Sobrien%{mcpu=750: -DCPU=PPC603} \
137390075Sobrien%{mcpu=801: -DCPU=PPC603} \
137490075Sobrien%{mcpu=821: -DCPU=PPC603} \
137590075Sobrien%{mcpu=823: -DCPU=PPC603} \
137690075Sobrien%{mcpu=860: -DCPU=PPC603}"
137790075Sobrien
137890075Sobrien/* Define any extra SPECS that the compiler needs to generate.  */
137990075Sobrien/* Override rs6000.h definition.  */
138090075Sobrien#undef	SUBTARGET_EXTRA_SPECS
138190075Sobrien#define	SUBTARGET_EXTRA_SPECS						\
138290075Sobrien  { "cpp_sysv",			CPP_SYSV_SPEC },			\
138390075Sobrien  { "cpp_sysv_default",		CPP_SYSV_DEFAULT_SPEC },		\
138490075Sobrien  { "cpp_endian_default",	CPP_ENDIAN_DEFAULT_SPEC },		\
138590075Sobrien  { "cpp_endian",		CPP_ENDIAN_SPEC },			\
138690075Sobrien  { "lib_ads",			LIB_ADS_SPEC },				\
138790075Sobrien  { "lib_yellowknife",		LIB_YELLOWKNIFE_SPEC },			\
138890075Sobrien  { "lib_mvme",			LIB_MVME_SPEC },			\
138990075Sobrien  { "lib_sim",			LIB_SIM_SPEC },				\
139090075Sobrien  { "lib_freebsd",		LIB_FREEBSD_SPEC },			\
139196263Sobrien  { "lib_gnu",			LIB_GNU_SPEC },				\
139290075Sobrien  { "lib_linux",		LIB_LINUX_SPEC },			\
139390075Sobrien  { "lib_netbsd",		LIB_NETBSD_SPEC },			\
139490075Sobrien  { "lib_vxworks",		LIB_VXWORKS_SPEC },			\
139590075Sobrien  { "lib_default",		LIB_DEFAULT_SPEC },			\
139690075Sobrien  { "startfile_ads",		STARTFILE_ADS_SPEC },			\
139790075Sobrien  { "startfile_yellowknife",	STARTFILE_YELLOWKNIFE_SPEC },		\
139890075Sobrien  { "startfile_mvme",		STARTFILE_MVME_SPEC },			\
139990075Sobrien  { "startfile_sim",		STARTFILE_SIM_SPEC },			\
140090075Sobrien  { "startfile_freebsd",	STARTFILE_FREEBSD_SPEC },		\
140196263Sobrien  { "startfile_gnu",		STARTFILE_GNU_SPEC },			\
140290075Sobrien  { "startfile_linux",		STARTFILE_LINUX_SPEC },			\
140390075Sobrien  { "startfile_netbsd",		STARTFILE_NETBSD_SPEC },		\
140490075Sobrien  { "startfile_vxworks",	STARTFILE_VXWORKS_SPEC },		\
140590075Sobrien  { "startfile_default",	STARTFILE_DEFAULT_SPEC },		\
140690075Sobrien  { "endfile_ads",		ENDFILE_ADS_SPEC },			\
140790075Sobrien  { "endfile_yellowknife",	ENDFILE_YELLOWKNIFE_SPEC },		\
140890075Sobrien  { "endfile_mvme",		ENDFILE_MVME_SPEC },			\
140990075Sobrien  { "endfile_sim",		ENDFILE_SIM_SPEC },			\
141090075Sobrien  { "endfile_freebsd",		ENDFILE_FREEBSD_SPEC },			\
141196263Sobrien  { "endfile_gnu",		ENDFILE_GNU_SPEC },			\
141290075Sobrien  { "endfile_linux",		ENDFILE_LINUX_SPEC },			\
141390075Sobrien  { "endfile_netbsd",		ENDFILE_NETBSD_SPEC },			\
141490075Sobrien  { "endfile_vxworks",		ENDFILE_VXWORKS_SPEC },			\
141590075Sobrien  { "endfile_default",		ENDFILE_DEFAULT_SPEC },			\
141690075Sobrien  { "link_path",		LINK_PATH_SPEC },			\
141790075Sobrien  { "link_shlib",		LINK_SHLIB_SPEC },			\
141890075Sobrien  { "link_target",		LINK_TARGET_SPEC },			\
141990075Sobrien  { "link_start",		LINK_START_SPEC },			\
142090075Sobrien  { "link_start_ads",		LINK_START_ADS_SPEC },			\
142190075Sobrien  { "link_start_yellowknife",	LINK_START_YELLOWKNIFE_SPEC },		\
142290075Sobrien  { "link_start_mvme",		LINK_START_MVME_SPEC },			\
142390075Sobrien  { "link_start_sim",		LINK_START_SIM_SPEC },			\
142490075Sobrien  { "link_start_freebsd",	LINK_START_FREEBSD_SPEC },		\
142596263Sobrien  { "link_start_gnu",		LINK_START_GNU_SPEC },			\
142690075Sobrien  { "link_start_linux",		LINK_START_LINUX_SPEC },		\
142790075Sobrien  { "link_start_netbsd",	LINK_START_NETBSD_SPEC },		\
142890075Sobrien  { "link_start_vxworks",	LINK_START_VXWORKS_SPEC },		\
142990075Sobrien  { "link_start_default",	LINK_START_DEFAULT_SPEC },		\
143090075Sobrien  { "link_os",			LINK_OS_SPEC },				\
143190075Sobrien  { "link_os_ads",		LINK_OS_ADS_SPEC },			\
143290075Sobrien  { "link_os_yellowknife",	LINK_OS_YELLOWKNIFE_SPEC },		\
143390075Sobrien  { "link_os_mvme",		LINK_OS_MVME_SPEC },			\
143490075Sobrien  { "link_os_sim",		LINK_OS_SIM_SPEC },			\
143590075Sobrien  { "link_os_freebsd",		LINK_OS_FREEBSD_SPEC },			\
143690075Sobrien  { "link_os_linux",		LINK_OS_LINUX_SPEC },			\
143796263Sobrien  { "link_os_gnu",		LINK_OS_GNU_SPEC },			\
143890075Sobrien  { "link_os_netbsd",		LINK_OS_NETBSD_SPEC },			\
143990075Sobrien  { "link_os_vxworks",		LINK_OS_VXWORKS_SPEC },			\
144090075Sobrien  { "link_os_default",		LINK_OS_DEFAULT_SPEC },			\
144190075Sobrien  { "cc1_endian_big",		CC1_ENDIAN_BIG_SPEC },			\
144290075Sobrien  { "cc1_endian_little",	CC1_ENDIAN_LITTLE_SPEC },		\
144390075Sobrien  { "cc1_endian_default",	CC1_ENDIAN_DEFAULT_SPEC },		\
144490075Sobrien  { "cpp_endian_big",		CPP_ENDIAN_BIG_SPEC },			\
144590075Sobrien  { "cpp_endian_little",	CPP_ENDIAN_LITTLE_SPEC },		\
144690075Sobrien  { "cpp_float_default",	CPP_FLOAT_DEFAULT_SPEC },		\
144790075Sobrien  { "cpp_longdouble_default",	CPP_LONGDOUBLE_DEFAULT_SPEC },		\
144890075Sobrien  { "cpp_os_ads",		CPP_OS_ADS_SPEC },			\
144990075Sobrien  { "cpp_os_yellowknife",	CPP_OS_YELLOWKNIFE_SPEC },		\
145090075Sobrien  { "cpp_os_mvme",		CPP_OS_MVME_SPEC },			\
145190075Sobrien  { "cpp_os_sim",		CPP_OS_SIM_SPEC },			\
145290075Sobrien  { "cpp_os_freebsd",		CPP_OS_FREEBSD_SPEC },			\
145396263Sobrien  { "cpp_os_gnu",		CPP_OS_GNU_SPEC },			\
145490075Sobrien  { "cpp_os_linux",		CPP_OS_LINUX_SPEC },			\
145590075Sobrien  { "cpp_os_netbsd",		CPP_OS_NETBSD_SPEC },			\
145690075Sobrien  { "cpp_os_vxworks",		CPP_OS_VXWORKS_SPEC },			\
1457110611Skan  { "cpp_os_rtems",		CPP_OS_RTEMS_SPEC },			\
145890075Sobrien  { "cpp_os_default",		CPP_OS_DEFAULT_SPEC },
145990075Sobrien
146090075Sobrien/* Define this macro as a C expression for the initializer of an
146190075Sobrien   array of string to tell the driver program which options are
146290075Sobrien   defaults for this target and thus do not need to be handled
146390075Sobrien   specially when using `MULTILIB_OPTIONS'.
146490075Sobrien
146590075Sobrien   Do not define this macro if `MULTILIB_OPTIONS' is not defined in
146690075Sobrien   the target makefile fragment or if none of the options listed in
146790075Sobrien   `MULTILIB_OPTIONS' are set by default.  *Note Target Fragment::.  */
146890075Sobrien
146990075Sobrien#define	MULTILIB_DEFAULTS { "mbig", "mcall-sysv" }
147090075Sobrien
147190075Sobrien/* Define this macro if the code for function profiling should come
147290075Sobrien   before the function prologue.  Normally, the profiling code comes
147390075Sobrien   after.  */
147490075Sobrien#define PROFILE_BEFORE_PROLOGUE 1
147590075Sobrien
147690075Sobrien/* Function name to call to do profiling.  */
147790075Sobrien#define RS6000_MCOUNT "_mcount"
147890075Sobrien
147990075Sobrien/* Define this macro (to a value of 1) if you want to support the
148090075Sobrien   Win32 style pragmas #pragma pack(push,<n>)' and #pragma
148190075Sobrien   pack(pop)'.  The pack(push,<n>) pragma specifies the maximum
148290075Sobrien   alignment (in bytes) of fields within a structure, in much the
148390075Sobrien   same way as the __aligned__' and __packed__' __attribute__'s
148490075Sobrien   do.  A pack value of zero resets the behaviour to the default.
148590075Sobrien   Successive invocations of this pragma cause the previous values to
148690075Sobrien   be stacked, so that invocations of #pragma pack(pop)' will return
148790075Sobrien   to the previous value.  */
148890075Sobrien
148990075Sobrien#define HANDLE_PRAGMA_PACK_PUSH_POP 1
149090075Sobrien
149190075Sobrien/* Define library calls for quad FP operations.  These are all part of the
149290075Sobrien   PowerPC 32bit ABI.  */
149390075Sobrien#define ADDTF3_LIBCALL "_q_add"
149490075Sobrien#define DIVTF3_LIBCALL "_q_div"
149590075Sobrien#define EXTENDDFTF2_LIBCALL "_q_dtoq"
149690075Sobrien#define EQTF2_LIBCALL "_q_feq"
149790075Sobrien#define GETF2_LIBCALL "_q_fge"
149890075Sobrien#define GTTF2_LIBCALL "_q_fgt"
149990075Sobrien#define LETF2_LIBCALL "_q_fle"
150090075Sobrien#define LTTF2_LIBCALL "_q_flt"
150190075Sobrien#define NETF2_LIBCALL "_q_fne"
150290075Sobrien#define FLOATSITF2_LIBCALL "_q_itoq"
150390075Sobrien#define MULTF3_LIBCALL "_q_mul"
150490075Sobrien#define NEGTF2_LIBCALL "_q_neg"
150590075Sobrien#define TRUNCTFDF2_LIBCALL "_q_qtod"
150690075Sobrien#define FIX_TRUNCTFSI2_LIBCALL "_q_qtoi"
150790075Sobrien#define TRUNCTFSF2_LIBCALL "_q_qtos"
150890075Sobrien#define FIXUNS_TRUNCTFSI2_LIBCALL "_q_qtou"
150990075Sobrien#define SQRTTF_LIBCALL "_q_sqrt"
151090075Sobrien#define EXTENDSFTF2_LIBCALL "_q_stoq"
151190075Sobrien#define SUBTF3_LIBCALL "_q_sub"
151290075Sobrien#define FLOATUNSSITF2_LIBCALL "_q_utoq"
151390075Sobrien
151490075Sobrien#define INIT_TARGET_OPTABS						\
151590075Sobrien  do {									\
151690075Sobrien    if (TARGET_HARD_FLOAT)						\
151790075Sobrien      {									\
151890075Sobrien	add_optab->handlers[(int) TFmode].libfunc			\
151990075Sobrien	  = init_one_libfunc (ADDTF3_LIBCALL);				\
152090075Sobrien	sub_optab->handlers[(int) TFmode].libfunc			\
152190075Sobrien	  = init_one_libfunc (SUBTF3_LIBCALL);				\
152290075Sobrien	neg_optab->handlers[(int) TFmode].libfunc			\
152390075Sobrien	  = init_one_libfunc (NEGTF2_LIBCALL);				\
152490075Sobrien	smul_optab->handlers[(int) TFmode].libfunc			\
152590075Sobrien	  = init_one_libfunc (MULTF3_LIBCALL);				\
152690075Sobrien	sdiv_optab->handlers[(int) TFmode].libfunc			\
152790075Sobrien	  = init_one_libfunc (DIVTF3_LIBCALL);				\
152890075Sobrien	eqtf2_libfunc = init_one_libfunc (EQTF2_LIBCALL);		\
152990075Sobrien	netf2_libfunc = init_one_libfunc (NETF2_LIBCALL);		\
153090075Sobrien	gttf2_libfunc = init_one_libfunc (GTTF2_LIBCALL);		\
153190075Sobrien	getf2_libfunc = init_one_libfunc (GETF2_LIBCALL);		\
153290075Sobrien	lttf2_libfunc = init_one_libfunc (LTTF2_LIBCALL);		\
153390075Sobrien	letf2_libfunc = init_one_libfunc (LETF2_LIBCALL);		\
153490075Sobrien	trunctfsf2_libfunc = init_one_libfunc (TRUNCTFSF2_LIBCALL);	\
153590075Sobrien	trunctfdf2_libfunc = init_one_libfunc (TRUNCTFDF2_LIBCALL);	\
153690075Sobrien	extendsftf2_libfunc = init_one_libfunc (EXTENDSFTF2_LIBCALL);	\
153790075Sobrien	extenddftf2_libfunc = init_one_libfunc (EXTENDDFTF2_LIBCALL);	\
153890075Sobrien	floatsitf_libfunc = init_one_libfunc (FLOATSITF2_LIBCALL);	\
153990075Sobrien	fixtfsi_libfunc = init_one_libfunc (FIX_TRUNCTFSI2_LIBCALL);	\
154090075Sobrien	fixunstfsi_libfunc						\
154190075Sobrien	  = init_one_libfunc (FIXUNS_TRUNCTFSI2_LIBCALL);		\
154290075Sobrien	if (TARGET_PPC_GPOPT || TARGET_POWER2) 				\
154390075Sobrien	  sqrt_optab->handlers[(int) TFmode].libfunc			\
154490075Sobrien	    = init_one_libfunc (SQRTTF_LIBCALL);			\
154590075Sobrien      }									\
154690075Sobrien  } while (0)
154790075Sobrien
154890075Sobrien/* Select a format to encode pointers in exception handling data.  CODE
154990075Sobrien   is 0 for data, 1 for code labels, 2 for function pointers.  GLOBAL is
155090075Sobrien   true if the symbol may be affected by dynamic relocations.  */
155190075Sobrien#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)			     \
155290075Sobrien  ((flag_pic || TARGET_RELOCATABLE)					     \
155390075Sobrien   ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
155490075Sobrien   : DW_EH_PE_absptr)
155590075Sobrien
155690075Sobrien#define TARGET_ASM_EXCEPTION_SECTION readonly_data_section
155790075Sobrien
155890075Sobrien#define DOUBLE_INT_ASM_OP "\t.quad\t"
155990075Sobrien
156090075Sobrien/* Generate entries in .fixup for relocatable addresses.  */
156190075Sobrien#define RELOCATABLE_NEEDS_FIXUP
1562