OSDN Git Service

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