1 /* Definitions of target machine for GNU compiler. Iris version 6.
2 Copyright (C) 1994 Free Software Foundation, Inc.
4 This file is part of GNU CC.
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)
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.
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. */
21 /* Irix 6 uses DWARF. */
22 #define DWARF_DEBUGGING_INFO
23 #define PREFERRED_DEBUGGING_TYPE DWARF_DEBUG
25 /* Default to -mips4. */
26 #define TARGET_DEFAULT MASK_ABICALLS|MASK_FLOAT64|MASK_64BIT
27 #define MIPS_ISA_DEFAULT 4
29 #include "mips/iris5gas.h"
30 #include "mips/abi64.h"
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
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
42 /* Stuff we need for Irix 6 that isn't in Irix 5. */
44 #undef SET_ASM_OP /* Has no equivalent. See ASM_OUTPUT_DEF below. */
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'. */
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"); \
58 #define POPSECTION_ASM_OP ".popsection"
60 /* To enable use of init and fini sections. */
61 #define INIT_SECTION_ASM_OP ".section\t.init"
64 #undef HAS_INIT_SECTION
66 #define DEBUG_SECTION ".debug,1,0,0,1"
67 #define LINE_SECTION ".line,1,0,0,1"
68 #define SFNAMES_SECTION ".debug_sfnames,1,0,0,1"
69 #define SRCINFO_SECTION ".debug_srcinfo,1,0,0,1"
70 #define MACINFO_SECTION ".debug_macinfo,1,0,0,1"
71 #define PUBNAMES_SECTION ".debug_pubnames,1,0,0,1"
72 #define ARANGES_SECTION ".debug_aranges,1,0,0,1"
75 #if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GAS) != 0
79 %{!.s:-nocpp} %{.s: %{cpp} %{nocpp}} \
80 %{pipe: %e-pipe is not supported.} \
82 %{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} %{v} \
84 %{!noasmopt:%{O:-O2} %{O1:-O2} %{O2:-O2} %{O3:-O3}} \
85 %{g} %{g0} %{g1} %{g2} %{g3} \
86 %{ggdb:-g} %{ggdb0:-g0} %{ggdb1:-g1} %{ggdb2:-g2} %{ggdb3:-g3} \
87 %{gstabs:-g} %{gstabs0:-g0} %{gstabs1:-g1} %{gstabs2:-g2} %{gstabs3:-g3} \
88 %{gstabs+:-g} %{gstabs+0:-g0} %{gstabs+1:-g1} %{gstabs+2:-g2} %{gstabs+3:-g3} \
89 %{gcoff:-g} %{gcoff0:-g0} %{gcoff1:-g1} %{gcoff2:-g2} %{gcoff3:-g3} \
94 /* Must pass -g0 to the assembler, otherwise it may overwrite our
95 debug info with its own debug info. */
96 /* Must pass -show instead of -v. */
97 /* Must pass -G 0 to the assembler, otherwise we may get warnings about
101 %{!.s:-nocpp} %{.s: %{cpp} %{nocpp}} \
102 %{pipe: %e-pipe is not supported.} \
104 %{G*} %{EB} %{EL} %{v:-show} \
105 %{mips1} %{mips2} %{mips3} %{mips4} \
106 %{!mips1: %{!mips2: %{!mips3: %{!mips4: -mips4}}}} \
107 %{noasmopt:-O0} %{!noasmopt:%{O:-O2} %{O1:-O2} %{O2:-O2} %{O3:-O3}} \
108 -g0 -G 0 %{membedded-pic}"
112 /* Stuff for constructors. Start here. */
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"
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
123 #define INT_ASM_OP ".word"
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. */
130 #undef EXTRA_SECTIONS
131 #define EXTRA_SECTIONS in_sdata, in_rdata, in_const, in_ctors, in_dtors, in_bss
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. */
137 /* ??? rdata_section is now same as svr4 const_section. */
139 #undef EXTRA_SECTION_FUNCTIONS
140 #define EXTRA_SECTION_FUNCTIONS \
144 if (in_section != in_sdata) \
146 fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \
147 in_section = in_sdata; \
154 if (in_section != in_rdata) \
157 fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP_64); \
159 fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP_32); \
160 in_section = in_rdata; \
163 CTORS_SECTION_FUNCTION \
164 DTORS_SECTION_FUNCTION
166 #define CTORS_SECTION_FUNCTION \
170 if (in_section != in_ctors) \
172 fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
173 in_section = in_ctors; \
177 #define DTORS_SECTION_FUNCTION \
181 if (in_section != in_dtors) \
183 fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
184 in_section = in_dtors; \
188 /* A C statement (sans semicolon) to output an element in the table of
189 global constructors. */
190 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
193 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
194 assemble_name (FILE, NAME); \
195 fprintf (FILE, "\n"); \
198 /* A C statement (sans semicolon) to output an element in the table of
199 global destructors. */
200 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
203 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
204 assemble_name (FILE, NAME); \
205 fprintf (FILE, "\n"); \
208 /* Stuff for constructors. End here. */
210 /* ??? Perhaps just include svr4.h in this file? */
212 /* ??? SGI assembler may core dump when compiling with -g.
213 Sometimes as succeeds, but then we get a linker error. (cmds.c in 072.sc)
214 Getting rid of .file solves both problems. */
215 #undef ASM_OUTPUT_FILENAME
216 #define ASM_OUTPUT_FILENAME(STREAM, NUM_SOURCE_FILENAMES, NAME) \
219 fprintf (STREAM, "\t#.file\t%d ", NUM_SOURCE_FILENAMES); \
220 output_quoted_string (STREAM, NAME); \
221 fputs ("\n", STREAM); \
225 /* ??? SGI assembler gives warning whenever .lcomm is used. */
226 #undef ASM_OUTPUT_LOCAL
227 #define ASM_OUTPUT_ALIGNED_LOCAL(STREAM, NAME, SIZE, ALIGN) \
232 fputs ("\t.section\t.bss\n", STREAM); \
233 ASM_DECLARE_OBJECT_NAME (STREAM, NAME, 0); \
234 ASM_OUTPUT_ALIGN (STREAM, floor_log2 (ALIGN / BITS_PER_UNIT)); \
235 ASM_OUTPUT_SKIP (STREAM, SIZE); \
236 fprintf (STREAM, "\t%s\n", POPSECTION_ASM_OP); \
239 mips_declare_object (STREAM, NAME, "\n\t.lcomm\t", ",%u\n", (SIZE)); \
243 #undef ASM_OUTPUT_INTERNAL_LABEL
244 #define ASM_OUTPUT_INTERNAL_LABEL(STREAM,PREFIX,NUM) \
245 fprintf (STREAM, ".%s%d:\n", PREFIX, NUM)
247 /* This is how to store into the string LABEL
248 the symbol_ref name of an internal numbered label where
249 PREFIX is the class of label and NUM is the number within the class.
250 This is suitable for output with `assemble_name'. */
252 #undef ASM_GENERATE_INTERNAL_LABEL
253 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
254 sprintf (LABEL, "*.%s%d", PREFIX, NUM)
256 #undef STARTFILE_SPEC
257 /* Profiling is supported via libprof1.a not -lc_p as in Irix 3. */
258 #undef STARTFILE_SPEC
259 #define STARTFILE_SPEC \
260 "%{mips1:%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s libprof1.a%s}%{!p:crt1.o%s}}} \
261 %{mips2:%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s libprof1.a%s}%{!p:crt1.o%s}}} \
262 %{!mips1:%{!mips2:%{pg:/usr/lib64/gcrt1.o}%{!pg:%{p:/usr/lib64/mcrt1.o /usr/lib64/libprof1.a}%{!p:/usr/lib64/crt1.o}}}}"
265 #define LIB_SPEC "%{p:libprof1.a%s}%{pg:libprof1.a%s} -lc"
268 #define ENDFILE_SPEC \
269 "%{mips1:crtn.o%s}%{mips2:crtn.o%s}%{!mips1:%{!mips2:/usr/lib64/crtn.o}}"
273 %{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
274 %{bestGnum} %{shared} %{non_shared} \
275 %{call_shared} %{no_archive} %{exact_version} \
276 %{!shared: %{!non_shared: %{!call_shared: -call_shared -no_unresolved}}} \
279 /* ??? Debugging does not work. We get many assembler core dumps,
280 and even some linker core dumps. */
281 #undef DBX_DEBUGGING_INFO
282 #undef SDB_DEBUGGING_INFO
283 #undef MIPS_DEBUGGING_INFO
284 #undef DWARF_DEBUGGING_INFO
285 #undef PREFERRED_DEBUGGING_TYPE