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