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