OSDN Git Service

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