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