freebsd.h revision 72151
155714Skris/* Base configuration file for all FreeBSD targets.
255714Skris   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
355714Skris
455714SkrisThis file is part of GNU CC.
555714Skris
655714SkrisGNU CC is free software; you can redistribute it and/or modify
755714Skrisit under the terms of the GNU General Public License as published by
855714Skristhe Free Software Foundation; either version 2, or (at your option)
955714Skrisany later version.
1055714Skris
1155714SkrisGNU CC is distributed in the hope that it will be useful,
1255714Skrisbut WITHOUT ANY WARRANTY; without even the implied warranty of
1355714SkrisMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1455714SkrisGNU General Public License for more details.
1555714Skris
1655714SkrisYou should have received a copy of the GNU General Public License
1755714Skrisalong with GNU CC; see the file COPYING.  If not, write to
1855714Skristhe Free Software Foundation, 59 Temple Place - Suite 330,
1955714SkrisBoston, MA 02111-1307, USA.  */
2055714Skris
2155714Skris/* Common FreeBSD configuration.
2255714Skris   All FreeBSD architectures should include this file, which will specify
2355714Skris   their commonalities.
2455714Skris   Adapted from /usr/src/contrib/gcc/config/i386/freebsd.h,
2555714Skris   /usr/src/contrib/gcc/config/svr4.h &
2655714Skris   egcs/gcc/config/i386/freebsd-elf.h version by David O'Brien  */
2755714Skris
2855714Skris/* $FreeBSD: head/contrib/gcc/config/freebsd.h 72151 2001-02-08 05:27:17Z obrien $ */
2955714Skris
3055714Skris
3155714Skris/* Cpp, assembler, linker, library, and startfile spec's.  */
3255714Skris
3355714Skris/* This defines which switch letters take arguments.  On FreeBSD, most of
3455714Skris   the normal cases (defined in gcc.c) apply, and we also have -h* and
3555714Skris   -z* options (for the linker) (comming from svr4).
3655714Skris   We also have -R (alias --rpath), no -z, --soname (-h), --assert etc.  */
3755714Skris
3855714Skris#define FBSD_SWITCH_TAKES_ARG(CHAR) \
3955714Skris  (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
4055714Skris   || (CHAR) == 'h' \
4155714Skris   || (CHAR) == 'z' /* ignored by ld */ \
4255714Skris   || (CHAR) == 'R')
4355714Skris
4455714Skris#undef  SWITCH_TAKES_ARG
4555714Skris#define SWITCH_TAKES_ARG(CHAR)	(FBSD_SWITCH_TAKES_ARG(CHAR))
4655714Skris
4755714Skris/* This defines which multi-letter switches take arguments.  */
4855714Skris
4955714Skris#define FBSD_WORD_SWITCH_TAKES_ARG(STR)					\
5055714Skris  (DEFAULT_WORD_SWITCH_TAKES_ARG (STR)					\
5155714Skris   || !strcmp ((STR), "rpath") || !strcmp ((STR), "rpath-link")		\
5255714Skris   || !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") 		\
5355714Skris   || !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker"))
5455714Skris
5555714Skris#undef  WORD_SWITCH_TAKES_ARG
5655714Skris#define WORD_SWITCH_TAKES_ARG(STR)	(FBSD_WORD_SWITCH_TAKES_ARG(STR))
5755714Skris
5855714Skris/* Place spaces around this string.  We depend on string splicing to produce
5955714Skris   the final CPP_PREDEFINES value.  */
6055714Skris#define FBSD_CPP_PREDEFINES " -Dunix -D__FreeBSD__=5 -D__FreeBSD_cc_version=500002 -Asystem(unix) -Asystem(FreeBSD) "
6155714Skris
6255714Skris#define FBSD_CPP_SPEC "\
6355714Skris  %(cpp_cpu) \
6455714Skris  %{!maout: -D__ELF__} \
6555714Skris  %{munderscores: -D__UNDERSCORES__} \
6655714Skris  %{maout: %{!mno-underscores: -D__UNDERSCORES__}} \
6755714Skris  %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} \
6855714Skris  %{posix:-D_POSIX_SOURCE}"
6955714Skris
7055714Skris#undef  CPP_SPEC
7155714Skris#define CPP_SPEC FBSD_CPP_SPEC
7255714Skris
7355714Skris/* Provide a LIB_SPEC appropriate for FreeBSD.  Just select the appropriate
7455714Skris   libc, depending on whether we're doing profiling.  Add the appropriate
7555714Skris   libc_r if supporting threads.
7655714Skris   (like the default, except no -lg, and no -p).  */
7755714Skris#undef  LIB_SPEC
7855714Skris#define LIB_SPEC "\
7955714Skris  %{!shared: \
8055714Skris    %{!pg: %{pthread:-lc_r} -lc} \
8155714Skris    %{pg:  %{pthread:-lc_r_p} -lc_p} \
8255714Skris  }"
8355714Skris
8455714Skris
8555714Skris/************************[  Target stuff  ]***********************************/
8655714Skris
8755714Skris/* All FreeBSD Architectures support the ELF object file format.  */
8855714Skris#undef  OBJECT_FORMAT_ELF
8955714Skris#define OBJECT_FORMAT_ELF
9055714Skris
9155714Skris/* Don't assume anything about the header files.  */
9255714Skris#undef  NO_IMPLICIT_EXTERN_C
9355714Skris#define NO_IMPLICIT_EXTERN_C
9455714Skris
9555714Skris/* Implicit library calls should use memcpy, not bcopy, etc.  */
9655714Skris#undef  TARGET_MEM_FUNCTIONS
9755714Skris#define TARGET_MEM_FUNCTIONS
9855714Skris
9955714Skris/* Allow #sccs in preprocessor.  */
10055714Skris#undef  SCCS_DIRECTIVE
10155714Skris#define SCCS_DIRECTIVE
10255714Skris
10355714Skris/* Tell libgcc2.c that FreeBSD targets support atexit(3).  */
10455714Skris#undef  HAVE_ATEXIT
10555714Skris#define HAVE_ATEXIT
10655714Skris
10755714Skris/* Code generation parameters.  */
10855714Skris
10955714Skris/* Don't default to pcc-struct-return, because gcc is the only compiler, and
11055714Skris   we want to retain compatibility with older gcc versions
11155714Skris   (even though the svr4 ABI for the i386 says that records and unions are
11255714Skris   returned in memory).  */
11355714Skris#undef  DEFAULT_PCC_STRUCT_RETURN
11455714Skris#define DEFAULT_PCC_STRUCT_RETURN 0
11555714Skris
11655714Skris/* Writing `int' for a bitfield forces int alignment for the structure.  */
11755714Skris/* XXX: ok for Alpha??  */
11855714Skris#undef  PCC_BITFIELD_TYPE_MATTERS
11955714Skris#define PCC_BITFIELD_TYPE_MATTERS 1
12055714Skris
12155714Skris/* Use periods rather than dollar signs in special g++ assembler names.
12255714Skris   This ensures the configuration knows our system correctly so we can link
12355714Skris   with libraries compiled with the native cc.  */
12455714Skris#undef NO_DOLLAR_IN_LABEL
125
126/* The prefix to add to user-visible assembler symbols.
127   For System V Release 4 & ELF the convention is *not* to prepend a leading
128   underscore onto user-level symbol names.  */
129
130#undef  USER_LABEL_PREFIX
131#define USER_LABEL_PREFIX ""
132
133/* Handle #pragma weak and #pragma pack.  */
134#undef  HANDLE_SYSV_PRAGMA
135#define HANDLE_SYSV_PRAGMA
136
137/* FreeBSD ELF using our home-grown crtbegin.o/crtend.o does not support the
138   DWARF2 unwinding mechanisms.  Once `make world' bootstraping problems with
139   the EGCS crtstuff.c is overcome, we will switch to the non-sjlj-exceptions
140   type exception machanism.  */
141#define DWARF2_UNWIND_INFO 0
142
143/* Do not use ``thunks'' to implement C++ vtables.  This method still has
144   fatal bugs.  Also, GCC 3.0 will have a new C++ ABI that may not even
145   support `thunks'.  */
146#undef DEFAULT_VTABLE_THUNKS
147
148
149/************************[  Assembler stuff  ]********************************/
150
151/* Override the default comment-starter of "/".  */
152#undef  ASM_COMMENT_START
153#define ASM_COMMENT_START	"#"
154
155/* Attach a special .ident directive to the end of the file to identify
156   the version of GCC which compiled this code.  The format of the
157   .ident string is patterned after the ones produced by native svr4
158   C compilers.  */
159
160#undef  IDENT_ASM_OP
161#define IDENT_ASM_OP	".ident"
162
163/* Output #ident as a .ident.  */
164
165#undef  ASM_OUTPUT_IDENT
166#define ASM_OUTPUT_IDENT(FILE, NAME) \
167  fprintf ((FILE), "\t%s\t\"%s\"\n", IDENT_ASM_OP, (NAME));
168
169/* Identify the front-end which produced this file.  To keep symbol
170   space down, and not confuse kdb, only do this if the language is
171   not C. (svr4.h defines ASM_IDENTIFY_GCC but neglects this) */
172
173#undef  ASM_IDENTIFY_LANGUAGE
174#define ASM_IDENTIFY_LANGUAGE(FILE)					\
175  {									\
176    if (strcmp (lang_identify (), "c") != 0)				\
177        output_lang_identify (FILE);					\
178  }
179
180#undef  ASM_FILE_END
181#define ASM_FILE_END(FILE)						\
182  do {				 					\
183    if (!flag_no_ident)							\
184      fprintf ((FILE), "\t%s\t\"[ASM_FILE_END]GCC: (%s) %s\"\n",	\
185		IDENT_ASM_OP, lang_identify(), version_string);		\
186  } while (0)
187
188/* This is the pseudo-op used to generate a contiguous sequence of byte
189   values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
190   AUTOMATICALLY APPENDED.  This is the same for most svr4 assemblers.  */
191
192#undef  ASCII_DATA_ASM_OP
193#define ASCII_DATA_ASM_OP	".ascii"
194
195#undef  ASM_BYTE_OP
196#define ASM_BYTE_OP		".byte"
197
198/* This is how to allocate empty space in some section.  The .zero
199   pseudo-op is used for this on most ELF assemblers.  */
200
201#undef  SKIP_ASM_OP
202#define SKIP_ASM_OP		".zero"
203
204/* How to output some space.  The rules are different depending on the
205   object format.  */
206#undef  ASM_OUTPUT_SKIP
207#define ASM_OUTPUT_SKIP(FILE, SIZE) 					\
208  do {									\
209    if (TARGET_ELF)							\
210      {									\
211        fprintf ((FILE), "\t%s\t%u\n", SKIP_ASM_OP, (SIZE));		\
212      }									\
213    else								\
214      {									\
215        fprintf ((FILE), "\t.space %u\n", (SIZE));			\
216      }									\
217  } while (0)
218
219/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
220   ASM_OUTPUT_LIMITED_STRING macros.  Each byte in the table
221   corresponds to a particular byte value [0..255].  For any
222   given byte value, if the value in the corresponding table
223   position is zero, the given character can be output directly.
224   If the table value is 1, the byte must be output as a \ooo
225   octal escape.  If the tables value is anything else, then the
226   byte value should be output as a \ followed by the value
227   in the table.  Note that we can use standard UN*X escape
228   sequences for many control characters, but we don't use
229   \a to represent BEL because some svr4 assemblers (e.g. on
230   the i386) don't know about that.  Also, we don't use \v
231   since some versions of gas, such as 2.2 did not accept it.  */
232
233#define ESCAPES \
234"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
235\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
236\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
237\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
238\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
239\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
240\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
241\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
242
243/* Some svr4 assemblers have a limit on the number of characters which
244   can appear in the operand of a .string directive.  If your assembler
245   has such a limitation, you should define STRING_LIMIT to reflect that
246   limit.  Note that at least some svr4 assemblers have a limit on the
247   actual number of bytes in the double-quoted string, and that they
248   count each character in an escape sequence as one byte.  Thus, an
249   escape sequence like \377 would count as four bytes.
250
251   If your target assembler doesn't support the .string directive, you
252   should define this to zero.
253*/
254
255#undef  STRING_LIMIT
256#define STRING_LIMIT	((unsigned) 256)
257
258#undef  STRING_ASM_OP
259#define STRING_ASM_OP	".string"
260
261/* Output the label which precedes a jumptable.  Note that for all svr4/ELF
262   systems where we actually generate jumptables (which is to say every
263   svr4 target except i386, where we use casesi instead) we put the jump-
264   tables into the .rodata section and since other stuff could have been
265   put into the .rodata section prior to any given jumptable, we have to
266   make sure that the location counter for the .rodata section gets pro-
267   perly re-aligned prior to the actual beginning of the jump table.  */
268
269#undef  ALIGN_ASM_OP
270#define ALIGN_ASM_OP	".align"
271
272/* This says how to output assembler code to declare an
273   uninitialized external linkage data object.  Under SVR4/ELF,
274   the linker seems to want the alignment of data objects
275   to depend on their types.  We do exactly that here.  */
276
277#undef  COMMON_ASM_OP
278#define COMMON_ASM_OP	".comm"
279
280#undef  ASM_OUTPUT_ALIGNED_COMMON
281#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN)		\
282  do {									\
283    if (TARGET_ELF)							\
284      {							\
285	fprintf ((FILE), "\t%s\t", COMMON_ASM_OP);			\
286	assemble_name ((FILE), (NAME));					\
287	fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT);	\
288      }									\
289    else								\
290      {									\
291	int rounded = (SIZE);						\
292	if (rounded == 0) rounded = 1;					\
293	rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1;		\
294	rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT)	\
295		   * (BIGGEST_ALIGNMENT / BITS_PER_UNIT));		\
296	fputs (".comm ", (FILE));					\
297	assemble_name ((FILE), (NAME));					\
298	fprintf ((FILE), ",%u\n", (rounded));				\
299      }									\
300  } while (0)
301
302/* This says how to output assembler code to declare an
303   uninitialized internal linkage data object.  Under SVR4/ELF,
304   the linker seems to want the alignment of data objects
305   to depend on their types.  We do exactly that here.  */
306
307#undef  LOCAL_ASM_OP
308#define LOCAL_ASM_OP	".local"
309
310/* This says how to output assembler code to declare an
311   uninitialized internal linkage data object.  Under SVR4,
312   the linker seems to want the alignment of data objects
313   to depend on their types.  We do exactly that here.  */
314
315#undef  ASM_OUTPUT_ALIGNED_LOCAL
316#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN)		\
317  do {									\
318    if (TARGET_ELF)							\
319      {									\
320	fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP);			\
321	assemble_name ((FILE), (NAME));					\
322	fprintf ((FILE), "\n");						\
323	ASM_OUTPUT_ALIGNED_COMMON ((FILE), (NAME), (SIZE), (ALIGN));	\
324      }									\
325    else								\
326      {									\
327	int rounded = (SIZE);						\
328	if (rounded == 0) rounded = 1;					\
329	rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1;		\
330	rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT)	\
331		   * (BIGGEST_ALIGNMENT / BITS_PER_UNIT));		\
332	fputs (".lcomm ", (FILE));					\
333	assemble_name ((FILE), (NAME));					\
334	fprintf ((FILE), ",%u\n", (rounded));				\
335      }									\
336  } while (0)
337
338#undef  ASM_OUTPUT_BEFORE_CASE_LABEL
339#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE, PREFIX, NUM, TABLE)		\
340  ASM_OUTPUT_ALIGN ((FILE), 2);
341
342#undef  ASM_OUTPUT_CASE_LABEL
343#define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE)		\
344  do {									\
345    ASM_OUTPUT_BEFORE_CASE_LABEL ((FILE), (PREFIX), (NUM), (JUMPTABLE))	\
346    ASM_OUTPUT_INTERNAL_LABEL ((FILE), (PREFIX), (NUM));		\
347  } while (0)
348
349/* The standard SVR4/ELF assembler seems to require that certain builtin
350   library routines (e.g. .udiv) be explicitly declared as .globl
351   in each assembly file where they are referenced.  */
352
353#undef  ASM_OUTPUT_EXTERNAL_LIBCALL
354#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN)				\
355  ASM_GLOBALIZE_LABEL ((FILE), XSTR ((FUN), 0))
356
357/* Support const sections and the ctors and dtors sections for g++.
358   Note that there appears to be two different ways to support const
359   sections at the moment.  You can either #define the symbol
360   READONLY_DATA_SECTION (giving it some code which switches to the
361   readonly data section) or else you can #define the symbols
362   EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
363   SELECT_RTX_SECTION.  We do both here just to be on the safe side.
364   FreeBSD conditionalizes the use of ".section rodata" depending on
365   ELF mode - otherwise .text.  */
366
367#undef  USE_CONST_SECTION
368#define USE_CONST_SECTION	TARGET_ELF
369
370#undef  CONST_SECTION_ASM_OP
371#define CONST_SECTION_ASM_OP	".section\t.rodata"
372
373/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
374
375   Note that we want to give these sections the SHF_WRITE attribute
376   because these sections will actually contain data (i.e. tables of
377   addresses of functions in the current root executable or shared library
378   file) and, in the case of a shared library, the relocatable addresses
379   will have to be properly resolved/relocated (and then written into) by
380   the dynamic linker when it actually attaches the given shared library
381   to the executing process.  (Note that on SVR4, you may wish to use the
382   `-z text' option to the ELF linker, when building a shared library, as
383   an additional check that you are doing everything right.  But if you do
384   use the `-z text' option when building a shared library, you will get
385   errors unless the .ctors and .dtors sections are marked as writable
386   via the SHF_WRITE attribute.)  */
387
388#undef  CTORS_SECTION_ASM_OP
389#define CTORS_SECTION_ASM_OP	".section\t.ctors,\"aw\""
390#undef  DTORS_SECTION_ASM_OP
391#define DTORS_SECTION_ASM_OP	".section\t.dtors,\"aw\""
392
393/* On svr4, we *do* have support for the .init and .fini sections, and we
394   can put stuff in there to be executed before and after `main'.  We let
395   crtstuff.c and other files know this by defining the following symbols.
396   The definitions say how to change sections to the .init and .fini
397   sections.  This is the same for all known svr4 assemblers.  */
398
399#undef  INIT_SECTION_ASM_OP
400#define INIT_SECTION_ASM_OP	".section\t.init"
401#undef  FINI_SECTION_ASM_OP
402#define FINI_SECTION_ASM_OP	".section\t.fini"
403
404/* A default list of other sections which we might be "in" at any given
405   time.  For targets that use additional sections (e.g. .tdesc) you
406   should override this definition in the target-specific file which
407   includes this file.  */
408
409#undef  EXTRA_SECTIONS
410#define EXTRA_SECTIONS	in_const, in_ctors, in_dtors
411
412/* A default list of extra section function definitions.  For targets
413   that use additional sections (e.g. .tdesc) you should override this
414   definition in the target-specific file which includes this file.  */
415
416#undef  EXTRA_SECTION_FUNCTIONS
417#define EXTRA_SECTION_FUNCTIONS						\
418  CONST_SECTION_FUNCTION						\
419  CTORS_SECTION_FUNCTION						\
420  DTORS_SECTION_FUNCTION
421
422#undef  READONLY_DATA_SECTION
423#define READONLY_DATA_SECTION()	const_section ()
424
425extern void text_section ();
426
427#undef  CONST_SECTION_FUNCTION
428#define CONST_SECTION_FUNCTION						\
429  void									\
430  const_section ()							\
431  {									\
432    if (!USE_CONST_SECTION)						\
433      text_section();							\
434    else if (in_section != in_const)					\
435      {									\
436	fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP);		\
437	in_section = in_const;						\
438      }									\
439  }
440
441#undef  CTORS_SECTION_FUNCTION
442#define CTORS_SECTION_FUNCTION						\
443  void									\
444  ctors_section ()							\
445  {									\
446    if (in_section != in_ctors)						\
447      {									\
448	fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP);		\
449	in_section = in_ctors;						\
450      }									\
451  }
452
453#undef  DTORS_SECTION_FUNCTION
454#define DTORS_SECTION_FUNCTION						\
455  void									\
456  dtors_section ()							\
457  {									\
458    if (in_section != in_dtors)						\
459      {									\
460 	fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP);		\
461	in_section = in_dtors;						\
462      }									\
463  }
464
465/* A C statement (sans semicolon) to output an element in the table of
466   global constructors.  */
467#undef  ASM_OUTPUT_CONSTRUCTOR
468#define ASM_OUTPUT_CONSTRUCTOR(FILE, NAME)				\
469  do {									\
470    if (TARGET_ELF)							\
471      {									\
472	ctors_section ();						\
473	fprintf ((FILE), "\t%s\t ", INT_ASM_OP);			\
474	assemble_name ((FILE), (NAME));					\
475	fprintf ((FILE), "\n");						\
476      }									\
477    else								\
478      {									\
479	fprintf (asm_out_file, "%s \"%s__CTOR_LIST__\",22,0,0,",	\
480		 ASM_STABS_OP, (TARGET_UNDERSCORES) ? "_" : "");	\
481	assemble_name (asm_out_file, name);				\
482	fputc ('\n', asm_out_file);					\
483      }									\
484  } while (0)
485
486/* A C statement (sans semicolon) to output an element in the table of
487   global destructors.  */
488#undef  ASM_OUTPUT_DESTRUCTOR
489#define ASM_OUTPUT_DESTRUCTOR(FILE, NAME)				\
490  do {									\
491    if (TARGET_ELF)							\
492      {									\
493	dtors_section ();						\
494	fprintf ((FILE), "\t%s\t ", INT_ASM_OP);			\
495	assemble_name ((FILE), (NAME));					\
496	fprintf ((FILE), "\n");						\
497      }									\
498    else								\
499      {									\
500	fprintf (asm_out_file, "%s \"%s__DTOR_LIST__\",22,0,0,",	\
501		 ASM_STABS_OP, (TARGET_UNDERSCORES) ? "_" : "");	\
502	assemble_name (asm_out_file, name);				\
503	fputc ('\n', asm_out_file);					\
504      }									\
505  } while (0)
506
507/* A C statement or statements to switch to the appropriate
508   section for output of RTX in mode MODE.  RTX is some kind
509   of constant in RTL.  The argument MODE is redundant except
510   in the case of a `const_int' rtx.  Currently, these always
511   go into the const section.  */
512
513#undef  SELECT_RTX_SECTION
514#define SELECT_RTX_SECTION(MODE, RTX)	const_section()
515
516/* Define the strings used for the special svr4/ELF .type and .size
517   directives.  These strings generally do not vary from one svr4/ELF
518   system to another.  */
519
520#undef  TYPE_ASM_OP
521#define TYPE_ASM_OP	".type"
522#undef  SIZE_ASM_OP
523#define SIZE_ASM_OP	".size"
524
525/* This is how we tell the assembler that a symbol is weak.  */
526
527#undef  ASM_WEAKEN_LABEL
528#define ASM_WEAKEN_LABEL(FILE, NAME)					\
529  do {									\
530    fputs ("\t.globl\t", (FILE)); assemble_name ((FILE), (NAME));	\
531    fputc ('\n', (FILE));						\
532    fputs ("\t.weak\t", (FILE)); assemble_name ((FILE), (NAME));	\
533    fputc ('\n', (FILE));						\
534  } while (0)
535
536/* The following macro defines the [default] format used with ELF to output
537   the second operand of the .type assembler directive.  */
538
539#undef  TYPE_OPERAND_FMT
540#define TYPE_OPERAND_FMT	"@%s"
541
542/* Write the extra assembler code needed to declare a function's result.
543   Most svr4/ELF assemblers don't require any special declaration of the
544   result value.  */
545
546#undef  ASM_DECLARE_RESULT
547#define ASM_DECLARE_RESULT(FILE, RESULT)
548
549/* These macros generate the special .type and .size directives which
550   are used to set the corresponding fields of the linker symbol table
551   entries in an ELF object file under SVR4/ELF.  These macros also output
552   the starting labels for the relevant functions/objects.  */
553
554/* Write the extra assembler code needed to declare an object properly.  */
555
556#undef  ASM_DECLARE_OBJECT_NAME
557#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL)			\
558  do {									\
559    fprintf (FILE, "\t%s\t ", TYPE_ASM_OP);				\
560    assemble_name (FILE, NAME);						\
561    putc (',', FILE);							\
562    fprintf (FILE, TYPE_OPERAND_FMT, "object");				\
563    putc ('\n', FILE);							\
564    size_directive_output = 0;						\
565    if (!flag_inhibit_size_directive && DECL_SIZE (DECL))		\
566      {									\
567	size_directive_output = 1;					\
568	fprintf (FILE, "\t%s\t ", SIZE_ASM_OP);				\
569	assemble_name (FILE, NAME);					\
570	putc (',', FILE);						\
571	fprintf (FILE, HOST_WIDE_INT_PRINT_DEC,				\
572		 int_size_in_bytes (TREE_TYPE (DECL)));			\
573	fputc ('\n', FILE);						\
574      }									\
575    ASM_OUTPUT_LABEL(FILE, NAME);					\
576  } while (0)
577
578/* Output the size directive for a decl in rest_of_decl_compilation
579   in the case where we did not do so before the initializer.
580   Once we find the error_mark_node, we know that the value of
581   size_directive_output was set
582   by ASM_DECLARE_OBJECT_NAME when it was run for the same decl.  */
583
584#undef  ASM_FINISH_DECLARE_OBJECT
585#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END)	\
586  do {									\
587    char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0);			\
588    if (!flag_inhibit_size_directive && DECL_SIZE (DECL)		\
589	&& ! AT_END && TOP_LEVEL					\
590	&& DECL_INITIAL (DECL) == error_mark_node			\
591	&& !size_directive_output)					\
592      {									\
593	size_directive_output = 1;					\
594	fprintf (FILE, "\t%s\t ", SIZE_ASM_OP);				\
595	assemble_name (FILE, name);					\
596	putc (',', FILE);						\
597	fprintf (FILE, HOST_WIDE_INT_PRINT_DEC,				\
598		int_size_in_bytes (TREE_TYPE (DECL))); 			\
599	fputc ('\n', FILE);						\
600      }									\
601  } while (0)
602
603
604/************************[  Debugger stuff  ]*********************************/
605
606/* All ELF targets can support DWARF-2.  */
607#undef  DWARF2_DEBUGGING_INFO
608#define DWARF2_DEBUGGING_INFO
609
610/* This is BSD, so we want the DBX format.  */
611#undef  DBX_DEBUGGING_INFO
612#define DBX_DEBUGGING_INFO
613
614/* Use stabs instead of DWARF debug format.  */
615#undef  PREFERRED_DEBUGGING_TYPE
616#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
617
618/* But allow STABS to be supported as well.
619   	Note that we want to override some definition settings done for some
620   	architecture's native OS's tools that don't apply to us.  */
621#undef ASM_IDENTIFY_GCC
622#undef ASM_IDENTIFY_LANGUAGE
623
624#include "dbxelf.h"
625