sysv4.h revision 146895
1101704Smjacob/* Target definitions for GNU compiler for PowerPC running System V.4
2101704Smjacob   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
3101704Smjacob   2004 Free Software Foundation, Inc.
4101704Smjacob   Contributed by Cygnus Support.
5101704Smjacob
6101704Smjacob   This file is part of GCC.
7101704Smjacob
8101704Smjacob   GCC is free software; you can redistribute it and/or modify it
9101704Smjacob   under the terms of the GNU General Public License as published
10101704Smjacob   by the Free Software Foundation; either version 2, or (at your
11101704Smjacob   option) any later version.
12101704Smjacob
13101704Smjacob   GCC is distributed in the hope that it will be useful, but WITHOUT
14101704Smjacob   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15101704Smjacob   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
16101704Smjacob   License for more details.
17101704Smjacob
18101704Smjacob   You should have received a copy of the GNU General Public License
19101704Smjacob   along with GCC; see the file COPYING.  If not, write to the
20101704Smjacob   Free Software Foundation, 59 Temple Place - Suite 330, Boston,
21101704Smjacob   MA 02111-1307, USA.  */
22101704Smjacob
23101704Smjacob/* Header files should be C++ aware in general.  */
24101704Smjacob#define NO_IMPLICIT_EXTERN_C
25101704Smjacob
26101704Smjacob/* Yes!  We are ELF.  */
27101704Smjacob#define	TARGET_OBJECT_FORMAT OBJECT_ELF
28101704Smjacob
29101704Smjacob/* Default ABI to compile code for.  */
30101704Smjacob#define DEFAULT_ABI rs6000_current_abi
31101704Smjacob
32101704Smjacob/* Default ABI to use.  */
33101704Smjacob#define RS6000_ABI_NAME "sysv"
34101704Smjacob
35101704Smjacob/* Override rs6000.h definition.  */
36101704Smjacob#undef	ASM_DEFAULT_SPEC
37101704Smjacob#define	ASM_DEFAULT_SPEC "-mppc"
38101704Smjacob
39101704Smjacob/* Small data support types.  */
40101704Smjacobenum rs6000_sdata_type {
41101704Smjacob  SDATA_NONE,			/* No small data support.  */
42101704Smjacob  SDATA_DATA,			/* Just put data in .sbss/.sdata, don't use relocs.  */
43101704Smjacob  SDATA_SYSV,			/* Use r13 to point to .sdata/.sbss.  */
44101704Smjacob  SDATA_EABI			/* Use r13 like above, r2 points to .sdata2/.sbss2.  */
45101704Smjacob};
46101704Smjacob
47101704Smjacobextern enum rs6000_sdata_type rs6000_sdata;
48101704Smjacob
49101704Smjacob/* V.4/eabi switches.  */
50101704Smjacob#define	MASK_NO_BITFIELD_TYPE	0x40000000	/* Set PCC_BITFIELD_TYPE_MATTERS to 0.  */
51101704Smjacob#define	MASK_STRICT_ALIGN	0x20000000	/* Set STRICT_ALIGNMENT to 1.  */
52101704Smjacob#define	MASK_RELOCATABLE	0x10000000	/* GOT pointers are PC relative.  */
53101704Smjacob#define	MASK_EABI		0x08000000	/* Adhere to eabi, not System V spec.  */
54101704Smjacob#define	MASK_LITTLE_ENDIAN	0x04000000	/* Target is little endian.  */
55101704Smjacob#define	MASK_REGNAMES		0x02000000	/* Use alternate register names.  */
56101704Smjacob#define	MASK_PROTOTYPE		0x01000000	/* Only prototyped fcns pass variable args.  */
57101704Smjacob#define MASK_NO_BITFIELD_WORD	0x00800000	/* Bitfields cannot cross word boundaries */
58101704Smjacob
59101704Smjacob#define	TARGET_NO_BITFIELD_TYPE	(target_flags & MASK_NO_BITFIELD_TYPE)
60101704Smjacob#define	TARGET_STRICT_ALIGN	(target_flags & MASK_STRICT_ALIGN)
61101704Smjacob#define	TARGET_RELOCATABLE	(target_flags & MASK_RELOCATABLE)
62101704Smjacob#define	TARGET_EABI		(target_flags & MASK_EABI)
63101704Smjacob#define	TARGET_LITTLE_ENDIAN	(target_flags & MASK_LITTLE_ENDIAN)
64101704Smjacob#define	TARGET_REGNAMES		(target_flags & MASK_REGNAMES)
65101704Smjacob#define	TARGET_PROTOTYPE	(target_flags & MASK_PROTOTYPE)
66101704Smjacob#define TARGET_NO_BITFIELD_WORD	(target_flags & MASK_NO_BITFIELD_WORD)
67101704Smjacob#define	TARGET_TOC		((target_flags & MASK_64BIT)		\
68101704Smjacob				 || ((target_flags & (MASK_RELOCATABLE	\
69101704Smjacob						      | MASK_MINIMAL_TOC)) \
70101704Smjacob				     && flag_pic > 1)			\
71101704Smjacob				 || DEFAULT_ABI == ABI_AIX)
72101704Smjacob
73101704Smjacob#define	TARGET_BITFIELD_TYPE	(! TARGET_NO_BITFIELD_TYPE)
74101704Smjacob#define	TARGET_BIG_ENDIAN	(! TARGET_LITTLE_ENDIAN)
75101704Smjacob#define	TARGET_NO_PROTOTYPE	(! TARGET_PROTOTYPE)
76101704Smjacob#define	TARGET_NO_TOC		(! TARGET_TOC)
77101704Smjacob#define	TARGET_NO_EABI		(! TARGET_EABI)
78101704Smjacob
79101704Smjacob/* Strings provided by SUBTARGET_OPTIONS */
80101704Smjacobextern const char *rs6000_abi_name;
81101704Smjacobextern const char *rs6000_sdata_name;
82101704Smjacobextern const char *rs6000_tls_size_string; /* For -mtls-size= */
83101704Smjacob
84101704Smjacob/* Override rs6000.h definition.  */
85101704Smjacob#undef	SUBTARGET_OPTIONS
86101704Smjacob#define	SUBTARGET_OPTIONS							\
87101704Smjacob  { "call-",  &rs6000_abi_name, N_("Select ABI calling convention"), 0},	\
88101704Smjacob  { "sdata=", &rs6000_sdata_name, N_("Select method for sdata handling"), 0},	\
89101704Smjacob  { "tls-size=", &rs6000_tls_size_string,					\
90101704Smjacob   N_("Specify bit size of immediate TLS offsets"), 0 }
91101704Smjacob
92101704Smjacob#define SDATA_DEFAULT_SIZE 8
93101704Smjacob
94101704Smjacob/* Note, V.4 no longer uses a normal TOC, so make -mfull-toc, be just
95101704Smjacob   the same as -mminimal-toc.  */
96101704Smjacob/* Override rs6000.h definition.  */
97101704Smjacob#undef	SUBTARGET_SWITCHES
98101704Smjacob#define SUBTARGET_SWITCHES						\
99101704Smjacob  { "bit-align",	-MASK_NO_BITFIELD_TYPE,				\
100101704Smjacob    N_("Align to the base type of the bit-field") },			\
101101704Smjacob  { "no-bit-align",	 MASK_NO_BITFIELD_TYPE,				\
102101704Smjacob    N_("Don't align to the base type of the bit-field") },		\
103101704Smjacob  { "strict-align",	 MASK_STRICT_ALIGN,				\
104101704Smjacob    N_("Don't assume that unaligned accesses are handled by the system") }, \
105101704Smjacob  { "no-strict-align",	-MASK_STRICT_ALIGN,				\
106101704Smjacob    N_("Assume that unaligned accesses are handled by the system") },	\
107101704Smjacob  { "relocatable",	 MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, \
108101704Smjacob    N_("Produce code relocatable at runtime") },			\
109101704Smjacob  { "no-relocatable",	-MASK_RELOCATABLE,				\
110101704Smjacob    N_("Don't produce code relocatable at runtime") },			\
111101704Smjacob  { "relocatable-lib",	 MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, \
112101704Smjacob    N_("Produce code relocatable at runtime") },			\
113101704Smjacob  { "no-relocatable-lib", -MASK_RELOCATABLE,				\
114101704Smjacob    N_("Don't produce code relocatable at runtime") },			\
115101704Smjacob  { "little-endian",	 MASK_LITTLE_ENDIAN,				\
116101704Smjacob    N_("Produce little endian code") },					\
117101704Smjacob  { "little",		 MASK_LITTLE_ENDIAN,				\
118101704Smjacob    N_("Produce little endian code") },					\
119101704Smjacob  { "big-endian",	-MASK_LITTLE_ENDIAN,				\
120101704Smjacob    N_("Produce big endian code") },					\
121101704Smjacob  { "big",		-MASK_LITTLE_ENDIAN,				\
122101704Smjacob    N_("Produce big endian code") },					\
123101704Smjacob  { "no-toc",		 0, N_("no description yet") },			\
124101704Smjacob  { "toc",		 MASK_MINIMAL_TOC, N_("no description yet") },	\
125101704Smjacob  { "full-toc",		 MASK_MINIMAL_TOC, N_("no description yet") },	\
126101704Smjacob  { "prototype",	 MASK_PROTOTYPE, N_("no description yet") },	\
127101704Smjacob  { "no-prototype",	-MASK_PROTOTYPE, N_("no description yet") },	\
128101704Smjacob  { "no-traceback",	 0, N_("no description yet") },			\
129101704Smjacob  { "eabi",		 MASK_EABI, N_("Use EABI") },			\
130101704Smjacob  { "no-eabi",		-MASK_EABI, N_("Don't use EABI") },		\
131101704Smjacob  { "bit-word",		-MASK_NO_BITFIELD_WORD, "" },			\
132101704Smjacob  { "no-bit-word",	 MASK_NO_BITFIELD_WORD,				\
133101704Smjacob    N_("Do not allow bit-fields to cross word boundaries") },		\
134101704Smjacob  { "regnames",		  MASK_REGNAMES,				\
135101704Smjacob    N_("Use alternate register names") },				\
136101704Smjacob  { "no-regnames",	 -MASK_REGNAMES,				\
137101704Smjacob    N_("Don't use alternate register names") },				\
138101704Smjacob  { "sdata",		 0, N_("no description yet") },			\
139101704Smjacob  { "no-sdata",		 0, N_("no description yet") },			\
140101704Smjacob  { "sim",		 0,						\
141101704Smjacob    N_("Link with libsim.a, libc.a and sim-crt0.o") },			\
142101704Smjacob  { "ads",		 0,						\
143101704Smjacob    N_("Link with libads.a, libc.a and crt0.o") },			\
144101704Smjacob  { "yellowknife",	 0,						\
145101704Smjacob    N_("Link with libyk.a, libc.a and crt0.o") },			\
146101704Smjacob  { "mvme",		 0,						\
147101704Smjacob    N_("Link with libmvme.a, libc.a and crt0.o") },			\
148101704Smjacob  { "emb",		 0,						\
149101704Smjacob    N_("Set the PPC_EMB bit in the ELF flags header") },		\
150101704Smjacob  { "windiss",           0, N_("Use the WindISS simulator") },          \
151101704Smjacob  { "shlib",		 0, N_("no description yet") },			\
152101704Smjacob  { "64",		 MASK_64BIT | MASK_POWERPC64 | MASK_POWERPC,	\
153101704Smjacob			 N_("Generate 64-bit code") },			\
154101704Smjacob  { "32",		 - (MASK_64BIT | MASK_POWERPC64),		\
155101704Smjacob			 N_("Generate 32-bit code") },			\
156101704Smjacob  EXTRA_SUBTARGET_SWITCHES						\
157101704Smjacob  { "newlib",		 0, N_("no description yet") },
158101704Smjacob
159101704Smjacob/* This is meant to be redefined in the host dependent files.  */
160101704Smjacob#define EXTRA_SUBTARGET_SWITCHES
161101704Smjacob
162101704Smjacob/* Sometimes certain combinations of command options do not make sense
163101704Smjacob   on a particular target machine.  You can define a macro
164101704Smjacob   `OVERRIDE_OPTIONS' to take account of this.  This macro, if
165101704Smjacob   defined, is executed once just after all the command options have
166101704Smjacob   been parsed.
167101704Smjacob
168101704Smjacob   The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to
169101704Smjacob   get control.  */
170101704Smjacob
171101704Smjacob#define SUBTARGET_OVERRIDE_OPTIONS					\
172101704Smjacobdo {									\
173101704Smjacob  if (!g_switch_set)							\
174101704Smjacob    g_switch_value = SDATA_DEFAULT_SIZE;				\
175101704Smjacob									\
176101704Smjacob  if (rs6000_abi_name == NULL)						\
177101704Smjacob    rs6000_abi_name = RS6000_ABI_NAME;					\
178101704Smjacob									\
179101704Smjacob  if (!strcmp (rs6000_abi_name, "sysv"))				\
180101704Smjacob    rs6000_current_abi = ABI_V4;					\
181101704Smjacob  else if (!strcmp (rs6000_abi_name, "sysv-noeabi"))			\
182101704Smjacob    {									\
183101704Smjacob      rs6000_current_abi = ABI_V4;					\
184101704Smjacob      target_flags &= ~ MASK_EABI;					\
185101704Smjacob    }									\
186101704Smjacob  else if (!strcmp (rs6000_abi_name, "sysv-eabi")			\
187101704Smjacob	   || !strcmp (rs6000_abi_name, "eabi"))			\
188101704Smjacob    {									\
189101704Smjacob      rs6000_current_abi = ABI_V4;					\
190101704Smjacob      target_flags |= MASK_EABI;					\
191101704Smjacob    }									\
192101704Smjacob  else if (!strcmp (rs6000_abi_name, "aixdesc"))			\
193101704Smjacob    rs6000_current_abi = ABI_AIX;					\
194101704Smjacob  else if (!strcmp (rs6000_abi_name, "freebsd"))			\
195101704Smjacob    rs6000_current_abi = ABI_V4;					\
196101704Smjacob  else if (!strcmp (rs6000_abi_name, "linux"))				\
197101704Smjacob    rs6000_current_abi = ABI_V4;					\
198101704Smjacob  else if (!strcmp (rs6000_abi_name, "gnu"))				\
199101704Smjacob    rs6000_current_abi = ABI_V4;					\
200101704Smjacob  else if (!strcmp (rs6000_abi_name, "netbsd"))				\
201101704Smjacob    rs6000_current_abi = ABI_V4;					\
202101704Smjacob  else if (!strcmp (rs6000_abi_name, "openbsd"))			\
203101704Smjacob    rs6000_current_abi = ABI_V4;					\
204101704Smjacob  else if (!strcmp (rs6000_abi_name, "i960-old"))			\
205101704Smjacob    {									\
206101704Smjacob      rs6000_current_abi = ABI_V4;					\
207101704Smjacob      target_flags |= (MASK_LITTLE_ENDIAN | MASK_EABI			\
208101704Smjacob		       | MASK_NO_BITFIELD_WORD);			\
209101704Smjacob      target_flags &= ~MASK_STRICT_ALIGN;				\
210101704Smjacob    }									\
211101704Smjacob  else									\
212101704Smjacob    {									\
213101704Smjacob      rs6000_current_abi = ABI_V4;					\
214101704Smjacob      error ("bad value for -mcall-%s", rs6000_abi_name);		\
215101704Smjacob    }									\
216101704Smjacob									\
217101704Smjacob  if (rs6000_sdata_name)						\
218101704Smjacob    {									\
219101704Smjacob      if (!strcmp (rs6000_sdata_name, "none"))				\
220101704Smjacob	rs6000_sdata = SDATA_NONE;					\
221101704Smjacob      else if (!strcmp (rs6000_sdata_name, "data"))			\
222101704Smjacob	rs6000_sdata = SDATA_DATA;					\
223101704Smjacob      else if (!strcmp (rs6000_sdata_name, "default"))			\
224101704Smjacob	rs6000_sdata = (TARGET_EABI) ? SDATA_EABI : SDATA_SYSV;		\
225101704Smjacob      else if (!strcmp (rs6000_sdata_name, "sysv"))			\
226101704Smjacob	rs6000_sdata = SDATA_SYSV;					\
227101704Smjacob      else if (!strcmp (rs6000_sdata_name, "eabi"))			\
228101704Smjacob	rs6000_sdata = SDATA_EABI;					\
229101704Smjacob      else								\
230101704Smjacob	error ("bad value for -msdata=%s", rs6000_sdata_name);		\
231101704Smjacob    }									\
232101704Smjacob  else if (DEFAULT_ABI == ABI_V4)					\
233101704Smjacob    {									\
234101704Smjacob      rs6000_sdata = SDATA_DATA;					\
235101704Smjacob      rs6000_sdata_name = "data";					\
236101704Smjacob    }									\
237101704Smjacob  else									\
238101704Smjacob    {									\
239101704Smjacob      rs6000_sdata = SDATA_NONE;					\
240101704Smjacob      rs6000_sdata_name = "none";					\
241101704Smjacob    }									\
242101704Smjacob									\
243101704Smjacob  if (TARGET_RELOCATABLE &&						\
244101704Smjacob      (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV))	\
245101704Smjacob    {									\
246101704Smjacob      rs6000_sdata = SDATA_DATA;					\
247101704Smjacob      error ("-mrelocatable and -msdata=%s are incompatible",		\
248101704Smjacob	     rs6000_sdata_name);					\
249101704Smjacob    }									\
250101704Smjacob									\
251101704Smjacob  else if (flag_pic && DEFAULT_ABI != ABI_AIX				\
252101704Smjacob	   && (rs6000_sdata == SDATA_EABI				\
253101704Smjacob	       || rs6000_sdata == SDATA_SYSV))				\
254101704Smjacob    {									\
255101704Smjacob      rs6000_sdata = SDATA_DATA;					\
256101704Smjacob      error ("-f%s and -msdata=%s are incompatible",			\
257101704Smjacob	     (flag_pic > 1) ? "PIC" : "pic",				\
258101704Smjacob	     rs6000_sdata_name);					\
259101704Smjacob    }									\
260101704Smjacob									\
261101704Smjacob  if ((rs6000_sdata != SDATA_NONE && DEFAULT_ABI != ABI_V4)		\
262101704Smjacob      || (rs6000_sdata == SDATA_EABI && !TARGET_EABI))			\
263101704Smjacob    {									\
264101704Smjacob      rs6000_sdata = SDATA_NONE;					\
265101704Smjacob      error ("-msdata=%s and -mcall-%s are incompatible",		\
266101704Smjacob	     rs6000_sdata_name, rs6000_abi_name);			\
267101704Smjacob    }									\
268101704Smjacob									\
269101704Smjacob  targetm.have_srodata_section = rs6000_sdata == SDATA_EABI;		\
270101704Smjacob									\
271101704Smjacob  if (TARGET_RELOCATABLE && !TARGET_MINIMAL_TOC)			\
272101704Smjacob    {									\
273101704Smjacob      target_flags |= MASK_MINIMAL_TOC;					\
274101704Smjacob      error ("-mrelocatable and -mno-minimal-toc are incompatible");	\
275101704Smjacob    }									\
276101704Smjacob									\
277101704Smjacob  if (TARGET_RELOCATABLE && rs6000_current_abi == ABI_AIX)		\
278101704Smjacob    {									\
279101704Smjacob      target_flags &= ~MASK_RELOCATABLE;				\
280101704Smjacob      error ("-mrelocatable and -mcall-%s are incompatible",		\
281101704Smjacob	     rs6000_abi_name);						\
282101704Smjacob    }									\
283101704Smjacob									\
284101704Smjacob  if (!TARGET_64BIT && flag_pic > 1 && rs6000_current_abi == ABI_AIX)	\
285101704Smjacob    {									\
286101704Smjacob      flag_pic = 0;							\
287101704Smjacob      error ("-fPIC and -mcall-%s are incompatible",			\
288101704Smjacob	     rs6000_abi_name);						\
289101704Smjacob    }									\
290101704Smjacob									\
291101704Smjacob  if (rs6000_current_abi == ABI_AIX && TARGET_LITTLE_ENDIAN)		\
292101704Smjacob    {									\
293101704Smjacob      target_flags &= ~MASK_LITTLE_ENDIAN;				\
294101704Smjacob      error ("-mcall-aixdesc must be big endian");			\
295101704Smjacob    }									\
296101704Smjacob									\
297101704Smjacob  /* Treat -fPIC the same as -mrelocatable.  */				\
298101704Smjacob  if (flag_pic > 1 && DEFAULT_ABI != ABI_AIX)				\
299101704Smjacob    target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC; \
300101704Smjacob									\
301101704Smjacob  else if (TARGET_RELOCATABLE)						\
302101704Smjacob    flag_pic = 2;							\
303101704Smjacob} while (0)
304101704Smjacob
305101704Smjacob#ifndef RS6000_BI_ARCH
306101704Smjacob# define SUBSUBTARGET_OVERRIDE_OPTIONS					\
307101704Smjacobdo {									\
308101704Smjacob  if ((TARGET_DEFAULT ^ target_flags) & MASK_64BIT)			\
309101704Smjacob    error ("-m%s not supported in this configuration",			\
310101704Smjacob	   (target_flags & MASK_64BIT) ? "64" : "32");			\
311101704Smjacob} while (0)
312101704Smjacob#endif
313101704Smjacob
314101704Smjacob/* Override rs6000.h definition.  */
315101704Smjacob#undef	TARGET_DEFAULT
316101704Smjacob#define	TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS)
317101704Smjacob
318101704Smjacob/* Override rs6000.h definition.  */
319101704Smjacob#undef	PROCESSOR_DEFAULT
320101704Smjacob#define	PROCESSOR_DEFAULT PROCESSOR_PPC750
321101704Smjacob
322101704Smjacob#define FIXED_R2 1
323101704Smjacob/* System V.4 uses register 13 as a pointer to the small data area,
324101704Smjacob   so it is not available to the normal user.  */
325101704Smjacob#define FIXED_R13 1
326101704Smjacob
327101704Smjacob/* Size of the V.4 varargs area if needed.  */
328101704Smjacob/* Override rs6000.h definition.  */
329101704Smjacob#undef	RS6000_VARARGS_AREA
330101704Smjacob#define RS6000_VARARGS_AREA ((cfun->machine->sysv_varargs_p) ? RS6000_VARARGS_SIZE : 0)
331101704Smjacob
332101704Smjacob/* Override default big endianism definitions in rs6000.h.  */
333101704Smjacob#undef	BYTES_BIG_ENDIAN
334101704Smjacob#undef	WORDS_BIG_ENDIAN
335101704Smjacob#define	BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN)
336101704Smjacob#define	WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN)
337101704Smjacob
338101704Smjacob/* Define this to set the endianness to use in libgcc2.c, which can
339101704Smjacob   not depend on target_flags.  */
340101704Smjacob#if !defined(__LITTLE_ENDIAN__) && !defined(__sun__)
341101704Smjacob#define LIBGCC2_WORDS_BIG_ENDIAN 1
342101704Smjacob#else
343101704Smjacob#define LIBGCC2_WORDS_BIG_ENDIAN 0
344101704Smjacob#endif
345101704Smjacob
346101704Smjacob/* Define cutoff for using external functions to save floating point.
347101704Smjacob   Currently on V.4, always use inline stores.  */
348101704Smjacob#define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 64)
349101704Smjacob
350101704Smjacob/* Put jump tables in read-only memory, rather than in .text.  */
351101704Smjacob#define JUMP_TABLES_IN_TEXT_SECTION 0
352101704Smjacob
353101704Smjacob/* Prefix and suffix to use to saving floating point.  */
354101704Smjacob#define	SAVE_FP_PREFIX "_savefpr_"
355101704Smjacob#define SAVE_FP_SUFFIX "_l"
356101704Smjacob
357101704Smjacob/* Prefix and suffix to use to restoring floating point.  */
358101704Smjacob#define	RESTORE_FP_PREFIX "_restfpr_"
359101704Smjacob#define RESTORE_FP_SUFFIX "_l"
360101704Smjacob
361101704Smjacob/* Type used for ptrdiff_t, as a string used in a declaration.  */
362101704Smjacob#define PTRDIFF_TYPE "int"
363101704Smjacob
364101704Smjacob/* Type used for wchar_t, as a string used in a declaration.  */
365101704Smjacob/* Override svr4.h definition.  */
366101704Smjacob#undef	WCHAR_TYPE
367101704Smjacob#define WCHAR_TYPE "long int"
368101704Smjacob
369101704Smjacob/* Width of wchar_t in bits.  */
370101704Smjacob/* Override svr4.h definition.  */
371101704Smjacob#undef	WCHAR_TYPE_SIZE
372101704Smjacob#define WCHAR_TYPE_SIZE 32
373101704Smjacob
374101704Smjacob/* Make int foo : 8 not cause structures to be aligned to an int boundary.  */
375101704Smjacob/* Override elfos.h definition.  */
376101704Smjacob#undef	PCC_BITFIELD_TYPE_MATTERS
377101704Smjacob#define	PCC_BITFIELD_TYPE_MATTERS (TARGET_BITFIELD_TYPE)
378101704Smjacob
379101704Smjacob#undef	BITFIELD_NBYTES_LIMITED
380101704Smjacob#define	BITFIELD_NBYTES_LIMITED (TARGET_NO_BITFIELD_WORD)
381101704Smjacob
382101704Smjacob/* Define this macro to be the value 1 if instructions will fail to
383101704Smjacob   work if given data not on the nominal alignment.  If instructions
384101704Smjacob   will merely go slower in that case, define this macro as 0.  */
385101704Smjacob#undef	STRICT_ALIGNMENT
386101704Smjacob#define	STRICT_ALIGNMENT (TARGET_STRICT_ALIGN)
387101704Smjacob
388101704Smjacob/* Define this macro if you wish to preserve a certain alignment for
389101704Smjacob   the stack pointer, greater than what the hardware enforces.  The
390101704Smjacob   definition is a C expression for the desired alignment (measured
391101704Smjacob   in bits).  This macro must evaluate to a value equal to or larger
392101704Smjacob   than STACK_BOUNDARY.
393101704Smjacob   For the SYSV ABI and variants the alignment of the stack pointer
394101704Smjacob   is usually controlled manually in rs6000.c. However, to maintain
395101704Smjacob   alignment across alloca () in all circumstances,
396101704Smjacob   PREFERRED_STACK_BOUNDARY needs to be set as well.
397101704Smjacob   This has the additional advantage of allowing a bigger maximum
398101704Smjacob   alignment of user objects on the stack.  */
399101704Smjacob
400101704Smjacob#undef PREFERRED_STACK_BOUNDARY
401101704Smjacob#define PREFERRED_STACK_BOUNDARY 128
402101704Smjacob
403101704Smjacob/* Real stack boundary as mandated by the appropriate ABI.  */
404101704Smjacob#define ABI_STACK_BOUNDARY \
405101704Smjacob  ((TARGET_EABI && !TARGET_ALTIVEC && !TARGET_ALTIVEC_ABI) ? 64 : 128)
406101704Smjacob
407101704Smjacob/* An expression for the alignment of a structure field FIELD if the
408101704Smjacob   alignment computed in the usual way is COMPUTED.  */
409101704Smjacob#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED)				      \
410101704Smjacob	((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)     \
411101704Smjacob	 ? 128 : COMPUTED)
412101704Smjacob
413101704Smjacob/* Define this macro as an expression for the alignment of a type
414101704Smjacob   (given by TYPE as a tree node) if the alignment computed in the
415101704Smjacob   usual way is COMPUTED and the alignment explicitly specified was
416101704Smjacob   SPECIFIED.  */
417101704Smjacob#define ROUND_TYPE_ALIGN(TYPE, COMPUTED, SPECIFIED)			\
418101704Smjacob	((TARGET_ALTIVEC  && TREE_CODE (TYPE) == VECTOR_TYPE)	        \
419101704Smjacob	 ? MAX (MAX ((COMPUTED), (SPECIFIED)), 128)                     \
420101704Smjacob         : MAX (COMPUTED, SPECIFIED))
421101704Smjacob
422101704Smjacob#undef  BIGGEST_FIELD_ALIGNMENT
423101704Smjacob
424101704Smjacob/* Use ELF style section commands.  */
425101704Smjacob
426101704Smjacob#define	TEXT_SECTION_ASM_OP	"\t.section\t\".text\""
427101704Smjacob
428101704Smjacob#define	DATA_SECTION_ASM_OP	"\t.section\t\".data\""
429101704Smjacob
430101704Smjacob#define	BSS_SECTION_ASM_OP	"\t.section\t\".bss\""
431101704Smjacob
432101704Smjacob/* Override elfos.h definition.  */
433101704Smjacob#undef	INIT_SECTION_ASM_OP
434101704Smjacob#define	INIT_SECTION_ASM_OP "\t.section\t\".init\",\"ax\""
435101704Smjacob
436101704Smjacob/* Override elfos.h definition.  */
437101704Smjacob#undef	FINI_SECTION_ASM_OP
438101704Smjacob#define	FINI_SECTION_ASM_OP "\t.section\t\".fini\",\"ax\""
439101704Smjacob
440101704Smjacob#define	TOC_SECTION_ASM_OP "\t.section\t\".got\",\"aw\""
441101704Smjacob
442101704Smjacob/* Put PC relative got entries in .got2.  */
443101704Smjacob#define	MINIMAL_TOC_SECTION_ASM_OP \
444101704Smjacob  (TARGET_RELOCATABLE || (flag_pic && DEFAULT_ABI != ABI_AIX)		\
445101704Smjacob   ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"")
446101704Smjacob
447101704Smjacob#define	SDATA_SECTION_ASM_OP "\t.section\t\".sdata\",\"aw\""
448101704Smjacob#define	SDATA2_SECTION_ASM_OP "\t.section\t\".sdata2\",\"a\""
449101704Smjacob#define	SBSS_SECTION_ASM_OP "\t.section\t\".sbss\",\"aw\",@nobits"
450101704Smjacob
451101704Smjacob/* Besides the usual ELF sections, we need a toc section.  */
452101704Smjacob/* Override elfos.h definition.  */
453101704Smjacob#undef	EXTRA_SECTIONS
454101704Smjacob#define	EXTRA_SECTIONS in_toc, in_sdata, in_sdata2, in_sbss, in_init, in_fini
455101704Smjacob
456101704Smjacob/* Override elfos.h definition.  */
457101704Smjacob#undef	EXTRA_SECTION_FUNCTIONS
458101704Smjacob#define	EXTRA_SECTION_FUNCTIONS						\
459101704Smjacob  TOC_SECTION_FUNCTION							\
460101704Smjacob  SDATA_SECTION_FUNCTION						\
461101704Smjacob  SDATA2_SECTION_FUNCTION						\
462101704Smjacob  SBSS_SECTION_FUNCTION							\
463101704Smjacob  INIT_SECTION_FUNCTION							\
464101704Smjacob  FINI_SECTION_FUNCTION
465101704Smjacob
466101704Smjacob#define	TOC_SECTION_FUNCTION						\
467101704Smjacobvoid									\
468101704Smjacobtoc_section (void)							\
469101704Smjacob{									\
470101704Smjacob  if (in_section != in_toc)						\
471101704Smjacob    {									\
472101704Smjacob      in_section = in_toc;						\
473101704Smjacob      if (DEFAULT_ABI == ABI_AIX					\
474101704Smjacob	  && TARGET_MINIMAL_TOC						\
475101704Smjacob	  && !TARGET_RELOCATABLE)					\
476101704Smjacob	{								\
477101704Smjacob	  if (! toc_initialized)					\
478101704Smjacob	    {								\
479101704Smjacob	      toc_initialized = 1;					\
480101704Smjacob	      fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP);	\
481101704Smjacob	      (*targetm.asm_out.internal_label) (asm_out_file, "LCTOC", 0); \
482101704Smjacob	      fprintf (asm_out_file, "\t.tc ");				\
483101704Smjacob	      ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1[TC],"); \
484101704Smjacob	      ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
485101704Smjacob	      fprintf (asm_out_file, "\n");				\
486101704Smjacob									\
487101704Smjacob	      fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
488101704Smjacob	      ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
489101704Smjacob	      fprintf (asm_out_file, " = .+32768\n");			\
490101704Smjacob	    }								\
491101704Smjacob	  else								\
492101704Smjacob	    fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);	\
493101704Smjacob	}								\
494101704Smjacob      else if (DEFAULT_ABI == ABI_AIX && !TARGET_RELOCATABLE)		\
495101704Smjacob	fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP);		\
496101704Smjacob      else								\
497101704Smjacob	{								\
498101704Smjacob	  fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);	\
499101704Smjacob	  if (! toc_initialized)					\
500101704Smjacob	    {								\
501101704Smjacob	      ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
502101704Smjacob	      fprintf (asm_out_file, " = .+32768\n");			\
503101704Smjacob	      toc_initialized = 1;					\
504101704Smjacob	    }								\
505101704Smjacob	}								\
506101704Smjacob    }									\
507101704Smjacob}									\
508101704Smjacob									\
509101704Smjacobextern int in_toc_section (void);					\
510101704Smjacobint in_toc_section (void)						\
511101704Smjacob{									\
512101704Smjacob  return in_section == in_toc;						\
513101704Smjacob}
514101704Smjacob
515101704Smjacob#define	SDATA_SECTION_FUNCTION						\
516101704Smjacobvoid									\
517101704Smjacobsdata_section (void)							\
518101704Smjacob{									\
519101704Smjacob  if (in_section != in_sdata)						\
520101704Smjacob    {									\
521101704Smjacob      in_section = in_sdata;						\
522101704Smjacob      fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP);		\
523101704Smjacob    }									\
524101704Smjacob}
525101704Smjacob
526101704Smjacob#define	SDATA2_SECTION_FUNCTION						\
527101704Smjacobvoid									\
528101704Smjacobsdata2_section (void)							\
529101704Smjacob{									\
530101704Smjacob  if (in_section != in_sdata2)						\
531101704Smjacob    {									\
532101704Smjacob      in_section = in_sdata2;						\
533101704Smjacob      fprintf (asm_out_file, "%s\n", SDATA2_SECTION_ASM_OP);		\
534101704Smjacob    }									\
535101704Smjacob}
536101704Smjacob
537101704Smjacob#define	SBSS_SECTION_FUNCTION						\
538101704Smjacobvoid									\
539101704Smjacobsbss_section (void)							\
540101704Smjacob{									\
541101704Smjacob  if (in_section != in_sbss)						\
542101704Smjacob    {									\
543101704Smjacob      in_section = in_sbss;						\
544101704Smjacob      fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP);		\
545101704Smjacob    }									\
546101704Smjacob}
547101704Smjacob
548101704Smjacob#define	INIT_SECTION_FUNCTION						\
549101704Smjacobvoid									\
550101704Smjacobinit_section (void)							\
551101704Smjacob{									\
552101704Smjacob  if (in_section != in_init)						\
553101704Smjacob    {									\
554101704Smjacob      in_section = in_init;						\
555101704Smjacob      fprintf (asm_out_file, "%s\n", INIT_SECTION_ASM_OP);		\
556101704Smjacob    }									\
557101704Smjacob}
558101704Smjacob
559101704Smjacob#define	FINI_SECTION_FUNCTION						\
560101704Smjacobvoid									\
561101704Smjacobfini_section (void)							\
562101704Smjacob{									\
563101704Smjacob  if (in_section != in_fini)						\
564101704Smjacob    {									\
565101704Smjacob      in_section = in_fini;						\
566101704Smjacob      fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP);		\
567101704Smjacob    }									\
568101704Smjacob}
569101704Smjacob
570101704Smjacob/* Override default elf definitions.  */
571101704Smjacob#undef	TARGET_ASM_SELECT_RTX_SECTION
572101704Smjacob#define	TARGET_ASM_SELECT_RTX_SECTION rs6000_elf_select_rtx_section
573101704Smjacob#undef	TARGET_ASM_SELECT_SECTION
574101704Smjacob#define	TARGET_ASM_SELECT_SECTION  rs6000_elf_select_section
575101704Smjacob#define TARGET_ASM_UNIQUE_SECTION  rs6000_elf_unique_section
576101704Smjacob
577101704Smjacob/* Return nonzero if this entry is to be written into the constant pool
578101704Smjacob   in a special way.  We do so if this is a SYMBOL_REF, LABEL_REF or a CONST
579101704Smjacob   containing one of them.  If -mfp-in-toc (the default), we also do
580101704Smjacob   this for floating-point constants.  We actually can only do this
581101704Smjacob   if the FP formats of the target and host machines are the same, but
582101704Smjacob   we can't check that since not every file that uses
583101704Smjacob   GO_IF_LEGITIMATE_ADDRESS_P includes real.h.
584101704Smjacob
585101704Smjacob   Unlike AIX, we don't key off of -mminimal-toc, but instead do not
586101704Smjacob   allow floating point constants in the TOC if -mrelocatable.  */
587101704Smjacob
588101704Smjacob#undef	ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
589101704Smjacob#define	ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE)			\
590101704Smjacob  (TARGET_TOC								\
591101704Smjacob   && (GET_CODE (X) == SYMBOL_REF					\
592101704Smjacob       || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS	\
593101704Smjacob	   && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF)		\
594101704Smjacob       || GET_CODE (X) == LABEL_REF					\
595101704Smjacob       || (GET_CODE (X) == CONST_INT 					\
596101704Smjacob	   && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode))	\
597101704Smjacob       || (!TARGET_NO_FP_IN_TOC						\
598101704Smjacob	   && !TARGET_RELOCATABLE					\
599101704Smjacob	   && GET_CODE (X) == CONST_DOUBLE				\
600101704Smjacob	   && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT		\
601101704Smjacob	   && BITS_PER_WORD == HOST_BITS_PER_INT)))
602101704Smjacob
603101704Smjacob/* These macros generate the special .type and .size directives which
604101704Smjacob   are used to set the corresponding fields of the linker symbol table
605101704Smjacob   entries in an ELF object file under SVR4.  These macros also output
606101704Smjacob   the starting labels for the relevant functions/objects.  */
607101704Smjacob
608101704Smjacob/* Write the extra assembler code needed to declare a function properly.
609101704Smjacob   Some svr4 assemblers need to also have something extra said about the
610101704Smjacob   function's return value.  We allow for that here.  */
611101704Smjacob
612101704Smjacobextern int rs6000_pic_labelno;
613101704Smjacob
614101704Smjacob/* Override elfos.h definition.  */
615101704Smjacob#undef	ASM_DECLARE_FUNCTION_NAME
616101704Smjacob#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)			\
617101704Smjacob  rs6000_elf_declare_function_name ((FILE), (NAME), (DECL))
618101704Smjacob
619101704Smjacob/* The USER_LABEL_PREFIX stuff is affected by the -fleading-underscore
620101704Smjacob   flag.  The LOCAL_LABEL_PREFIX variable is used by dbxelf.h.  */
621101704Smjacob
622101704Smjacob#define	LOCAL_LABEL_PREFIX "."
623101704Smjacob#define	USER_LABEL_PREFIX ""
624101704Smjacob
625101704Smjacob/* svr4.h overrides (*targetm.asm_out.internal_label).  */
626101704Smjacob
627101704Smjacob#define	ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX)	\
628101704Smjacob  asm_fprintf (FILE, "%L%s", PREFIX)
629101704Smjacob
630101704Smjacob/* Globalizing directive for a label.  */
631101704Smjacob#define GLOBAL_ASM_OP "\t.globl "
632101704Smjacob
633101704Smjacob/* This says how to output assembler code to declare an
634101704Smjacob   uninitialized internal linkage data object.  Under SVR4,
635101704Smjacob   the linker seems to want the alignment of data objects
636101704Smjacob   to depend on their types.  We do exactly that here.  */
637101704Smjacob
638101704Smjacob#define	LOCAL_ASM_OP	"\t.local\t"
639101704Smjacob
640101704Smjacob#define	LCOMM_ASM_OP	"\t.lcomm\t"
641101704Smjacob
642101704Smjacob/* Override elfos.h definition.  */
643101704Smjacob#undef	ASM_OUTPUT_ALIGNED_LOCAL
644101704Smjacob#define	ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN)		\
645101704Smjacobdo {									\
646101704Smjacob  if (rs6000_sdata != SDATA_NONE && (SIZE) > 0				\
647101704Smjacob      && (SIZE) <= g_switch_value)					\
648101704Smjacob    {									\
649101704Smjacob      sbss_section ();							\
650101704Smjacob      ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT));	\
651101704Smjacob      ASM_OUTPUT_LABEL (FILE, NAME);					\
652101704Smjacob      ASM_OUTPUT_SKIP (FILE, SIZE);					\
653101704Smjacob      if (!flag_inhibit_size_directive && (SIZE) > 0)			\
654101704Smjacob	ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, SIZE);			\
655101704Smjacob    }									\
656101704Smjacob  else									\
657101704Smjacob    {									\
658101704Smjacob      fprintf (FILE, "%s", LCOMM_ASM_OP);				\
659101704Smjacob      assemble_name ((FILE), (NAME));					\
660101704Smjacob      fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n",		\
661101704Smjacob	       (SIZE), (ALIGN) / BITS_PER_UNIT);			\
662101704Smjacob    }									\
663101704Smjacob  ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object");			\
664101704Smjacob} while (0)
665101704Smjacob
666101704Smjacob/* Describe how to emit uninitialized external linkage items.  */
667101704Smjacob#define	ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN)		\
668101704Smjacobdo {									\
669101704Smjacob  ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN);			\
670101704Smjacob} while (0)
671101704Smjacob
672101704Smjacob#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
673101704Smjacob/* To support -falign-* switches we need to use .p2align so
674101704Smjacob   that alignment directives in code sections will be padded
675101704Smjacob   with no-op instructions, rather than zeroes.  */
676101704Smjacob#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)			\
677101704Smjacob  if ((LOG) != 0)							\
678101704Smjacob    {									\
679101704Smjacob      if ((MAX_SKIP) == 0)						\
680101704Smjacob	fprintf ((FILE), "\t.p2align %d\n", (LOG));			\
681101704Smjacob      else								\
682101704Smjacob	fprintf ((FILE), "\t.p2align %d,,%d\n",	(LOG), (MAX_SKIP));	\
683101704Smjacob    }
684101704Smjacob#endif
685101704Smjacob
686101704Smjacob/* This is how to output code to push a register on the stack.
687101704Smjacob   It need not be very fast code.
688101704Smjacob
689101704Smjacob   On the rs6000, we must keep the backchain up to date.  In order
690101704Smjacob   to simplify things, always allocate 16 bytes for a push (System V
691101704Smjacob   wants to keep stack aligned to a 16 byte boundary).  */
692101704Smjacob
693101704Smjacob#define	ASM_OUTPUT_REG_PUSH(FILE, REGNO)				\
694101704Smjacobdo {									\
695  if (DEFAULT_ABI == ABI_V4)						\
696    asm_fprintf (FILE,							\
697		 "\t{stu|stwu} %s,-16(%s)\n\t{st|stw} %s,12(%s)\n",	\
698		 reg_names[1], reg_names[1], reg_names[REGNO],		\
699		 reg_names[1]);						\
700} while (0)
701
702/* This is how to output an insn to pop a register from the stack.
703   It need not be very fast code.  */
704
705#define	ASM_OUTPUT_REG_POP(FILE, REGNO)					\
706do {									\
707  if (DEFAULT_ABI == ABI_V4)						\
708    asm_fprintf (FILE,							\
709		 "\t{l|lwz} %s,12(%s)\n\t{ai|addic} %s,%s,16\n",	\
710		 reg_names[REGNO], reg_names[1], reg_names[1],		\
711		 reg_names[1]);						\
712} while (0)
713
714/* Switch  Recognition by gcc.c.  Add -G xx support.  */
715
716/* Override svr4.h definition.  */
717#undef	SWITCH_TAKES_ARG
718#define	SWITCH_TAKES_ARG(CHAR)						\
719  ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o'			\
720   || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u'			\
721   || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x'			\
722   || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V'			\
723   || (CHAR) == 'B' || (CHAR) == 'b' || (CHAR) == 'G')
724
725extern int fixuplabelno;
726
727/* Handle constructors specially for -mrelocatable.  */
728#define TARGET_ASM_CONSTRUCTOR  rs6000_elf_asm_out_constructor
729#define TARGET_ASM_DESTRUCTOR   rs6000_elf_asm_out_destructor
730
731/* This is the end of what might become sysv4.h.  */
732
733/* Use DWARF 2 debugging information by default.  */
734#undef  PREFERRED_DEBUGGING_TYPE
735#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
736
737/* Historically we have also supported stabs debugging.  */
738#define DBX_DEBUGGING_INFO 1
739
740#define DBX_REGISTER_NUMBER(REGNO) rs6000_dbx_register_number (REGNO)
741
742/* Map register numbers held in the call frame info that gcc has
743   collected using DWARF_FRAME_REGNUM to those that should be output in
744   .debug_frame and .eh_frame.  We continue to use gcc hard reg numbers
745   for .eh_frame, but use the numbers mandated by the various ABIs for
746   .debug_frame.  rs6000_emit_prologue has translated any combination of
747   CR2, CR3, CR4 saves to a save of CR2.  The actual code emitted saves
748   the whole of CR, so we map CR2_REGNO to the DWARF reg for CR.  */
749#define DWARF2_FRAME_REG_OUT(REGNO, FOR_EH)	\
750  ((FOR_EH) ? (REGNO)				\
751   : (REGNO) == CR2_REGNO ? 64			\
752   : DBX_REGISTER_NUMBER (REGNO))
753
754#define TARGET_ENCODE_SECTION_INFO  rs6000_elf_encode_section_info
755#define TARGET_IN_SMALL_DATA_P  rs6000_elf_in_small_data_p
756#define TARGET_SECTION_TYPE_FLAGS  rs6000_elf_section_type_flags
757
758/* The ELF version doesn't encode [DS] or whatever at the end of symbols.  */
759
760#define	RS6000_OUTPUT_BASENAME(FILE, NAME)	\
761    assemble_name (FILE, NAME)
762
763/* We have to output the stabs for the function name *first*, before
764   outputting its label.  */
765
766#define	DBX_FUNCTION_FIRST
767
768/* This is the end of what might become sysv4dbx.h.  */
769
770#ifndef	TARGET_VERSION
771#define	TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)");
772#endif
773
774#define TARGET_OS_SYSV_CPP_BUILTINS()	  \
775  do                                      \
776    {                                     \
777      if (flag_pic == 1)		  \
778        {				  \
779	  builtin_define ("__pic__=1");	  \
780	  builtin_define ("__PIC__=1");	  \
781        }				  \
782      else if (flag_pic == 2)		  \
783        {				  \
784	  builtin_define ("__pic__=2");	  \
785	  builtin_define ("__PIC__=2");	  \
786        }				  \
787      if (target_flags_explicit		  \
788	  & MASK_RELOCATABLE)		  \
789	builtin_define ("_RELOCATABLE");  \
790    }                                     \
791  while (0)
792
793#ifndef	TARGET_OS_CPP_BUILTINS
794#define TARGET_OS_CPP_BUILTINS()          \
795  do                                      \
796    {                                     \
797      builtin_define_std ("PPC");         \
798      builtin_define_std ("unix");        \
799      builtin_define ("__svr4__");        \
800      builtin_assert ("system=unix");     \
801      builtin_assert ("system=svr4");     \
802      builtin_assert ("cpu=powerpc");     \
803      builtin_assert ("machine=powerpc"); \
804      TARGET_OS_SYSV_CPP_BUILTINS ();	  \
805    }                                     \
806  while (0)
807#endif
808
809/* Pass various options to the assembler.  */
810/* Override svr4.h definition.  */
811#undef	ASM_SPEC
812#define	ASM_SPEC "%(asm_cpu) \
813%{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \
814%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
815%{mrelocatable} %{mrelocatable-lib} %{fpic|fpie|fPIC|fPIE:-K PIC} \
816%{memb|msdata|msdata=eabi: -memb} \
817%{mlittle|mlittle-endian:-mlittle; \
818  mbig|mbig-endian      :-mbig;    \
819  mcall-aixdesc |		   \
820  mcall-freebsd |		   \
821  mcall-netbsd  |		   \
822  mcall-openbsd |		   \
823  mcall-linux   |		   \
824  mcall-gnu             :-mbig;    \
825  mcall-i960-old        :-mlittle}"
826
827#define	CC1_ENDIAN_BIG_SPEC ""
828
829#define	CC1_ENDIAN_LITTLE_SPEC "\
830%{!mstrict-align: %{!mno-strict-align: \
831    %{!mcall-i960-old: \
832	-mstrict-align \
833    } \
834}}"
835
836#define	CC1_ENDIAN_DEFAULT_SPEC "%(cc1_endian_big)"
837
838/* Pass -G xxx to the compiler and set correct endian mode.  */
839#define	CC1_SPEC "%{G*} \
840%{mlittle|mlittle-endian: %(cc1_endian_little);           \
841  mbig   |mbig-endian   : %(cc1_endian_big);              \
842  mcall-aixdesc |					  \
843  mcall-freebsd |					  \
844  mcall-netbsd  |					  \
845  mcall-openbsd |					  \
846  mcall-linux   |					  \
847  mcall-gnu             : -mbig %(cc1_endian_big);        \
848  mcall-i960-old        : -mlittle %(cc1_endian_little);  \
849                        : %(cc1_endian_default)}          \
850%{mno-sdata: -msdata=none } \
851%{meabi: %{!mcall-*: -mcall-sysv }} \
852%{!meabi: %{!mno-eabi: \
853    %{mrelocatable: -meabi } \
854    %{mcall-freebsd: -mno-eabi } \
855    %{mcall-i960-old: -meabi } \
856    %{mcall-linux: -mno-eabi } \
857    %{mcall-gnu: -mno-eabi } \
858    %{mcall-netbsd: -mno-eabi } \
859    %{mcall-openbsd: -mno-eabi }}} \
860%{msdata: -msdata=default} \
861%{mno-sdata: -msdata=none} \
862%{profile: -p}"
863
864/* Don't put -Y P,<path> for cross compilers.  */
865#ifndef CROSS_COMPILE
866#define LINK_PATH_SPEC "\
867%{!R*:%{L*:-R %*}} \
868%{!nostdlib: %{!YP,*: \
869    %{compat-bsd: \
870	%{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
871	%{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}} \
872	%{!R*: %{!L*: -R /usr/ucblib}} \
873    %{!compat-bsd: \
874	%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
875	%{!p:-Y P,/usr/ccs/lib:/usr/lib}}}}"
876
877#else
878#define LINK_PATH_SPEC ""
879#endif
880
881/* Default starting address if specified.  */
882#define LINK_START_SPEC "\
883%{mads         : %(link_start_ads)         ; \
884  myellowknife : %(link_start_yellowknife) ; \
885  mmvme        : %(link_start_mvme)        ; \
886  msim         : %(link_start_sim)         ; \
887  mwindiss     : %(link_start_windiss)     ; \
888  mcall-freebsd: %(link_start_freebsd)     ; \
889  mcall-linux  : %(link_start_linux)       ; \
890  mcall-gnu    : %(link_start_gnu)         ; \
891  mcall-netbsd : %(link_start_netbsd)      ; \
892  mcall-openbsd: %(link_start_openbsd)     ; \
893               : %(link_start_default)     }"
894
895#define LINK_START_DEFAULT_SPEC ""
896
897/* Override svr4.h definition.  */
898#undef	LINK_SPEC
899#define	LINK_SPEC "\
900%{h*} %{v:-V} %{!msdata=none:%{G*}} %{msdata=none:-G0} \
901%{YP,*} %{R*} \
902%{Qy:} %{!Qn:-Qy} \
903%(link_shlib) \
904%{!Wl,-T*: %{!T*: %(link_start) }} \
905%(link_target) \
906%(link_os)"
907
908/* For now, turn off shared libraries by default.  */
909#ifndef SHARED_LIB_SUPPORT
910#define NO_SHARED_LIB_SUPPORT
911#endif
912
913#ifndef NO_SHARED_LIB_SUPPORT
914/* Shared libraries are default.  */
915#define LINK_SHLIB_SPEC "\
916%{!static: %(link_path) %{!R*:%{L*:-R %*}}} \
917%{mshlib: } \
918%{static:-dn -Bstatic} \
919%{shared:-G -dy -z text} \
920%{symbolic:-Bsymbolic -G -dy -z text}"
921
922#else
923/* Shared libraries are not default.  */
924#define LINK_SHLIB_SPEC "\
925%{mshlib: %(link_path) } \
926%{!mshlib: %{!shared: %{!symbolic: -dn -Bstatic}}} \
927%{static: } \
928%{shared:-G -dy -z text %(link_path) } \
929%{symbolic:-Bsymbolic -G -dy -z text %(link_path) }"
930#endif
931
932/* Override the default target of the linker.  */
933#define	LINK_TARGET_SPEC "\
934%{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } \
935%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
936    %{mcall-i960-old: --oformat elf32-powerpcle} \
937  }}}}"
938
939/* Any specific OS flags.  */
940#define LINK_OS_SPEC "\
941%{mads         : %(link_os_ads)         ; \
942  myellowknife : %(link_os_yellowknife) ; \
943  mmvme        : %(link_os_mvme)        ; \
944  msim         : %(link_os_sim)         ; \
945  mwindiss     : %(link_os_windiss)     ; \
946  mcall-freebsd: %(link_os_freebsd)     ; \
947  mcall-linux  : %(link_os_linux)       ; \
948  mcall-gnu    : %(link_os_gnu)         ; \
949  mcall-netbsd : %(link_os_netbsd)      ; \
950  mcall-openbsd: %(link_os_openbsd)     ; \
951               : %(link_os_default)     }"
952
953#define LINK_OS_DEFAULT_SPEC ""
954
955/* Override rs6000.h definition.  */
956#undef	CPP_SPEC
957#define	CPP_SPEC "%{posix: -D_POSIX_SOURCE} \
958%{mads         : %(cpp_os_ads)         ; \
959  myellowknife : %(cpp_os_yellowknife) ; \
960  mmvme        : %(cpp_os_mvme)        ; \
961  msim         : %(cpp_os_sim)         ; \
962  mwindiss     : %(cpp_os_windiss)     ; \
963  mcall-freebsd: %(cpp_os_freebsd)     ; \
964  mcall-linux  : %(cpp_os_linux)       ; \
965  mcall-gnu    : %(cpp_os_gnu)         ; \
966  mcall-netbsd : %(cpp_os_netbsd)      ; \
967  mcall-openbsd: %(cpp_os_openbsd)     ; \
968               : %(cpp_os_default)     }"
969
970#define	CPP_OS_DEFAULT_SPEC ""
971
972/* Override svr4.h definition.  */
973#undef	STARTFILE_SPEC
974#define	STARTFILE_SPEC "\
975%{mads         : %(startfile_ads)         ; \
976  myellowknife : %(startfile_yellowknife) ; \
977  mmvme        : %(startfile_mvme)        ; \
978  msim         : %(startfile_sim)         ; \
979  mwindiss     : %(startfile_windiss)     ; \
980  mcall-freebsd: %(startfile_freebsd)     ; \
981  mcall-linux  : %(startfile_linux)       ; \
982  mcall-gnu    : %(startfile_gnu)         ; \
983  mcall-netbsd : %(startfile_netbsd)      ; \
984  mcall-openbsd: %(startfile_openbsd)     ; \
985               : %(startfile_default)     }"
986
987#define	STARTFILE_DEFAULT_SPEC ""
988
989/* Override svr4.h definition.  */
990#undef	LIB_SPEC
991#define	LIB_SPEC "\
992%{mads         : %(lib_ads)         ; \
993  myellowknife : %(lib_yellowknife) ; \
994  mmvme        : %(lib_mvme)        ; \
995  msim         : %(lib_sim)         ; \
996  mwindiss     : %(lib_windiss)     ; \
997  mcall-freebsd: %(lib_freebsd)     ; \
998  mcall-linux  : %(lib_linux)       ; \
999  mcall-gnu    : %(lib_gnu)         ; \
1000  mcall-netbsd : %(lib_netbsd)      ; \
1001  mcall-openbsd: %(lib_openbsd)     ; \
1002               : %(lib_default)     }"
1003
1004#define LIB_DEFAULT_SPEC ""
1005
1006/* Override svr4.h definition.  */
1007#undef	ENDFILE_SPEC
1008#define	ENDFILE_SPEC "\
1009%{mads         : crtsavres.o%s        %(endfile_ads)         ; \
1010  myellowknife : crtsavres.o%s        %(endfile_yellowknife) ; \
1011  mmvme        : crtsavres.o%s        %(endfile_mvme)        ; \
1012  msim         : crtsavres.o%s        %(endfile_sim)         ; \
1013  mwindiss     :                      %(endfile_windiss)     ; \
1014  mcall-freebsd: crtsavres.o%s        %(endfile_freebsd)     ; \
1015  mcall-linux  : crtsavres.o%s        %(endfile_linux)       ; \
1016  mcall-gnu    : crtsavres.o%s        %(endfile_gnu)         ; \
1017  mcall-netbsd : crtsavres.o%s        %(endfile_netbsd)      ; \
1018  mcall-openbsd: crtsavres.o%s        %(endfile_openbsd)     ; \
1019               : %(crtsavres_default) %(endfile_default)     }"
1020
1021#define CRTSAVRES_DEFAULT_SPEC "crtsavres.o%s"
1022
1023#define	ENDFILE_DEFAULT_SPEC ""
1024
1025/* Motorola ADS support.  */
1026#define LIB_ADS_SPEC "--start-group -lads -lc --end-group"
1027
1028#define	STARTFILE_ADS_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
1029
1030#define	ENDFILE_ADS_SPEC "crtend.o%s ecrtn.o%s"
1031
1032#define LINK_START_ADS_SPEC "-T ads.ld%s"
1033
1034#define LINK_OS_ADS_SPEC ""
1035
1036#define CPP_OS_ADS_SPEC ""
1037
1038/* Motorola Yellowknife support.  */
1039#define LIB_YELLOWKNIFE_SPEC "--start-group -lyk -lc --end-group"
1040
1041#define	STARTFILE_YELLOWKNIFE_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
1042
1043#define	ENDFILE_YELLOWKNIFE_SPEC "crtend.o%s ecrtn.o%s"
1044
1045#define LINK_START_YELLOWKNIFE_SPEC "-T yellowknife.ld%s"
1046
1047#define LINK_OS_YELLOWKNIFE_SPEC ""
1048
1049#define CPP_OS_YELLOWKNIFE_SPEC ""
1050
1051/* Motorola MVME support.  */
1052#define LIB_MVME_SPEC "--start-group -lmvme -lc --end-group"
1053
1054#define	STARTFILE_MVME_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
1055
1056#define	ENDFILE_MVME_SPEC "crtend.o%s ecrtn.o%s"
1057
1058#define LINK_START_MVME_SPEC "-Ttext 0x40000"
1059
1060#define LINK_OS_MVME_SPEC ""
1061
1062#define CPP_OS_MVME_SPEC ""
1063
1064/* PowerPC simulator based on netbsd system calls support.  */
1065#define LIB_SIM_SPEC "--start-group -lsim -lc --end-group"
1066
1067#define	STARTFILE_SIM_SPEC "ecrti.o%s sim-crt0.o%s crtbegin.o%s"
1068
1069#define	ENDFILE_SIM_SPEC "crtend.o%s ecrtn.o%s"
1070
1071#define LINK_START_SIM_SPEC ""
1072
1073#define LINK_OS_SIM_SPEC "-m elf32ppcsim"
1074
1075#define CPP_OS_SIM_SPEC ""
1076
1077/* FreeBSD support.  */
1078
1079#define CPP_OS_FREEBSD_SPEC	"\
1080  -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ \
1081  -Acpu=powerpc -Amachine=powerpc"
1082
1083#define	STARTFILE_FREEBSD_SPEC	FBSD_STARTFILE_SPEC
1084#define ENDFILE_FREEBSD_SPEC	FBSD_ENDFILE_SPEC
1085#define LIB_FREEBSD_SPEC	FBSD_LIB_SPEC
1086#define LINK_START_FREEBSD_SPEC	""
1087
1088#define LINK_OS_FREEBSD_SPEC "\
1089  %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \
1090  %{Wl,*:%*} \
1091  %{v:-V} \
1092  %{assert*} %{R*} %{rpath*} %{defsym*} \
1093  %{shared:-Bshareable %{h*} %{soname*}} \
1094  %{!shared: \
1095    %{!static: \
1096      %{rdynamic: -export-dynamic} \
1097      %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} \
1098    %{static:-Bstatic}} \
1099  %{symbolic:-Bsymbolic}"
1100
1101/* GNU/Linux support.  */
1102#define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
1103%{!mnewlib: %{pthread:-lpthread} %{shared:-lc} \
1104%{!shared: %{profile:-lc_p} %{!profile:-lc}}}"
1105
1106#ifdef HAVE_LD_PIE
1107#define	STARTFILE_LINUX_SPEC "\
1108%{!shared: %{pg|p:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
1109%{mnewlib:ecrti.o%s;:crti.o%s} \
1110%{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
1111#else
1112#define	STARTFILE_LINUX_SPEC "\
1113%{!shared: %{pg|p:gcrt1.o%s;:crt1.o%s}} \
1114%{mnewlib:ecrti.o%s;:crti.o%s} \
1115%{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
1116#endif
1117
1118#define	ENDFILE_LINUX_SPEC "\
1119%{shared|pie:crtendS.o%s;:crtend.o%s} \
1120%{mnewlib:ecrtn.o%s;:crtn.o%s}"
1121
1122#define LINK_START_LINUX_SPEC ""
1123
1124#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
1125  %{rdynamic:-export-dynamic} \
1126  %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
1127
1128#if defined(HAVE_LD_EH_FRAME_HDR)
1129# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
1130#endif
1131
1132#define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
1133%{!undef:							  \
1134  %{!ansi:							  \
1135    %{!std=*:-Dunix -D__unix -Dlinux -D__linux}			  \
1136    %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}}		  \
1137-Asystem=linux -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
1138
1139/* GNU/Hurd support.  */
1140#define LIB_GNU_SPEC "%{mnewlib: --start-group -lgnu -lc --end-group } \
1141%{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } \
1142%{profile:-lc_p} %{!profile:-lc}}}"
1143
1144#define	STARTFILE_GNU_SPEC "\
1145%{!shared: %{!static: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}} \
1146%{static: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} \
1147%{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \
1148%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
1149
1150#define	ENDFILE_GNU_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
1151%{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}"
1152
1153#define LINK_START_GNU_SPEC ""
1154
1155#define LINK_OS_GNU_SPEC "-m elf32ppclinux %{!shared: %{!static: \
1156  %{rdynamic:-export-dynamic} \
1157  %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
1158
1159#define CPP_OS_GNU_SPEC "-D__unix__ -D__gnu_hurd__ -D__GNU__	\
1160%{!undef:					                \
1161  %{!ansi: -Dunix -D__unix}}			                \
1162-Asystem=gnu -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
1163
1164/* NetBSD support.  */
1165#define LIB_NETBSD_SPEC "\
1166%{profile:-lgmon -lc_p} %{!profile:-lc}"
1167
1168#define	STARTFILE_NETBSD_SPEC "\
1169ncrti.o%s crt0.o%s \
1170%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
1171
1172#define ENDFILE_NETBSD_SPEC "\
1173%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
1174ncrtn.o%s"
1175
1176#define LINK_START_NETBSD_SPEC "\
1177"
1178
1179#define LINK_OS_NETBSD_SPEC "\
1180%{!shared: %{!static: \
1181  %{rdynamic:-export-dynamic} \
1182  %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}}}"
1183
1184#define CPP_OS_NETBSD_SPEC "\
1185-D__powerpc__ -D__NetBSD__ -D__KPRINTF_ATTRIBUTE__"
1186
1187/* OpenBSD support.  */
1188#ifndef	LIB_OPENBSD_SPEC
1189#define LIB_OPENBSD_SPEC "%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}"
1190#endif
1191
1192#ifndef	STARTFILE_OPENBSD_SPEC
1193#define	STARTFILE_OPENBSD_SPEC "\
1194%{!shared: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} \
1195%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
1196#endif
1197
1198#ifndef	ENDFILE_OPENBSD_SPEC
1199#define	ENDFILE_OPENBSD_SPEC "\
1200%{!shared:crtend.o%s} %{shared:crtendS.o%s}"
1201#endif
1202
1203#ifndef LINK_START_OPENBSD_SPEC
1204#define LINK_START_OPENBSD_SPEC "-Ttext 0x400074"
1205#endif
1206
1207#ifndef LINK_OS_OPENBSD_SPEC
1208#define LINK_OS_OPENBSD_SPEC ""
1209#endif
1210
1211#ifndef CPP_OS_OPENBSD_SPEC
1212#define CPP_OS_OPENBSD_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
1213#endif
1214
1215/* WindISS support.  */
1216
1217#define LIB_WINDISS_SPEC "--start-group -li -lcfp -lwindiss -lram -limpl -limpfp --end-group"
1218
1219#define CPP_OS_WINDISS_SPEC "\
1220-D__rtasim \
1221-D__EABI__ \
1222-D__ppc \
1223%{!msoft-float: -D__hardfp} \
1224"
1225
1226#define STARTFILE_WINDISS_SPEC "crt0.o%s crtbegin.o%s"
1227
1228#define ENDFILE_WINDISS_SPEC "crtend.o%s"
1229
1230#define LINK_START_WINDISS_SPEC ""
1231
1232#define LINK_OS_WINDISS_SPEC ""
1233
1234/* Define any extra SPECS that the compiler needs to generate.  */
1235/* Override rs6000.h definition.  */
1236#undef	SUBTARGET_EXTRA_SPECS
1237#define	SUBTARGET_EXTRA_SPECS						\
1238  { "crtsavres_default",        CRTSAVRES_DEFAULT_SPEC },              \
1239  { "lib_ads",			LIB_ADS_SPEC },				\
1240  { "lib_yellowknife",		LIB_YELLOWKNIFE_SPEC },			\
1241  { "lib_mvme",			LIB_MVME_SPEC },			\
1242  { "lib_sim",			LIB_SIM_SPEC },				\
1243  { "lib_freebsd",		LIB_FREEBSD_SPEC },			\
1244  { "lib_gnu",			LIB_GNU_SPEC },				\
1245  { "lib_linux",		LIB_LINUX_SPEC },			\
1246  { "lib_netbsd",		LIB_NETBSD_SPEC },			\
1247  { "lib_openbsd",		LIB_OPENBSD_SPEC },			\
1248  { "lib_windiss",              LIB_WINDISS_SPEC },                     \
1249  { "lib_default",		LIB_DEFAULT_SPEC },			\
1250  { "startfile_ads",		STARTFILE_ADS_SPEC },			\
1251  { "startfile_yellowknife",	STARTFILE_YELLOWKNIFE_SPEC },		\
1252  { "startfile_mvme",		STARTFILE_MVME_SPEC },			\
1253  { "startfile_sim",		STARTFILE_SIM_SPEC },			\
1254  { "startfile_freebsd",	STARTFILE_FREEBSD_SPEC },		\
1255  { "startfile_gnu",		STARTFILE_GNU_SPEC },			\
1256  { "startfile_linux",		STARTFILE_LINUX_SPEC },			\
1257  { "startfile_netbsd",		STARTFILE_NETBSD_SPEC },		\
1258  { "startfile_openbsd",	STARTFILE_OPENBSD_SPEC },		\
1259  { "startfile_windiss",        STARTFILE_WINDISS_SPEC },               \
1260  { "startfile_default",	STARTFILE_DEFAULT_SPEC },		\
1261  { "endfile_ads",		ENDFILE_ADS_SPEC },			\
1262  { "endfile_yellowknife",	ENDFILE_YELLOWKNIFE_SPEC },		\
1263  { "endfile_mvme",		ENDFILE_MVME_SPEC },			\
1264  { "endfile_sim",		ENDFILE_SIM_SPEC },			\
1265  { "endfile_freebsd",		ENDFILE_FREEBSD_SPEC },			\
1266  { "endfile_gnu",		ENDFILE_GNU_SPEC },			\
1267  { "endfile_linux",		ENDFILE_LINUX_SPEC },			\
1268  { "endfile_netbsd",		ENDFILE_NETBSD_SPEC },			\
1269  { "endfile_openbsd",		ENDFILE_OPENBSD_SPEC },			\
1270  { "endfile_windiss",          ENDFILE_WINDISS_SPEC },                 \
1271  { "endfile_default",		ENDFILE_DEFAULT_SPEC },			\
1272  { "link_path",		LINK_PATH_SPEC },			\
1273  { "link_shlib",		LINK_SHLIB_SPEC },			\
1274  { "link_target",		LINK_TARGET_SPEC },			\
1275  { "link_start",		LINK_START_SPEC },			\
1276  { "link_start_ads",		LINK_START_ADS_SPEC },			\
1277  { "link_start_yellowknife",	LINK_START_YELLOWKNIFE_SPEC },		\
1278  { "link_start_mvme",		LINK_START_MVME_SPEC },			\
1279  { "link_start_sim",		LINK_START_SIM_SPEC },			\
1280  { "link_start_freebsd",	LINK_START_FREEBSD_SPEC },		\
1281  { "link_start_gnu",		LINK_START_GNU_SPEC },			\
1282  { "link_start_linux",		LINK_START_LINUX_SPEC },		\
1283  { "link_start_netbsd",	LINK_START_NETBSD_SPEC },		\
1284  { "link_start_openbsd",	LINK_START_OPENBSD_SPEC },		\
1285  { "link_start_windiss",	LINK_START_WINDISS_SPEC },		\
1286  { "link_start_default",	LINK_START_DEFAULT_SPEC },		\
1287  { "link_os",			LINK_OS_SPEC },				\
1288  { "link_os_ads",		LINK_OS_ADS_SPEC },			\
1289  { "link_os_yellowknife",	LINK_OS_YELLOWKNIFE_SPEC },		\
1290  { "link_os_mvme",		LINK_OS_MVME_SPEC },			\
1291  { "link_os_sim",		LINK_OS_SIM_SPEC },			\
1292  { "link_os_freebsd",		LINK_OS_FREEBSD_SPEC },			\
1293  { "link_os_linux",		LINK_OS_LINUX_SPEC },			\
1294  { "link_os_gnu",		LINK_OS_GNU_SPEC },			\
1295  { "link_os_netbsd",		LINK_OS_NETBSD_SPEC },			\
1296  { "link_os_openbsd",		LINK_OS_OPENBSD_SPEC },			\
1297  { "link_os_windiss",		LINK_OS_WINDISS_SPEC },			\
1298  { "link_os_default",		LINK_OS_DEFAULT_SPEC },			\
1299  { "cc1_endian_big",		CC1_ENDIAN_BIG_SPEC },			\
1300  { "cc1_endian_little",	CC1_ENDIAN_LITTLE_SPEC },		\
1301  { "cc1_endian_default",	CC1_ENDIAN_DEFAULT_SPEC },		\
1302  { "cpp_os_ads",		CPP_OS_ADS_SPEC },			\
1303  { "cpp_os_yellowknife",	CPP_OS_YELLOWKNIFE_SPEC },		\
1304  { "cpp_os_mvme",		CPP_OS_MVME_SPEC },			\
1305  { "cpp_os_sim",		CPP_OS_SIM_SPEC },			\
1306  { "cpp_os_freebsd",		CPP_OS_FREEBSD_SPEC },			\
1307  { "cpp_os_gnu",		CPP_OS_GNU_SPEC },			\
1308  { "cpp_os_linux",		CPP_OS_LINUX_SPEC },			\
1309  { "cpp_os_netbsd",		CPP_OS_NETBSD_SPEC },			\
1310  { "cpp_os_openbsd",		CPP_OS_OPENBSD_SPEC },			\
1311  { "cpp_os_windiss",           CPP_OS_WINDISS_SPEC },                  \
1312  { "cpp_os_default",		CPP_OS_DEFAULT_SPEC },			\
1313  { "fbsd_dynamic_linker",	FBSD_DYNAMIC_LINKER },			\
1314  SUBSUBTARGET_EXTRA_SPECS
1315
1316#define	SUBSUBTARGET_EXTRA_SPECS
1317
1318/* Define this macro as a C expression for the initializer of an
1319   array of string to tell the driver program which options are
1320   defaults for this target and thus do not need to be handled
1321   specially when using `MULTILIB_OPTIONS'.
1322
1323   Do not define this macro if `MULTILIB_OPTIONS' is not defined in
1324   the target makefile fragment or if none of the options listed in
1325   `MULTILIB_OPTIONS' are set by default.  *Note Target Fragment::.  */
1326
1327#define	MULTILIB_DEFAULTS { "mbig", "mcall-sysv" }
1328
1329/* Define this macro if the code for function profiling should come
1330   before the function prologue.  Normally, the profiling code comes
1331   after.  */
1332#define PROFILE_BEFORE_PROLOGUE 1
1333
1334/* Function name to call to do profiling.  */
1335#define RS6000_MCOUNT "_mcount"
1336
1337/* Define this macro (to a value of 1) if you want to support the
1338   Win32 style pragmas #pragma pack(push,<n>)' and #pragma
1339   pack(pop)'.  The pack(push,<n>) pragma specifies the maximum
1340   alignment (in bytes) of fields within a structure, in much the
1341   same way as the __aligned__' and __packed__' __attribute__'s
1342   do.  A pack value of zero resets the behavior to the default.
1343   Successive invocations of this pragma cause the previous values to
1344   be stacked, so that invocations of #pragma pack(pop)' will return
1345   to the previous value.  */
1346
1347#define HANDLE_PRAGMA_PACK_PUSH_POP 1
1348
1349/* Select a format to encode pointers in exception handling data.  CODE
1350   is 0 for data, 1 for code labels, 2 for function pointers.  GLOBAL is
1351   true if the symbol may be affected by dynamic relocations.  */
1352#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)			     \
1353  ((flag_pic || TARGET_RELOCATABLE)					     \
1354   ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
1355   : DW_EH_PE_absptr)
1356
1357#define TARGET_ASM_EXCEPTION_SECTION readonly_data_section
1358
1359#define DOUBLE_INT_ASM_OP "\t.quad\t"
1360
1361/* Generate entries in .fixup for relocatable addresses.  */
1362#define RELOCATABLE_NEEDS_FIXUP 1
1363