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