]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/rs6000/linux64.h
1 /* Definitions of target machine for GNU compiler,
2 for 64 bit PowerPC linux.
3 Copyright (C) 2000-2016 Free Software Foundation, Inc.
5 This file is part of GCC.
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.
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.
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.
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/>. */
26 #ifndef RS6000_BI_ARCH
29 #define TARGET_64BIT 1
31 #define DEFAULT_ARCH64_P 1
32 #define RS6000_BI_ARCH_P 0
36 #define DEFAULT_ARCH64_P (TARGET_DEFAULT & MASK_64BIT)
37 #define RS6000_BI_ARCH_P 1
44 #define TARGET_64BIT 1
46 #define TARGET_64BIT 0
51 #define TARGET_AIX TARGET_64BIT
53 #ifdef HAVE_LD_NO_DOT_SYMS
54 /* New ABI uses a local sym for the function entry point. */
55 extern int dot_symbols
;
57 #define DOT_SYMBOLS dot_symbols
60 #define TARGET_PROFILE_KERNEL profile_kernel
62 #define TARGET_USES_LINUX64_OPT 1
63 #ifdef HAVE_LD_LARGE_TOC
65 #define TARGET_CMODEL rs6000_current_cmodel
66 #define SET_CMODEL(opt) rs6000_current_cmodel = opt
68 #define SET_CMODEL(opt) do {} while (0)
71 #undef PROCESSOR_DEFAULT
72 #define PROCESSOR_DEFAULT PROCESSOR_POWER7
73 #undef PROCESSOR_DEFAULT64
74 #define PROCESSOR_DEFAULT64 PROCESSOR_POWER8
76 /* We don't need to generate entries in .fixup, except when
77 -mrelocatable or -mrelocatable-lib is given. */
78 #undef RELOCATABLE_NEEDS_FIXUP
79 #define RELOCATABLE_NEEDS_FIXUP \
80 (rs6000_isa_flags & rs6000_isa_flags_explicit & OPTION_MASK_RELOCATABLE)
82 #undef RS6000_ABI_NAME
83 #define RS6000_ABI_NAME "linux"
85 #define INVALID_64BIT "-m%s not supported in this configuration"
86 #define INVALID_32BIT INVALID_64BIT
88 #ifdef LINUX64_DEFAULT_ABI_ELFv2
89 #define ELFv2_ABI_CHECK (rs6000_elf_abi != 1)
91 #define ELFv2_ABI_CHECK (rs6000_elf_abi == 2)
94 #undef SUBSUBTARGET_OVERRIDE_OPTIONS
95 #define SUBSUBTARGET_OVERRIDE_OPTIONS \
98 if (!global_options_set.x_rs6000_alignment_flags) \
99 rs6000_alignment_flags = MASK_ALIGN_NATURAL; \
100 if (rs6000_isa_flags & OPTION_MASK_64BIT) \
102 if (DEFAULT_ABI != ABI_AIX) \
104 rs6000_current_abi = ABI_AIX; \
105 error (INVALID_64BIT, "call"); \
107 dot_symbols = !strcmp (rs6000_abi_name, "aixdesc"); \
108 if (ELFv2_ABI_CHECK) \
110 rs6000_current_abi = ABI_ELFv2; \
112 error ("-mcall-aixdesc incompatible with -mabi=elfv2"); \
114 if (rs6000_isa_flags & OPTION_MASK_RELOCATABLE) \
116 rs6000_isa_flags &= ~OPTION_MASK_RELOCATABLE; \
117 error (INVALID_64BIT, "relocatable"); \
119 if (rs6000_isa_flags & OPTION_MASK_EABI) \
121 rs6000_isa_flags &= ~OPTION_MASK_EABI; \
122 error (INVALID_64BIT, "eabi"); \
124 if (TARGET_PROTOTYPE) \
126 target_prototype = 0; \
127 error (INVALID_64BIT, "prototype"); \
129 if ((rs6000_isa_flags & OPTION_MASK_POWERPC64) == 0) \
131 rs6000_isa_flags |= OPTION_MASK_POWERPC64; \
132 error ("-m64 requires a PowerPC64 cpu"); \
134 if ((rs6000_isa_flags_explicit \
135 & OPTION_MASK_MINIMAL_TOC) != 0) \
137 if (global_options_set.x_rs6000_current_cmodel \
138 && rs6000_current_cmodel != CMODEL_SMALL) \
139 error ("-mcmodel incompatible with other toc options"); \
140 SET_CMODEL (CMODEL_SMALL); \
144 if (!global_options_set.x_rs6000_current_cmodel) \
145 SET_CMODEL (CMODEL_MEDIUM); \
146 if (rs6000_current_cmodel != CMODEL_SMALL) \
148 if (!global_options_set.x_TARGET_NO_FP_IN_TOC) \
149 TARGET_NO_FP_IN_TOC \
150 = rs6000_current_cmodel == CMODEL_MEDIUM; \
151 if (!global_options_set.x_TARGET_NO_SUM_IN_TOC) \
152 TARGET_NO_SUM_IN_TOC = 0; \
158 if (!RS6000_BI_ARCH_P) \
159 error (INVALID_32BIT, "32"); \
160 if (TARGET_PROFILE_KERNEL) \
162 TARGET_PROFILE_KERNEL = 0; \
163 error (INVALID_32BIT, "profile-kernel"); \
165 if (global_options_set.x_rs6000_current_cmodel) \
167 SET_CMODEL (CMODEL_SMALL); \
168 error (INVALID_32BIT, "cmodel"); \
174 #undef ASM_DEFAULT_SPEC
176 #undef LINK_OS_LINUX_SPEC
177 #undef LINK_SECURE_PLT_SPEC
179 #ifndef RS6000_BI_ARCH
180 #define ASM_DEFAULT_SPEC "-mppc64"
181 #define ASM_SPEC "%(asm_spec64) %(asm_spec_common)"
182 #define LINK_OS_LINUX_SPEC "%(link_os_linux_spec64)"
183 #define LINK_SECURE_PLT_SPEC ""
186 #define ASM_DEFAULT_SPEC "-mppc%{!m32:64}"
187 #define ASM_SPEC "%{m32:%(asm_spec32)}%{!m32:%(asm_spec64)} %(asm_spec_common)"
188 #define LINK_OS_LINUX_SPEC "%{m32:%(link_os_linux_spec32)}%{!m32:%(link_os_linux_spec64)}"
189 #define LINK_SECURE_PLT_SPEC "%{m32: " LINK_SECURE_PLT_DEFAULT_SPEC "}"
191 #define ASM_DEFAULT_SPEC "-mppc%{m64:64}"
192 #define ASM_SPEC "%{!m64:%(asm_spec32)}%{m64:%(asm_spec64)} %(asm_spec_common)"
193 #define LINK_OS_LINUX_SPEC "%{!m64:%(link_os_linux_spec32)}%{m64:%(link_os_linux_spec64)}"
194 #define LINK_SECURE_PLT_SPEC "%{!m64: " LINK_SECURE_PLT_DEFAULT_SPEC "}"
198 #define ASM_SPEC32 "-a32 \
199 %{mrelocatable} %{mrelocatable-lib} %{" FPIE_OR_FPIC_SPEC ":-K PIC} \
200 %{memb|msdata=eabi: -memb}"
202 #define ASM_SPEC64 "-a64"
204 #define ASM_SPEC_COMMON "%(asm_cpu) \
205 %{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}}" \
206 ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
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 { "link_os_extra_spec32", LINK_OS_EXTRA_SPEC32 }, \
216 { "link_os_extra_spec64", LINK_OS_EXTRA_SPEC64 }, \
217 { "link_os_new_dtags", LINK_OS_NEW_DTAGS_SPEC }, \
218 { "include_extra", INCLUDE_EXTRA_SPEC }, \
219 { "dynamic_linker_prefix", DYNAMIC_LINKER_PREFIX },
221 /* Optional specs used for overriding the system include directory, default
222 -rpath links, and prefix for the dynamic linker. Normally, there are not
223 defined, but if the user configure with the --with-advance-toolchain=<xxx>
224 option, the advance-toolchain.h file will override these. */
225 #ifndef INCLUDE_EXTRA_SPEC
226 #define INCLUDE_EXTRA_SPEC ""
229 #ifndef LINK_OS_EXTRA_SPEC32
230 #define LINK_OS_EXTRA_SPEC32 ""
233 #ifndef LINK_OS_EXTRA_SPEC64
234 #define LINK_OS_EXTRA_SPEC64 ""
237 #ifndef LINK_OS_NEW_DTAGS_SPEC
238 #define LINK_OS_NEW_DTAGS_SPEC ""
241 #ifndef DYNAMIC_LINKER_PREFIX
242 #define DYNAMIC_LINKER_PREFIX ""
245 #undef MULTILIB_DEFAULTS
247 #define MULTILIB_DEFAULTS { "m64" }
249 #define MULTILIB_DEFAULTS { "m32" }
252 /* Split stack is only supported for 64 bit, and requires glibc >= 2.18. */
253 #if TARGET_GLIBC_MAJOR * 1000 + TARGET_GLIBC_MINOR >= 2018
254 # ifndef RS6000_BI_ARCH
255 # define TARGET_CAN_SPLIT_STACK
257 # if DEFAULT_ARCH64_P
258 /* Supported, and the default is -m64 */
259 # define TARGET_CAN_SPLIT_STACK_64BIT 1
261 /* Supported, and the default is -m32 */
262 # define TARGET_CAN_SPLIT_STACK_64BIT 0
267 #ifndef RS6000_BI_ARCH
269 /* 64-bit PowerPC Linux always has a TOC. */
273 /* Some things from sysv4.h we don't do when 64 bit. */
274 #undef OPTION_RELOCATABLE
275 #define OPTION_RELOCATABLE 0
277 #define OPTION_EABI 0
278 #undef OPTION_PROTOTYPE
279 #define OPTION_PROTOTYPE 0
280 #undef RELOCATABLE_NEEDS_FIXUP
281 #define RELOCATABLE_NEEDS_FIXUP 0
285 /* We use glibc _mcount for profiling. */
286 #define NO_PROFILE_COUNTERS 1
287 #define PROFILE_HOOK(LABEL) \
288 do { if (TARGET_64BIT) output_profile_hook (LABEL); } while (0)
290 /* PowerPC64 Linux word-aligns FP doubles when -malign-power is given. */
291 #undef ADJUST_FIELD_ALIGN
292 #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
293 (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED)) \
296 && TARGET_ALIGN_NATURAL == 0 \
297 && TYPE_MODE (strip_array_types (TREE_TYPE (FIELD))) == DFmode) \
298 ? MIN ((COMPUTED), 32) \
301 /* PowerPC64 Linux increases natural record alignment to doubleword if
302 the first field is an FP double, only if in power alignment mode. */
303 #undef ROUND_TYPE_ALIGN
304 #define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
306 && (TREE_CODE (STRUCT) == RECORD_TYPE \
307 || TREE_CODE (STRUCT) == UNION_TYPE \
308 || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
309 && TARGET_ALIGN_NATURAL == 0) \
310 ? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \
311 : MAX ((COMPUTED), (SPECIFIED)))
313 /* Use the default for compiling target libs. */
314 #ifdef IN_TARGET_LIBS
315 #undef TARGET_ALIGN_NATURAL
316 #define TARGET_ALIGN_NATURAL 1
319 /* Indicate that jump tables go in the text section. */
320 #undef JUMP_TABLES_IN_TEXT_SECTION
321 #define JUMP_TABLES_IN_TEXT_SECTION TARGET_64BIT
323 /* The linux ppc64 ABI isn't explicit on whether aggregates smaller
324 than a doubleword should be padded upward or downward. You could
325 reasonably assume that they follow the normal rules for structure
326 layout treating the parameter area as any other block of memory,
327 then map the reg param area to registers. i.e. pad upward.
328 Setting both of the following defines results in this behavior.
329 Setting just the first one will result in aggregates that fit in a
330 doubleword being padded downward, and others being padded upward.
331 Not a bad idea as this results in struct { int x; } being passed
332 the same way as an int. */
333 #define AGGREGATE_PADDING_FIXED TARGET_64BIT
334 #define AGGREGATES_PAD_UPWARD_ALWAYS 0
336 /* Specify padding for the last element of a block move between
337 registers and memory. FIRST is nonzero if this is the only
339 #define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \
340 (!(FIRST) ? upward : FUNCTION_ARG_PADDING (MODE, TYPE))
342 /* Linux doesn't support saving and restoring 64-bit regs in a 32-bit
344 #define OS_MISSING_POWERPC64 !TARGET_64BIT
347 #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
348 #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
349 #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
351 #define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
353 #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
354 #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
355 #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
357 #define OPTION_MUSL (linux_libc == LIBC_MUSL)
360 /* Determine what functions are present at the runtime;
361 this includes full c99 runtime and sincos. */
362 #undef TARGET_LIBC_HAS_FUNCTION
363 #define TARGET_LIBC_HAS_FUNCTION linux_libc_has_function
365 #undef TARGET_OS_CPP_BUILTINS
366 #define TARGET_OS_CPP_BUILTINS() \
371 builtin_define ("__PPC__"); \
372 builtin_define ("__PPC64__"); \
373 builtin_define ("__powerpc__"); \
374 builtin_define ("__powerpc64__"); \
376 builtin_define ("_CALL_LINUX"); \
377 builtin_assert ("cpu=powerpc64"); \
378 builtin_assert ("machine=powerpc64"); \
382 builtin_define_std ("PPC"); \
383 builtin_define_std ("powerpc"); \
384 builtin_assert ("cpu=powerpc"); \
385 builtin_assert ("machine=powerpc"); \
386 TARGET_OS_SYSV_CPP_BUILTINS (); \
391 #undef CPP_OS_DEFAULT_SPEC
392 #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux) %(include_extra)"
394 #undef LINK_SHLIB_SPEC
395 #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}"
397 #undef LIB_DEFAULT_SPEC
398 #define LIB_DEFAULT_SPEC "%(lib_linux)"
400 #undef STARTFILE_DEFAULT_SPEC
401 #define STARTFILE_DEFAULT_SPEC "%(startfile_linux)"
403 #undef ENDFILE_DEFAULT_SPEC
404 #define ENDFILE_DEFAULT_SPEC "%(endfile_linux)"
406 #undef LINK_START_DEFAULT_SPEC
407 #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
409 #undef LINK_OS_DEFAULT_SPEC
410 #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
412 #define GLIBC_DYNAMIC_LINKER32 "%(dynamic_linker_prefix)/lib/ld.so.1"
414 #ifdef LINUX64_DEFAULT_ABI_ELFv2
415 #define GLIBC_DYNAMIC_LINKER64 \
416 "%{mabi=elfv1:%(dynamic_linker_prefix)/lib64/ld64.so.1;" \
417 ":%(dynamic_linker_prefix)/lib64/ld64.so.2}"
419 #define GLIBC_DYNAMIC_LINKER64 \
420 "%{mabi=elfv2:%(dynamic_linker_prefix)/lib64/ld64.so.2;" \
421 ":%(dynamic_linker_prefix)/lib64/ld64.so.1}"
424 #define MUSL_DYNAMIC_LINKER32 \
425 "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
426 #define MUSL_DYNAMIC_LINKER64 \
427 "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
429 #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
430 #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
431 #if DEFAULT_LIBC == LIBC_UCLIBC
432 #define CHOOSE_DYNAMIC_LINKER(G, U, M) \
433 "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
434 #elif DEFAULT_LIBC == LIBC_GLIBC
435 #define CHOOSE_DYNAMIC_LINKER(G, U, M) \
436 "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
437 #elif DEFAULT_LIBC == LIBC_MUSL
438 #define CHOOSE_DYNAMIC_LINKER(G, U, M) \
439 "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
441 #error "Unsupported DEFAULT_LIBC"
443 #define GNU_USER_DYNAMIC_LINKER32 \
444 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
445 MUSL_DYNAMIC_LINKER32)
446 #define GNU_USER_DYNAMIC_LINKER64 \
447 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
448 MUSL_DYNAMIC_LINKER64)
450 #undef DEFAULT_ASM_ENDIAN
451 #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
452 #define DEFAULT_ASM_ENDIAN " -mlittle"
453 #define LINK_OS_LINUX_EMUL32 ENDIAN_SELECT(" -m elf32ppclinux", \
454 " -m elf32lppclinux", \
455 " -m elf32lppclinux")
456 #define LINK_OS_LINUX_EMUL64 ENDIAN_SELECT(" -m elf64ppc", \
460 #define DEFAULT_ASM_ENDIAN " -mbig"
461 #define LINK_OS_LINUX_EMUL32 ENDIAN_SELECT(" -m elf32ppclinux", \
462 " -m elf32lppclinux", \
464 #define LINK_OS_LINUX_EMUL64 ENDIAN_SELECT(" -m elf64ppc", \
469 #define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " %{!shared: %{!static: \
470 %{rdynamic:-export-dynamic} \
471 -dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}} \
472 %(link_os_extra_spec32)"
474 #define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " %{!shared: %{!static: \
475 %{rdynamic:-export-dynamic} \
476 -dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}} \
477 %(link_os_extra_spec64)"
479 #undef TOC_SECTION_ASM_OP
480 #define TOC_SECTION_ASM_OP \
482 ? "\t.section\t\".toc\",\"aw\"" \
483 : "\t.section\t\".got\",\"aw\"")
485 #undef MINIMAL_TOC_SECTION_ASM_OP
486 #define MINIMAL_TOC_SECTION_ASM_OP \
488 ? "\t.section\t\".toc1\",\"aw\"" \
489 : ((TARGET_RELOCATABLE || flag_pic) \
490 ? "\t.section\t\".got2\",\"aw\"" \
491 : "\t.section\t\".got1\",\"aw\""))
493 /* Must be at least as big as our pointer type. */
495 #define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")
498 #define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int")
501 #define WCHAR_TYPE (TARGET_64BIT ? "int" : "long int")
502 #undef WCHAR_TYPE_SIZE
503 #define WCHAR_TYPE_SIZE 32
506 #define RS6000_MCOUNT "_mcount"
509 /* _init and _fini functions are built from bits spread across many
510 object files, each potentially with a different TOC pointer. For
511 that reason, place a nop after the call so that the linker can
512 restore the TOC pointer if a TOC adjusting call stub is needed. */
514 #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
515 asm (SECTION_OP "\n" \
520 #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
521 asm (SECTION_OP "\n" \
528 /* FP save and restore routines. */
529 #undef SAVE_FP_PREFIX
530 #define SAVE_FP_PREFIX (TARGET_64BIT ? "._savef" : "_savefpr_")
531 #undef SAVE_FP_SUFFIX
532 #define SAVE_FP_SUFFIX ""
533 #undef RESTORE_FP_PREFIX
534 #define RESTORE_FP_PREFIX (TARGET_64BIT ? "._restf" : "_restfpr_")
535 #undef RESTORE_FP_SUFFIX
536 #define RESTORE_FP_SUFFIX ""
538 /* Dwarf2 debugging. */
539 #undef PREFERRED_DEBUGGING_TYPE
540 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
542 /* This is how to declare the size of a function. */
543 #undef ASM_DECLARE_FUNCTION_SIZE
544 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
547 if (!flag_inhibit_size_directive) \
549 fputs ("\t.size\t", (FILE)); \
550 if (TARGET_64BIT && DOT_SYMBOLS) \
551 putc ('.', (FILE)); \
552 assemble_name ((FILE), (FNAME)); \
553 fputs (",.-", (FILE)); \
554 rs6000_output_function_entry (FILE, FNAME); \
555 putc ('\n', (FILE)); \
560 /* Return nonzero if this entry is to be written into the constant
561 pool in a special way. We do so if this is a SYMBOL_REF, LABEL_REF
562 or a CONST containing one of them. If -mfp-in-toc (the default),
563 we also do this for floating-point constants. We actually can only
564 do this if the FP formats of the target and host machines are the
565 same, but we can't check that since not every file that uses
566 the macros includes real.h. We also do this when we can write the
567 entry into the TOC and the entry is not larger than a TOC entry. */
569 #undef ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
570 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) \
572 && (GET_CODE (X) == SYMBOL_REF \
573 || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \
574 && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \
575 || GET_CODE (X) == LABEL_REF \
576 || (GET_CODE (X) == CONST_INT \
577 && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode)) \
578 || (GET_CODE (X) == CONST_DOUBLE \
580 && (TARGET_MINIMAL_TOC \
581 || (SCALAR_FLOAT_MODE_P (GET_MODE (X)) \
582 && ! TARGET_NO_FP_IN_TOC))) \
584 && !TARGET_NO_FP_IN_TOC \
585 && !TARGET_RELOCATABLE \
586 && SCALAR_FLOAT_MODE_P (GET_MODE (X)) \
587 && BITS_PER_WORD == HOST_BITS_PER_INT)))))
589 /* Select a format to encode pointers in exception handling data. CODE
590 is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
591 true if the symbol may be affected by dynamic relocations. */
592 #undef ASM_PREFERRED_EH_DATA_FORMAT
593 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
594 ((TARGET_64BIT || flag_pic || TARGET_RELOCATABLE) \
595 ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel \
596 | (TARGET_64BIT ? DW_EH_PE_udata8 : DW_EH_PE_sdata4)) \
599 /* For backward compatibility, we must continue to use the AIX
600 structure return convention. */
601 #undef DRAFT_V4_STRUCT_RET
602 #define DRAFT_V4_STRUCT_RET (!TARGET_64BIT)
604 #ifdef TARGET_LIBC_PROVIDES_SSP
605 /* ppc32 glibc provides __stack_chk_guard in -0x7008(2),
606 ppc64 glibc provides it at -0x7010(13). */
607 #define TARGET_THREAD_SSP_OFFSET (TARGET_64BIT ? -0x7010 : -0x7008)
610 #define POWERPC_LINUX
612 /* ppc{32,64} linux has 128-bit long double support in glibc 2.4 and later. */
613 #ifdef TARGET_DEFAULT_LONG_DOUBLE_128
614 #define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128
617 /* Static stack checking is supported by means of probes. */
618 #define STACK_CHECK_STATIC_BUILTIN 1
620 /* The default value isn't sufficient in 64-bit mode. */
621 #define STACK_CHECK_PROTECT (TARGET_64BIT ? 16 * 1024 : 12 * 1024)
623 /* Software floating point support for exceptions and rounding modes
624 depends on the C library in use. */
625 #undef TARGET_FLOAT_EXCEPTIONS_ROUNDING_SUPPORTED_P
626 #define TARGET_FLOAT_EXCEPTIONS_ROUNDING_SUPPORTED_P \
627 rs6000_linux_float_exceptions_rounding_supported_p
629 /* Support for TARGET_ATOMIC_ASSIGN_EXPAND_FENV without FPRs depends
630 on glibc 2.19 or greater. */
631 #if TARGET_GLIBC_MAJOR > 2 \
632 || (TARGET_GLIBC_MAJOR == 2 && TARGET_GLIBC_MINOR >= 19)
633 #define RS6000_GLIBC_ATOMIC_FENV 1