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