OSDN Git Service

Initial revision
[pf3gnuchains/gcc-fork.git] / gcc / config / sparc / litecoff.h
1 /* Definitions of target machine for GNU compiler, for SPARClite w/o FPU, COFF.
2    Copyright (C) 1994 Free Software Foundation, Inc.
3    Written by Ken Raeburn (raeburn@cygnus.com).
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
20
21 #include "sparc/lite.h"
22
23 #undef ASM_OUTPUT_IDENT
24
25 /* This is copied from final.c and sparc.h.  */
26 #undef ASM_OUTPUT_SOURCE_LINE
27 #define ASM_OUTPUT_SOURCE_LINE(FILE, LINE)                      \
28 { if (write_symbols == SDB_DEBUG) {                             \
29     fprintf ((FILE), "\t.ln\t%d\n",                             \
30              ((sdb_begin_function_line > -1)                    \
31               ? (LINE) - sdb_begin_function_line : 1));         \
32   } else if (write_symbols == DBX_DEBUG) {                      \
33     static int sym_lineno = 1;                                  \
34     fprintf ((FILE), ".stabn 68,0,%d,LM%d\nLM%d:\n",            \
35              (LINE), sym_lineno, sym_lineno);                   \
36     sym_lineno += 1;                                            \
37   } }
38
39 #undef SELECT_SECTION
40 #undef SELECT_RTX_SECTION
41 #define BSS_SECTION_ASM_OP      ".section\t\".bss\""
42
43 #include "svr3.h"
44
45 #undef CPP_PREDEFINES
46 #define CPP_PREDEFINES "-Dsparc -Dsparclite -Acpu(sparc) -Amachine(sparc)"
47
48 /* just in case */
49 #undef DBX_DEBUGGING_INFO
50 #undef PREFERRED_DEBUGGING_TYPE
51 #define DBX_DEBUGGING_INFO
52 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
53
54 /* Support the ctors and dtors sections for g++.  */
55
56 #undef INIT_SECTION_ASM_OP
57
58 /* Support the ctors and dtors sections for g++.  */
59
60 #undef CTORS_SECTION_ASM_OP
61 #define CTORS_SECTION_ASM_OP    ".section\t.ctors,\"x\""
62 #undef DTORS_SECTION_ASM_OP
63 #define DTORS_SECTION_ASM_OP    ".section\t.dtors,\"x\""
64
65 /* A list of other sections which the compiler might be "in" at any
66    given time.  */
67
68 #undef EXTRA_SECTIONS
69 #define EXTRA_SECTIONS in_const, in_bss, in_ctors, in_dtors
70
71 /* A list of extra section function definitions.  */
72
73 #undef EXTRA_SECTION_FUNCTIONS
74 #define EXTRA_SECTION_FUNCTIONS                                         \
75   CONST_SECTION_FUNCTION                                                \
76   CTORS_SECTION_FUNCTION                                                \
77   DTORS_SECTION_FUNCTION
78
79 #define CTORS_SECTION_FUNCTION                                          \
80 void                                                                    \
81 ctors_section ()                                                        \
82 {                                                                       \
83   if (in_section != in_ctors)                                           \
84     {                                                                   \
85       fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP);             \
86       in_section = in_ctors;                                            \
87     }                                                                   \
88 }
89
90 #define DTORS_SECTION_FUNCTION                                          \
91 void                                                                    \
92 dtors_section ()                                                        \
93 {                                                                       \
94   if (in_section != in_dtors)                                           \
95     {                                                                   \
96       fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP);             \
97       in_section = in_dtors;                                            \
98     }                                                                   \
99 }
100
101 #define INT_ASM_OP ".long"
102
103 /* A C statement (sans semicolon) to output an element in the table of
104    global constructors.  */
105 #undef ASM_OUTPUT_CONSTRUCTOR
106 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME)                               \
107   do {                                                                  \
108     ctors_section ();                                                   \
109     fprintf (FILE, "\t%s\t ", INT_ASM_OP);                              \
110     assemble_name (FILE, NAME);                                         \
111     fprintf (FILE, "\n");                                               \
112   } while (0)
113
114 /* A C statement (sans semicolon) to output an element in the table of
115    global destructors.  */
116 #undef ASM_OUTPUT_DESTRUCTOR
117 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME)                                \
118   do {                                                                  \
119     dtors_section ();                                                   \
120     fprintf (FILE, "\t%s\t ", INT_ASM_OP);                              \
121     assemble_name (FILE, NAME);                                         \
122     fprintf (FILE, "\n");                                               \
123   } while (0)
124
125 #undef DO_GLOBAL_CTORS_BODY
126 #undef DO_GLOBAL_DTORS_BODY