OSDN Git Service

Use dbxcoff.h
[pf3gnuchains/gcc-fork.git] / gcc / config / m68k / coff.h
1 /* Definitions of target machine for GNU compiler.
2    m68k series COFF object files and debugging, version.
3    Copyright (C) 1994, 1996 Free Software Foundation, Inc.
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, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22 /* This file is included after m68k.h by CPU COFF specific files.  It
23    is not a complete target itself.  */
24
25 /* Generate sdb debugging information.  */
26
27 #define SDB_DEBUGGING_INFO
28
29 /* Output DBX (stabs) debugging information if using -gstabs.  */
30
31 #include "dbxcoff.h"
32
33 /* COFF symbols don't start with an underscore.  */
34
35 #undef USER_LABEL_PREFIX
36 #define USER_LABEL_PREFIX ""
37
38 /* Use a prefix for local labels, just to be on the save side.  */
39
40 #undef LOCAL_LABEL_PREFIX
41 #define LOCAL_LABEL_PREFIX "."
42
43 /* Use a register prefix to avoid clashes with external symbols (classic
44    example: `extern char PC;' in termcap).  */
45
46 #undef REGISTER_PREFIX
47 #define REGISTER_PREFIX "%"
48
49 /* In the machine description we can't use %R, because it will not be seen
50    by ASM_FPRINTF.  (Isn't that a design bug?).  */
51
52 #undef REGISTER_PREFIX_MD
53 #define REGISTER_PREFIX_MD "%%"
54
55 /* config/m68k.md has an explicit reference to the program counter,
56    prefix this by the register prefix.  */
57
58 #define ASM_RETURN_CASE_JUMP    return "jmp %%pc@(2,%0:w)"
59
60 /* Here are the new register names.  */
61
62 #undef REGISTER_NAMES
63 #ifndef SUPPORT_SUN_FPA
64 #define REGISTER_NAMES \
65 {"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7",        \
66  "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%sp",        \
67  "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7" }
68 #else /* SUPPORTED_SUN_FPA */
69 #define REGISTER_NAMES \
70 {"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7",        \
71  "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%sp",        \
72  "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7", \
73  "%fpa0", "%fpa1", "%fpa2", "%fpa3", "%fpa4", "%fpa5", "%fpa6", "%fpa7", \
74  "%fpa8", "%fpa9", "%fpa10", "%fpa11", "%fpa12", "%fpa13", "%fpa14", "%fpa15", \
75  "%fpa16", "%fpa17", "%fpa18", "%fpa19", "%fpa20", "%fpa21", "%fpa22", "%fpa23", \
76  "%fpa24", "%fpa25", "%fpa26", "%fpa27", "%fpa28", "%fpa29", "%fpa30", "%fpa31" }
77 #endif /* defined SUPPORT_SUN_FPA */
78
79 #undef ASM_FILE_START
80 #define ASM_FILE_START(FILE) \
81   output_file_directive ((FILE), main_input_filename)
82
83 /* Support the ctors and dtors sections for g++.  */
84
85 #define CTORS_SECTION_ASM_OP    ".section\t.ctors,\"x\""
86 #define DTORS_SECTION_ASM_OP    ".section\t.dtors,\"x\""
87
88 /* A list of other sections which the compiler might be "in" at any
89    given time.  */
90
91 #undef EXTRA_SECTIONS
92 #define EXTRA_SECTIONS in_ctors, in_dtors
93
94 /* A list of extra section function definitions.  */
95
96 #undef EXTRA_SECTION_FUNCTIONS
97 #define EXTRA_SECTION_FUNCTIONS                                         \
98   CTORS_SECTION_FUNCTION                                                \
99   DTORS_SECTION_FUNCTION
100
101 #define CTORS_SECTION_FUNCTION                                          \
102 void                                                                    \
103 ctors_section ()                                                        \
104 {                                                                       \
105   if (in_section != in_ctors)                                           \
106     {                                                                   \
107       fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP);             \
108       in_section = in_ctors;                                            \
109     }                                                                   \
110 }
111
112 #define DTORS_SECTION_FUNCTION                                          \
113 void                                                                    \
114 dtors_section ()                                                        \
115 {                                                                       \
116   if (in_section != in_dtors)                                           \
117     {                                                                   \
118       fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP);             \
119       in_section = in_dtors;                                            \
120     }                                                                   \
121 }
122
123 #define INT_ASM_OP ".long"
124
125 /* A C statement (sans semicolon) to output an element in the table of
126    global constructors.  */
127 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME)                               \
128   do {                                                                  \
129     ctors_section ();                                                   \
130     fprintf (FILE, "\t%s\t ", INT_ASM_OP);                              \
131     assemble_name (FILE, NAME);                                         \
132     fprintf (FILE, "\n");                                               \
133   } while (0)
134
135 /* A C statement (sans semicolon) to output an element in the table of
136    global destructors.  */
137 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME)                                \
138   do {                                                                  \
139     dtors_section ();                                                   \
140     fprintf (FILE, "\t%s\t ", INT_ASM_OP);                              \
141     assemble_name (FILE, NAME);                                         \
142     fprintf (FILE, "\n");                                               \
143   } while (0)
144
145 /* Don't assume anything about startfiles.  */
146
147 #define STARTFILE_SPEC ""