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