OSDN Git Service

(INIT_SECTION_ASM_OP): Don't define.
[pf3gnuchains/gcc-fork.git] / gcc / config / mips / iris6.h
1 /* Definitions of target machine for GNU compiler.  Iris version 6.
2    Copyright (C) 1994, 1995 Free Software Foundation, Inc.
3
4 This file is part of GNU CC.
5
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING.  If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.  */
20
21 /* Irix 6 uses DWARF.  */
22 #define DWARF_DEBUGGING_INFO
23 #define PREFERRED_DEBUGGING_TYPE DWARF_DEBUG
24
25 /* Default to -mips4.  */
26 #define TARGET_DEFAULT MASK_ABICALLS|MASK_FLOAT64|MASK_64BIT
27 #define MIPS_ISA_DEFAULT 4
28
29 #include "mips/iris5gas.h"
30 #include "mips/abi64.h"
31
32 /* The Irix 6.0.1 assembler doesn't like labels in the text section, so
33    just avoid emitting them.  */
34 #define ASM_IDENTIFY_GCC
35 #define ASM_IDENTIFY_LANGUAGE
36
37 /* Irix 5 stuff that we don't need for Irix 6.  */
38 #undef ASM_OUTPUT_UNDEF_FUNCTION
39 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
40 #undef ASM_DECLARE_FUNCTION_SIZE
41
42 /* Stuff we need for Irix 6 that isn't in Irix 5.  */
43
44 #undef SET_ASM_OP       /* Has no equivalent.  See ASM_OUTPUT_DEF below.  */
45
46 /* This is how to equate one symbol to another symbol.  The syntax used is
47    `SYM1=SYM2'.  Note that this is different from the way equates are done
48    with most svr4 assemblers, where the syntax is `.set SYM1,SYM2'.  */
49
50 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2)                              \
51  do {   fprintf ((FILE), "\t");                                         \
52         assemble_name (FILE, LABEL1);                                   \
53         fprintf (FILE, " = ");                                          \
54         assemble_name (FILE, LABEL2);                                   \
55         fprintf (FILE, "\n");                                           \
56   } while (0)
57
58 #define POPSECTION_ASM_OP       ".popsection"
59
60 #define DEBUG_SECTION           ".debug,1,0,0,1"
61 #define LINE_SECTION            ".line,1,0,0,1"
62 #define SFNAMES_SECTION         ".debug_sfnames,1,0,0,1"
63 #define SRCINFO_SECTION         ".debug_srcinfo,1,0,0,1"
64 #define MACINFO_SECTION         ".debug_macinfo,1,0,0,1"
65 #define PUBNAMES_SECTION        ".debug_pubnames,1,0,0,1"
66 #define ARANGES_SECTION         ".debug_aranges,1,0,0,1"
67
68 #undef ASM_SPEC
69 #if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GAS) != 0
70 /* GAS */
71 #define ASM_SPEC "\
72 %{mmips-as: \
73         %{!.s:-nocpp} %{.s: %{cpp} %{nocpp}} \
74         %{pipe: %e-pipe is not supported.} \
75         %{K}} \
76 %{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} %{v} \
77 %{noasmopt:-O0} \
78 %{!noasmopt:%{O:-O2} %{O1:-O2} %{O2:-O2} %{O3:-O3}} \
79 %{g} %{g0} %{g1} %{g2} %{g3} \
80 %{ggdb:-g} %{ggdb0:-g0} %{ggdb1:-g1} %{ggdb2:-g2} %{ggdb3:-g3} \
81 %{gstabs:-g} %{gstabs0:-g0} %{gstabs1:-g1} %{gstabs2:-g2} %{gstabs3:-g3} \
82 %{gstabs+:-g} %{gstabs+0:-g0} %{gstabs+1:-g1} %{gstabs+2:-g2} %{gstabs+3:-g3} \
83 %{gcoff:-g} %{gcoff0:-g0} %{gcoff1:-g1} %{gcoff2:-g2} %{gcoff3:-g3} \
84 %{membedded-pic}"
85
86 #else
87 /* not GAS */
88 /* Must pass -g0 to the assembler, otherwise it may overwrite our
89    debug info with its own debug info. */
90 /* Must pass -show instead of -v.  */
91 /* Must pass -G 0 to the assembler, otherwise we may get warnings about
92    GOT overflow.  */
93 #define ASM_SPEC "\
94 %{!mgas: \
95         %{!.s:-nocpp} %{.s: %{cpp} %{nocpp}} \
96         %{pipe: %e-pipe is not supported.} \
97         %{K}} \
98 %{G*} %{EB} %{EL} %{v:-show} \
99 %{mips1} %{mips2} %{mips3} %{mips4} \
100 %{!mips1: %{!mips2: %{!mips3: %{!mips4: -mips4}}}} \
101 %{noasmopt:-O0} %{!noasmopt:%{O:-O2} %{O1:-O2} %{O2:-O2} %{O3:-O3}} \
102 -g0 -G 0 %{membedded-pic}"
103
104 #endif
105
106 /* Stuff for constructors.  Start here.  */
107
108 /* The assembler now accepts .section pseudo-ops, but it does not allow
109    one to change the section in the middle of a function.  crtstuff relies
110    on this hack, and thus crtstuff won't work here.  So, we do init and
111    fini sections exactly the same way as they are done for Irix 5, and
112    we ifdef out the ASM_OUTPUT_{CON,DE}STRUCTOR macros below.  */
113
114 #define CONST_SECTION_ASM_OP_32 "\t.rdata"
115 #define CONST_SECTION_ASM_OP_64 ".section\t.rodata"
116 #define CTORS_SECTION_ASM_OP    ".section\t.ctors,1,2,0,4"
117 #define DTORS_SECTION_ASM_OP    ".section\t.dtors,1,2,0,4"
118
119 /* This is the pseudo-op used to generate a 32-bit word of data with a
120    specific value in some section.  This is the same for all known svr4
121    assemblers.  */
122
123 #define INT_ASM_OP              ".word"
124
125 /* A default list of other sections which we might be "in" at any given
126    time.  For targets that use additional sections (e.g. .tdesc) you
127    should override this definition in the target-specific file which
128    includes this file.  */
129
130 #undef EXTRA_SECTIONS
131 #define EXTRA_SECTIONS in_sdata, in_rdata, in_const, in_ctors, in_dtors, in_bss
132
133 /* A default list of extra section function definitions.  For targets
134    that use additional sections (e.g. .tdesc) you should override this
135    definition in the target-specific file which includes this file.  */
136
137 /* ??? rdata_section is now same as svr4 const_section.  */
138
139 #undef EXTRA_SECTION_FUNCTIONS
140 #define EXTRA_SECTION_FUNCTIONS                                         \
141 void                                                                    \
142 sdata_section ()                                                        \
143 {                                                                       \
144   if (in_section != in_sdata)                                           \
145     {                                                                   \
146       fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP);             \
147       in_section = in_sdata;                                            \
148     }                                                                   \
149 }                                                                       \
150                                                                         \
151 void                                                                    \
152 rdata_section ()                                                        \
153 {                                                                       \
154   if (in_section != in_rdata)                                           \
155     {                                                                   \
156       if (mips_isa >= 3)                                                \
157         fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP_64);        \
158       else                                                              \
159         fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP_32);        \
160       in_section = in_rdata;                                            \
161     }                                                                   \
162 }                                                                       \
163   CTORS_SECTION_FUNCTION                                                \
164   DTORS_SECTION_FUNCTION
165
166 #define CTORS_SECTION_FUNCTION                                          \
167 void                                                                    \
168 ctors_section ()                                                        \
169 {                                                                       \
170   if (in_section != in_ctors)                                           \
171     {                                                                   \
172       fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP);             \
173       in_section = in_ctors;                                            \
174     }                                                                   \
175 }
176
177 #define DTORS_SECTION_FUNCTION                                          \
178 void                                                                    \
179 dtors_section ()                                                        \
180 {                                                                       \
181   if (in_section != in_dtors)                                           \
182     {                                                                   \
183       fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP);             \
184       in_section = in_dtors;                                            \
185     }                                                                   \
186 }
187
188 #if 0
189
190 /* A C statement (sans semicolon) to output an element in the table of
191    global constructors.  */
192 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME)                               \
193   do {                                                                  \
194     ctors_section ();                                                   \
195     fprintf (FILE, "\t%s\t ", INT_ASM_OP);                              \
196     assemble_name (FILE, NAME);                                         \
197     fprintf (FILE, "\n");                                               \
198   } while (0)
199
200 /* A C statement (sans semicolon) to output an element in the table of
201    global destructors.  */
202 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME)                                \
203   do {                                                                  \
204     dtors_section ();                                                   \
205     fprintf (FILE, "\t%s\t ", INT_ASM_OP);                              \
206     assemble_name (FILE, NAME);                                         \
207     fprintf (FILE, "\n");                                               \
208   } while (0)
209
210 #endif
211
212 /* Stuff for constructors.  End here.  */
213
214 /* ??? Perhaps just include svr4.h in this file?  */
215
216 /* ??? SGI assembler may core dump when compiling with -g.
217    Sometimes as succeeds, but then we get a linker error. (cmds.c in 072.sc)
218    Getting rid of .file solves both problems.  */
219 #undef ASM_OUTPUT_FILENAME
220 #define ASM_OUTPUT_FILENAME(STREAM, NUM_SOURCE_FILENAMES, NAME) \
221 do                                                              \
222   {                                                             \
223     fprintf (STREAM, "\t#.file\t%d ", NUM_SOURCE_FILENAMES);    \
224     output_quoted_string (STREAM, NAME);                        \
225     fputs ("\n", STREAM);                                       \
226   }                                                             \
227 while (0)
228
229 /* ??? SGI assembler gives warning whenever .lcomm is used.  */
230 #undef ASM_OUTPUT_LOCAL
231 #define ASM_OUTPUT_ALIGNED_LOCAL(STREAM, NAME, SIZE, ALIGN)     \
232 do                                                              \
233   {                                                             \
234     if (mips_isa >= 3)                                          \
235       {                                                         \
236         fputs ("\t.section\t.bss\n", STREAM);                   \
237         ASM_DECLARE_OBJECT_NAME (STREAM, NAME, 0);              \
238         ASM_OUTPUT_ALIGN (STREAM, floor_log2 (ALIGN / BITS_PER_UNIT));  \
239         ASM_OUTPUT_SKIP (STREAM, SIZE);                         \
240         fprintf (STREAM, "\t%s\n", POPSECTION_ASM_OP);          \
241       }                                                         \
242     else                                                        \
243       mips_declare_object (STREAM, NAME, "\n\t.lcomm\t", ",%u\n", (SIZE)); \
244   }                                                             \
245 while (0)
246
247 #undef ASM_OUTPUT_INTERNAL_LABEL
248 #define ASM_OUTPUT_INTERNAL_LABEL(STREAM,PREFIX,NUM)                    \
249   fprintf (STREAM, ".%s%d:\n", PREFIX, NUM)
250
251 /* This is how to store into the string LABEL
252    the symbol_ref name of an internal numbered label where
253    PREFIX is the class of label and NUM is the number within the class.
254    This is suitable for output with `assemble_name'.  */
255
256 #undef ASM_GENERATE_INTERNAL_LABEL
257 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)                   \
258   sprintf (LABEL, "*.%s%d", PREFIX, NUM)
259
260 #undef STARTFILE_SPEC
261 /* Profiling is supported via libprof1.a not -lc_p as in Irix 3.  */
262 #undef STARTFILE_SPEC
263 #define STARTFILE_SPEC \
264   "%{mips1:%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s libprof1.a%s}%{!p:crt1.o%s}}} \
265    %{mips2:%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s libprof1.a%s}%{!p:crt1.o%s}}} \
266    %{!mips1:%{!mips2:%{pg:/usr/lib64/gcrt1.o}%{!pg:%{p:/usr/lib64/mcrt1.o /usr/lib64/libprof1.a}%{!p:/usr/lib64/crt1.o}}}}"
267
268 #undef LIB_SPEC
269 #define LIB_SPEC "%{p:libprof1.a%s}%{pg:libprof1.a%s} -lc"
270
271 #undef ENDFILE_SPEC
272 #define ENDFILE_SPEC \
273   "%{mips1:crtn.o%s}%{mips2:crtn.o%s}%{!mips1:%{!mips2:/usr/lib64/crtn.o}}"
274
275 #undef LINK_SPEC
276 #define LINK_SPEC "\
277 %{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
278 %{bestGnum} %{shared} %{non_shared} \
279 %{call_shared} %{no_archive} %{exact_version} \
280 %{!shared: %{!non_shared: %{!call_shared: -call_shared -no_unresolved}}} \
281 -_SYSTYPE_SVR4"
282
283 /* ??? Debugging does not work.  We get many assembler core dumps,
284    and even some linker core dumps.  */
285 #undef DBX_DEBUGGING_INFO
286 #undef SDB_DEBUGGING_INFO
287 #undef MIPS_DEBUGGING_INFO
288 #undef DWARF_DEBUGGING_INFO
289 #undef PREFERRED_DEBUGGING_TYPE