Initial import from FreeBSD RELENG_4:
[dragonfly.git] / contrib / gcc / config / i386 / i386-coff.h
1 /* Definitions for "naked" Intel 386 using coff object format files
2    and coff debugging info.
3
4    Copyright (C) 1994 Free Software Foundation, Inc.
5
6 This file is part of GNU CC.
7
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
12
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING.  If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA.  */
22
23
24 #include "i386/gas.h"
25 #include "dbxcoff.h"
26
27 /* Specify predefined symbols in preprocessor.  */
28
29 #undef CPP_PREDEFINES
30 #define CPP_PREDEFINES "-Di386"
31
32 /* We want to be able to get DBX debugging information via -gstabs.  */
33
34 #undef DBX_DEBUGGING_INFO
35 #define DBX_DEBUGGING_INFO
36
37 #undef PREFERRED_DEBUGGING_TYPE
38 #define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
39
40 /* Support the ctors and dtors sections for g++.  */
41
42 #define CTORS_SECTION_ASM_OP    ".section\t.ctors,\"x\""
43 #define DTORS_SECTION_ASM_OP    ".section\t.dtors,\"x\""
44
45 /* A list of other sections which the compiler might be "in" at any
46    given time.  */
47
48 #undef EXTRA_SECTIONS
49 #define EXTRA_SECTIONS in_ctors, in_dtors
50
51 /* A list of extra section function definitions.  */
52
53 #undef EXTRA_SECTION_FUNCTIONS
54 #define EXTRA_SECTION_FUNCTIONS                                         \
55   CTORS_SECTION_FUNCTION                                                \
56   DTORS_SECTION_FUNCTION
57
58 #define CTORS_SECTION_FUNCTION                                          \
59 void                                                                    \
60 ctors_section ()                                                        \
61 {                                                                       \
62   if (in_section != in_ctors)                                           \
63     {                                                                   \
64       fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP);             \
65       in_section = in_ctors;                                            \
66     }                                                                   \
67 }
68
69 #define DTORS_SECTION_FUNCTION                                          \
70 void                                                                    \
71 dtors_section ()                                                        \
72 {                                                                       \
73   if (in_section != in_dtors)                                           \
74     {                                                                   \
75       fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP);             \
76       in_section = in_dtors;                                            \
77     }                                                                   \
78 }
79
80 #define INT_ASM_OP ".long"
81
82 /* A C statement (sans semicolon) to output an element in the table of
83    global constructors.  */
84 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME)                               \
85   do {                                                                  \
86     ctors_section ();                                                   \
87     fprintf (FILE, "\t%s\t ", INT_ASM_OP);                              \
88     assemble_name (FILE, NAME);                                         \
89     fprintf (FILE, "\n");                                               \
90   } while (0)
91
92 /* A C statement (sans semicolon) to output an element in the table of
93    global destructors.  */
94 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME)                                \
95   do {                                                                  \
96     dtors_section ();                                                   \
97     fprintf (FILE, "\t%s\t ", INT_ASM_OP);                              \
98     assemble_name (FILE, NAME);                                         \
99     fprintf (FILE, "\n");                                               \
100   } while (0)
101
102
103 /* end of i386-coff.h */