stdio.h not needed
[fw/sdcc] / support / cpp / 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
26 /* Specify predefined symbols in preprocessor.  */
27
28 #undef CPP_PREDEFINES
29 #define CPP_PREDEFINES "-Di386"
30
31 #undef DBX_DEBUGGING_INFO
32 #define SDB_DEBUGGING_INFO
33
34 /* Support the ctors and dtors sections for g++.  */
35
36 #define CTORS_SECTION_ASM_OP    ".section\t.ctors,\"x\""
37 #define DTORS_SECTION_ASM_OP    ".section\t.dtors,\"x\""
38
39 /* A list of other sections which the compiler might be "in" at any
40    given time.  */
41
42 #undef EXTRA_SECTIONS
43 #define EXTRA_SECTIONS in_ctors, in_dtors
44
45 /* A list of extra section function definitions.  */
46
47 #undef EXTRA_SECTION_FUNCTIONS
48 #define EXTRA_SECTION_FUNCTIONS                                         \
49   CTORS_SECTION_FUNCTION                                                \
50   DTORS_SECTION_FUNCTION
51
52 #define CTORS_SECTION_FUNCTION                                          \
53 void                                                                    \
54 ctors_section ()                                                        \
55 {                                                                       \
56   if (in_section != in_ctors)                                           \
57     {                                                                   \
58       fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP);             \
59       in_section = in_ctors;                                            \
60     }                                                                   \
61 }
62
63 #define DTORS_SECTION_FUNCTION                                          \
64 void                                                                    \
65 dtors_section ()                                                        \
66 {                                                                       \
67   if (in_section != in_dtors)                                           \
68     {                                                                   \
69       fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP);             \
70       in_section = in_dtors;                                            \
71     }                                                                   \
72 }
73
74 #define INT_ASM_OP ".long"
75
76 /* A C statement (sans semicolon) to output an element in the table of
77    global constructors.  */
78 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME)                               \
79   do {                                                                  \
80     ctors_section ();                                                   \
81     fprintf (FILE, "\t%s\t ", INT_ASM_OP);                              \
82     assemble_name (FILE, NAME);                                         \
83     fprintf (FILE, "\n");                                               \
84   } while (0)
85
86 /* A C statement (sans semicolon) to output an element in the table of
87    global destructors.  */
88 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME)                                \
89   do {                                                                  \
90     dtors_section ();                                                   \
91     fprintf (FILE, "\t%s\t ", INT_ASM_OP);                              \
92     assemble_name (FILE, NAME);                                         \
93     fprintf (FILE, "\n");                                               \
94   } while (0)
95
96
97 /* end of i386-coff.h */