OSDN Git Service

Add CPP_SPEC for -mxilinx-fpu.
[pf3gnuchains/gcc-fork.git] / gcc / config / rs6000 / linux64.h
1 /* Definitions of target machine for GNU compiler,
2    for 64 bit PowerPC linux.
3    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
4    2009  Free Software Foundation, Inc.
5
6    This file is part of GCC.
7
8    GCC is free software; you can redistribute it and/or modify it
9    under the terms of the GNU General Public License as published
10    by the Free Software Foundation; either version 3, or (at your
11    option) any later version.
12
13    GCC is distributed in the hope that it will be useful, but WITHOUT
14    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
16    License for more details.
17
18    Under Section 7 of GPL version 3, you are granted additional
19    permissions described in the GCC Runtime Library Exception, version
20    3.1, as published by the Free Software Foundation.
21
22    You should have received a copy of the GNU General Public License and
23    a copy of the GCC Runtime Library Exception along with this program;
24    see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
25    <http://www.gnu.org/licenses/>.  */
26
27 #ifndef RS6000_BI_ARCH
28
29 #undef  DEFAULT_ABI
30 #define DEFAULT_ABI ABI_AIX
31
32 #undef  TARGET_64BIT
33 #define TARGET_64BIT 1
34
35 #define DEFAULT_ARCH64_P 1
36 #define RS6000_BI_ARCH_P 0
37
38 #else
39
40 #define DEFAULT_ARCH64_P (TARGET_DEFAULT & MASK_64BIT)
41 #define RS6000_BI_ARCH_P 1
42
43 #endif
44
45 #ifdef IN_LIBGCC2
46 #undef TARGET_64BIT
47 #ifdef __powerpc64__
48 #define TARGET_64BIT 1
49 #else
50 #define TARGET_64BIT 0
51 #endif
52 #endif
53
54 #undef  TARGET_AIX
55 #define TARGET_AIX TARGET_64BIT
56
57 #ifdef HAVE_LD_NO_DOT_SYMS
58 /* New ABI uses a local sym for the function entry point.  */
59 extern int dot_symbols;
60 #undef DOT_SYMBOLS
61 #define DOT_SYMBOLS dot_symbols
62 #endif
63
64 #undef  PROCESSOR_DEFAULT
65 #define PROCESSOR_DEFAULT PROCESSOR_POWER6
66 #undef  PROCESSOR_DEFAULT64
67 #define PROCESSOR_DEFAULT64 PROCESSOR_POWER6
68
69 /* We don't need to generate entries in .fixup, except when
70    -mrelocatable or -mrelocatable-lib is given.  */
71 #undef RELOCATABLE_NEEDS_FIXUP
72 #define RELOCATABLE_NEEDS_FIXUP \
73   (target_flags & target_flags_explicit & MASK_RELOCATABLE)
74
75 #undef  RS6000_ABI_NAME
76 #define RS6000_ABI_NAME "linux"
77
78 #define INVALID_64BIT "-m%s not supported in this configuration"
79 #define INVALID_32BIT INVALID_64BIT
80
81 #undef  SUBSUBTARGET_OVERRIDE_OPTIONS
82 #define SUBSUBTARGET_OVERRIDE_OPTIONS                           \
83   do                                                            \
84     {                                                           \
85       if (!rs6000_explicit_options.alignment)                   \
86         rs6000_alignment_flags = MASK_ALIGN_NATURAL;            \
87       if (TARGET_64BIT)                                         \
88         {                                                       \
89           if (DEFAULT_ABI != ABI_AIX)                           \
90             {                                                   \
91               rs6000_current_abi = ABI_AIX;                     \
92               error (INVALID_64BIT, "call");                    \
93             }                                                   \
94           dot_symbols = !strcmp (rs6000_abi_name, "aixdesc");   \
95           if (target_flags & MASK_RELOCATABLE)                  \
96             {                                                   \
97               target_flags &= ~MASK_RELOCATABLE;                \
98               error (INVALID_64BIT, "relocatable");             \
99             }                                                   \
100           if (target_flags & MASK_EABI)                         \
101             {                                                   \
102               target_flags &= ~MASK_EABI;                       \
103               error (INVALID_64BIT, "eabi");                    \
104             }                                                   \
105           if (TARGET_PROTOTYPE)                                 \
106             {                                                   \
107               target_prototype = 0;                             \
108               error (INVALID_64BIT, "prototype");               \
109             }                                                   \
110           if ((target_flags & MASK_POWERPC64) == 0)             \
111             {                                                   \
112               target_flags |= MASK_POWERPC64;                   \
113               error ("-m64 requires a PowerPC64 cpu");          \
114             }                                                   \
115         }                                                       \
116       else                                                      \
117         {                                                       \
118           if (!RS6000_BI_ARCH_P)                                \
119             error (INVALID_32BIT, "32");                        \
120           if (TARGET_PROFILE_KERNEL)                            \
121             {                                                   \
122               target_flags &= ~MASK_PROFILE_KERNEL;             \
123               error (INVALID_32BIT, "profile-kernel");          \
124             }                                                   \
125         }                                                       \
126     }                                                           \
127   while (0)
128
129 #ifdef  RS6000_BI_ARCH
130
131 #undef  OVERRIDE_OPTIONS
132 #define OVERRIDE_OPTIONS \
133   rs6000_override_options (((TARGET_DEFAULT ^ target_flags) & MASK_64BIT) \
134                            ? (char *) 0 : TARGET_CPU_DEFAULT)
135
136 #endif
137
138 #undef  ASM_DEFAULT_SPEC
139 #undef  ASM_SPEC
140 #undef  LINK_OS_LINUX_SPEC
141
142 /* FIXME: This will quite possibly choose the wrong dynamic linker.  */
143 #undef  LINK_OS_GNU_SPEC
144 #define LINK_OS_GNU_SPEC LINK_OS_LINUX_SPEC
145
146 #ifndef RS6000_BI_ARCH
147 #define ASM_DEFAULT_SPEC "-mppc64"
148 #define ASM_SPEC         "%(asm_spec64) %(asm_spec_common)"
149 #define LINK_OS_LINUX_SPEC "%(link_os_linux_spec64)"
150 #else
151 #if DEFAULT_ARCH64_P
152 #define ASM_DEFAULT_SPEC "-mppc%{!m32:64}"
153 #define ASM_SPEC         "%{m32:%(asm_spec32)}%{!m32:%(asm_spec64)} %(asm_spec_common)"
154 #define LINK_OS_LINUX_SPEC "%{m32:%(link_os_linux_spec32)}%{!m32:%(link_os_linux_spec64)}"
155 #else
156 #define ASM_DEFAULT_SPEC "-mppc%{m64:64}"
157 #define ASM_SPEC         "%{!m64:%(asm_spec32)}%{m64:%(asm_spec64)} %(asm_spec_common)"
158 #define LINK_OS_LINUX_SPEC "%{!m64:%(link_os_linux_spec32)}%{m64:%(link_os_linux_spec64)}"
159 #endif
160 #endif
161
162 #define ASM_SPEC32 "-a32 %{n} %{T} %{Ym,*} %{Yd,*} \
163 %{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \
164 %{memb} %{!memb: %{msdata=eabi: -memb}} \
165 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
166     %{mcall-freebsd: -mbig} \
167     %{mcall-i960-old: -mlittle} \
168     %{mcall-linux: -mbig} \
169     %{mcall-gnu: -mbig} \
170     %{mcall-netbsd: -mbig} \
171 }}}}"
172
173 #define ASM_SPEC64 "-a64"
174
175 #define ASM_SPEC_COMMON "%(asm_cpu) \
176 %{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \
177 %{v:-V} %{Qy:} %{!Qn:-Qy} %{Wa,*:%*} \
178 %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian}"
179
180 #undef  SUBSUBTARGET_EXTRA_SPECS
181 #define SUBSUBTARGET_EXTRA_SPECS \
182   { "asm_spec_common",          ASM_SPEC_COMMON },                      \
183   { "asm_spec32",               ASM_SPEC32 },                           \
184   { "asm_spec64",               ASM_SPEC64 },                           \
185   { "link_os_linux_spec32",     LINK_OS_LINUX_SPEC32 },                 \
186   { "link_os_linux_spec64",     LINK_OS_LINUX_SPEC64 },
187
188 #undef  MULTILIB_DEFAULTS
189 #if DEFAULT_ARCH64_P
190 #define MULTILIB_DEFAULTS { "m64" }
191 #else
192 #define MULTILIB_DEFAULTS { "m32" }
193 #endif
194
195 #ifndef RS6000_BI_ARCH
196
197 /* 64-bit PowerPC Linux is always big-endian.  */
198 #undef  TARGET_LITTLE_ENDIAN
199 #define TARGET_LITTLE_ENDIAN    0
200
201 /* 64-bit PowerPC Linux always has a TOC.  */
202 #undef  TARGET_TOC
203 #define TARGET_TOC              1
204
205 /* Some things from sysv4.h we don't do when 64 bit.  */
206 #undef  TARGET_RELOCATABLE
207 #define TARGET_RELOCATABLE      0
208 #undef  TARGET_EABI
209 #define TARGET_EABI             0
210 #undef  TARGET_PROTOTYPE
211 #define TARGET_PROTOTYPE        0
212 #undef RELOCATABLE_NEEDS_FIXUP
213 #define RELOCATABLE_NEEDS_FIXUP 0
214
215 #endif
216
217 /* We use glibc _mcount for profiling.  */
218 #define NO_PROFILE_COUNTERS 1
219 #define PROFILE_HOOK(LABEL) \
220   do { if (TARGET_64BIT) output_profile_hook (LABEL); } while (0)
221
222 /* PowerPC64 Linux word-aligns FP doubles when -malign-power is given.  */
223 #undef  ADJUST_FIELD_ALIGN
224 #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
225   ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)     \
226    ? 128                                                                \
227    : (TARGET_64BIT                                                      \
228       && TARGET_ALIGN_NATURAL == 0                                      \
229       && TYPE_MODE (strip_array_types (TREE_TYPE (FIELD))) == DFmode)   \
230    ? MIN ((COMPUTED), 32)                                               \
231    : (COMPUTED))
232
233 /* PowerPC64 Linux increases natural record alignment to doubleword if
234    the first field is an FP double, only if in power alignment mode.  */
235 #undef  ROUND_TYPE_ALIGN
236 #define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED)                   \
237   ((TARGET_64BIT                                                        \
238     && (TREE_CODE (STRUCT) == RECORD_TYPE                               \
239         || TREE_CODE (STRUCT) == UNION_TYPE                             \
240         || TREE_CODE (STRUCT) == QUAL_UNION_TYPE)                       \
241     && TARGET_ALIGN_NATURAL == 0)                                       \
242    ? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED)      \
243    : MAX ((COMPUTED), (SPECIFIED)))
244
245 /* Use the default for compiling target libs.  */
246 #ifdef IN_TARGET_LIBS
247 #undef TARGET_ALIGN_NATURAL
248 #define TARGET_ALIGN_NATURAL 1
249 #endif
250
251 /* Indicate that jump tables go in the text section.  */
252 #undef  JUMP_TABLES_IN_TEXT_SECTION
253 #define JUMP_TABLES_IN_TEXT_SECTION TARGET_64BIT
254
255 /* The linux ppc64 ABI isn't explicit on whether aggregates smaller
256    than a doubleword should be padded upward or downward.  You could
257    reasonably assume that they follow the normal rules for structure
258    layout treating the parameter area as any other block of memory,
259    then map the reg param area to registers.  i.e. pad upward.
260    Setting both of the following defines results in this behavior.
261    Setting just the first one will result in aggregates that fit in a
262    doubleword being padded downward, and others being padded upward.
263    Not a bad idea as this results in struct { int x; } being passed
264    the same way as an int.  */
265 #define AGGREGATE_PADDING_FIXED TARGET_64BIT
266 #define AGGREGATES_PAD_UPWARD_ALWAYS 0
267
268 /* Specify padding for the last element of a block move between
269    registers and memory.  FIRST is nonzero if this is the only
270    element.  */
271 #define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \
272   (!(FIRST) ? upward : FUNCTION_ARG_PADDING (MODE, TYPE))
273
274 /* __throw will restore its own return address to be the same as the
275    return address of the function that the throw is being made to.
276    This is unfortunate, because we want to check the original
277    return address to see if we need to restore the TOC.
278    So we have to squirrel it away with this.  */
279 #define SETUP_FRAME_ADDRESSES() \
280   do { if (TARGET_64BIT) rs6000_aix_emit_builtin_unwind_init (); } while (0)
281
282 /* Override svr4.h  */
283 #undef MD_EXEC_PREFIX
284 #undef MD_STARTFILE_PREFIX
285
286 /* Linux doesn't support saving and restoring 64-bit regs in a 32-bit
287    process.  */
288 #define OS_MISSING_POWERPC64 !TARGET_64BIT
289
290 /* glibc has float and long double forms of math functions.  */
291 #undef  TARGET_C99_FUNCTIONS
292 #define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
293
294 /* Whether we have sincos that follows the GNU extension.  */
295 #undef  TARGET_HAS_SINCOS
296 #define TARGET_HAS_SINCOS (OPTION_GLIBC)
297
298 #undef  TARGET_OS_CPP_BUILTINS
299 #define TARGET_OS_CPP_BUILTINS()                        \
300   do                                                    \
301     {                                                   \
302       if (TARGET_64BIT)                                 \
303         {                                               \
304           builtin_define ("__PPC__");                   \
305           builtin_define ("__PPC64__");                 \
306           builtin_define ("__powerpc__");               \
307           builtin_define ("__powerpc64__");             \
308           builtin_assert ("cpu=powerpc64");             \
309           builtin_assert ("machine=powerpc64");         \
310         }                                               \
311       else                                              \
312         {                                               \
313           builtin_define_std ("PPC");                   \
314           builtin_define_std ("powerpc");               \
315           builtin_assert ("cpu=powerpc");               \
316           builtin_assert ("machine=powerpc");           \
317           TARGET_OS_SYSV_CPP_BUILTINS ();               \
318         }                                               \
319     }                                                   \
320   while (0)
321
322 #undef  CPP_OS_DEFAULT_SPEC
323 #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
324
325 /* The GNU C++ standard library currently requires _GNU_SOURCE being
326    defined on glibc-based systems. This temporary hack accomplishes this,
327    it should go away as soon as libstdc++-v3 has a real fix.  */
328 #undef  CPLUSPLUS_CPP_SPEC
329 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
330
331 #undef  LINK_SHLIB_SPEC
332 #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}"
333
334 #undef  LIB_DEFAULT_SPEC
335 #define LIB_DEFAULT_SPEC "%(lib_linux)"
336
337 #undef  STARTFILE_DEFAULT_SPEC
338 #define STARTFILE_DEFAULT_SPEC "%(startfile_linux)"
339
340 #undef  ENDFILE_DEFAULT_SPEC
341 #define ENDFILE_DEFAULT_SPEC "%(endfile_linux)"
342
343 #undef  LINK_START_DEFAULT_SPEC
344 #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
345
346 #undef  LINK_OS_DEFAULT_SPEC
347 #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
348
349 #define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
350 #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1"
351 #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
352 #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
353 #if UCLIBC_DEFAULT
354 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}"
355 #else
356 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:%{mglibc:%e-mglibc and -muclibc used together}" U ";:" G "}"
357 #endif
358 #define LINUX_DYNAMIC_LINKER32 \
359   CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
360 #define LINUX_DYNAMIC_LINKER64 \
361   CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
362
363
364 #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
365   %{rdynamic:-export-dynamic} \
366   %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER32 "}}}"
367
368 #define LINK_OS_LINUX_SPEC64 "-m elf64ppc %{!shared: %{!static: \
369   %{rdynamic:-export-dynamic} \
370   %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER64 "}}}"
371
372 #undef  TOC_SECTION_ASM_OP
373 #define TOC_SECTION_ASM_OP \
374   (TARGET_64BIT                                         \
375    ? "\t.section\t\".toc\",\"aw\""                      \
376    : "\t.section\t\".got\",\"aw\"")
377
378 #undef  MINIMAL_TOC_SECTION_ASM_OP
379 #define MINIMAL_TOC_SECTION_ASM_OP \
380   (TARGET_64BIT                                         \
381    ? "\t.section\t\".toc1\",\"aw\""                     \
382    : ((TARGET_RELOCATABLE || flag_pic)                  \
383       ? "\t.section\t\".got2\",\"aw\""                  \
384       : "\t.section\t\".got1\",\"aw\""))
385
386 #undef  TARGET_VERSION
387 #define TARGET_VERSION fprintf (stderr, " (PowerPC64 GNU/Linux)");
388
389 /* Must be at least as big as our pointer type.  */
390 #undef  SIZE_TYPE
391 #define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")
392
393 #undef  PTRDIFF_TYPE
394 #define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int")
395
396 #undef  WCHAR_TYPE
397 #define WCHAR_TYPE (TARGET_64BIT ? "int" : "long int")
398 #undef  WCHAR_TYPE_SIZE
399 #define WCHAR_TYPE_SIZE 32
400
401 /* Override rs6000.h definition.  */
402 #undef  ASM_APP_ON
403 #define ASM_APP_ON "#APP\n"
404
405 /* Override rs6000.h definition.  */
406 #undef  ASM_APP_OFF
407 #define ASM_APP_OFF "#NO_APP\n"
408
409 /* PowerPC no-op instruction.  */
410 #undef  RS6000_CALL_GLUE
411 #define RS6000_CALL_GLUE (TARGET_64BIT ? "nop" : "cror 31,31,31")
412
413 #undef  RS6000_MCOUNT
414 #define RS6000_MCOUNT "_mcount"
415
416 #ifdef __powerpc64__
417 /* _init and _fini functions are built from bits spread across many
418    object files, each potentially with a different TOC pointer.  For
419    that reason, place a nop after the call so that the linker can
420    restore the TOC pointer if a TOC adjusting call stub is needed.  */
421 #if DOT_SYMBOLS
422 #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC)      \
423   asm (SECTION_OP "\n"                                  \
424 "       bl ." #FUNC "\n"                                \
425 "       nop\n"                                          \
426 "       .previous");
427 #else
428 #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC)      \
429   asm (SECTION_OP "\n"                                  \
430 "       bl " #FUNC "\n"                                 \
431 "       nop\n"                                          \
432 "       .previous");
433 #endif
434 #endif
435
436 /* FP save and restore routines.  */
437 #undef  SAVE_FP_PREFIX
438 #define SAVE_FP_PREFIX (TARGET_64BIT ? "._savef" : "_savefpr_")
439 #undef  SAVE_FP_SUFFIX
440 #define SAVE_FP_SUFFIX (TARGET_64BIT ? "" : "_l")
441 #undef  RESTORE_FP_PREFIX
442 #define RESTORE_FP_PREFIX (TARGET_64BIT ? "._restf" : "_restfpr_")
443 #undef  RESTORE_FP_SUFFIX
444 #define RESTORE_FP_SUFFIX (TARGET_64BIT ? "" : "_l")
445
446 /* Dwarf2 debugging.  */
447 #undef  PREFERRED_DEBUGGING_TYPE
448 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
449
450 /* This is how to declare the size of a function.  */
451 #undef  ASM_DECLARE_FUNCTION_SIZE
452 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)                    \
453   do                                                                    \
454     {                                                                   \
455       if (!flag_inhibit_size_directive)                                 \
456         {                                                               \
457           fputs ("\t.size\t", (FILE));                                  \
458           if (TARGET_64BIT && DOT_SYMBOLS)                              \
459             putc ('.', (FILE));                                         \
460           assemble_name ((FILE), (FNAME));                              \
461           fputs (",.-", (FILE));                                        \
462           rs6000_output_function_entry (FILE, FNAME);                   \
463           putc ('\n', (FILE));                                          \
464         }                                                               \
465     }                                                                   \
466   while (0)
467
468 /* Return nonzero if this entry is to be written into the constant
469    pool in a special way.  We do so if this is a SYMBOL_REF, LABEL_REF
470    or a CONST containing one of them.  If -mfp-in-toc (the default),
471    we also do this for floating-point constants.  We actually can only
472    do this if the FP formats of the target and host machines are the
473    same, but we can't check that since not every file that uses
474    GO_IF_LEGITIMATE_ADDRESS_P includes real.h.  We also do this when
475    we can write the entry into the TOC and the entry is not larger
476    than a TOC entry.  */
477
478 #undef  ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
479 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE)                        \
480   (TARGET_TOC                                                           \
481    && (GET_CODE (X) == SYMBOL_REF                                       \
482        || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS      \
483            && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF)           \
484        || GET_CODE (X) == LABEL_REF                                     \
485        || (GET_CODE (X) == CONST_INT                                    \
486            && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode))      \
487        || (GET_CODE (X) == CONST_DOUBLE                                 \
488            && ((TARGET_64BIT                                            \
489                 && (TARGET_MINIMAL_TOC                                  \
490                     || (SCALAR_FLOAT_MODE_P (GET_MODE (X))              \
491                         && ! TARGET_NO_FP_IN_TOC)))                     \
492                || (!TARGET_64BIT                                        \
493                    && !TARGET_NO_FP_IN_TOC                              \
494                    && !TARGET_RELOCATABLE                               \
495                    && SCALAR_FLOAT_MODE_P (GET_MODE (X))                \
496                    && BITS_PER_WORD == HOST_BITS_PER_INT)))))
497
498 /* Select a format to encode pointers in exception handling data.  CODE
499    is 0 for data, 1 for code labels, 2 for function pointers.  GLOBAL is
500    true if the symbol may be affected by dynamic relocations.  */
501 #undef  ASM_PREFERRED_EH_DATA_FORMAT
502 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
503   ((TARGET_64BIT || flag_pic || TARGET_RELOCATABLE)                     \
504    ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel               \
505       | (TARGET_64BIT ? DW_EH_PE_udata8 : DW_EH_PE_sdata4))             \
506    : DW_EH_PE_absptr)
507
508 /* For backward compatibility, we must continue to use the AIX
509    structure return convention.  */
510 #undef DRAFT_V4_STRUCT_RET
511 #define DRAFT_V4_STRUCT_RET (!TARGET_64BIT)
512
513 #define TARGET_ASM_FILE_END rs6000_elf_end_indicate_exec_stack
514
515 #define TARGET_POSIX_IO
516
517 #define LINK_GCC_C_SEQUENCE_SPEC \
518   "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
519
520 /* Use --as-needed -lgcc_s for eh support.  */
521 #ifdef HAVE_LD_AS_NEEDED
522 #define USE_LD_AS_NEEDED 1
523 #endif
524
525 #define MD_UNWIND_SUPPORT "config/rs6000/linux-unwind.h"
526
527 #ifdef TARGET_LIBC_PROVIDES_SSP
528 /* ppc32 glibc provides __stack_chk_guard in -0x7008(2),
529    ppc64 glibc provides it at -0x7010(13).  */
530 #define TARGET_THREAD_SSP_OFFSET        (TARGET_64BIT ? -0x7010 : -0x7008)
531 #endif
532
533 #define POWERPC_LINUX
534
535 /* ppc{32,64} linux has 128-bit long double support in glibc 2.4 and later.  */
536 #ifdef TARGET_DEFAULT_LONG_DOUBLE_128
537 #define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128
538 #endif