OSDN Git Service

* config/ia64/ia64.h (DEBUG_RANGES_SECTION): New.
[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, 1996, 1997, 1998, 2000, 2001 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 /* Default to -mabi=n32 and -mips3.  */
22 #define MIPS_ISA_DEFAULT 3
23 #define MIPS_ABI_DEFAULT ABI_N32
24 #define MULTILIB_DEFAULTS { "mabi=n32" }
25
26 #ifndef TARGET_DEFAULT
27 #define TARGET_DEFAULT (MASK_ABICALLS|MASK_FLOAT64|MASK_64BIT)
28 #endif
29
30 #include "mips/iris5.h"
31 #include "mips/abi64.h"
32
33 /* Irix6 assembler does handle DWARF2 directives.  Override setting in
34  irix5.h file.  */
35 #undef DWARF2_UNWIND_INFO
36
37 /* The Irix6 assembler will sometimes assign labels to the wrong
38    section unless the labels are within .ent/.end blocks.  Therefore,
39    we avoid creating such labels.  */
40 #define DWARF2_GENERATE_TEXT_SECTION_LABEL 0
41
42 /* wchar_t is defined differently with and without -mabi=64.  */
43
44 #define NO_BUILTIN_WCHAR_TYPE
45
46 #undef WCHAR_TYPE
47 #define WCHAR_TYPE (Pmode == DImode ? "int" : "long int")
48
49 #undef WCHAR_TYPE_SIZE
50 #define WCHAR_TYPE_SIZE 32
51
52 /* Same for wint_t.  */
53
54 #define NO_BUILTIN_WINT_TYPE
55
56 #undef WINT_TYPE
57 #define WINT_TYPE (Pmode == DImode ? "int" : "long int")
58
59 #undef WINT_TYPE_SIZE
60 #define WINT_TYPE_SIZE 32
61
62 /* For Irix 6, -mabi=64 implies TARGET_LONG64.  */
63 /* This is handled in override_options.  */
64
65 #undef SUBTARGET_CC1_SPEC
66 #define SUBTARGET_CC1_SPEC ""
67
68 /* We must pass -D_LONGLONG always, even when -ansi is used, because irix6
69    system header files require it.  This is OK, because gcc never warns
70    when long long is used in system header files.  Alternatively, we can
71    add support for the SGI builtin type __long_long.  */
72 #undef CPP_PREDEFINES
73 #define CPP_PREDEFINES \
74  "-Dunix -Dmips -Dsgi -Dhost_mips -DMIPSEB -D_MIPSEB -DSYSTYPE_SVR4 \
75   -D_LONGLONG -D_SVR4_SOURCE -D_MODERN_C -D__DSO__ \
76   -Asystem=unix -Asystem=svr4 -Acpu=mips -Amachine=sgi"
77
78 #undef SUBTARGET_CPP_SIZE_SPEC
79 #define SUBTARGET_CPP_SIZE_SPEC "\
80 %{mabi=32|mabi=n32: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int \
81 -D__WCHAR_TYPE__=long\\ int -D__WINT_TYPE__=long\\ int} \
82 %{mabi=64: -D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int \
83 -D__WCHAR_TYPE__=int -D__WINT_TYPE__=int} \
84 %{!mabi*: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int \
85 -D__WCHAR_TYPE__=long\\ int -D__WINT_TYPE__=long\\ int}"
86
87 /* We must make -mips3 do what -mlong64 used to do.  */
88 /* ??? If no mipsX option given, but a mabi=X option is, then should set
89    _MIPS_ISA based on the mabi=X option.  */
90 /* ??? If no mabi=X option give, but a mipsX option is, then should set
91    _MIPS_SIM based on the mipsX option.  */
92 /* ??? Same for _MIPS_SZINT.  */
93 /* ??? Same for _MIPS_SZPTR.  */
94 /* ??? Same for __SIZE_TYPE and __PTRDIFF_TYPE.  */
95 #undef SUBTARGET_CPP_SPEC
96 #define SUBTARGET_CPP_SPEC "\
97 %{!ansi:-D__EXTENSIONS__ -D_SGI_SOURCE} \
98 %{mfp32: -D_MIPS_FPSET=16}%{!mfp32: -D_MIPS_FPSET=32} \
99 %{mips1: -D_MIPS_ISA=_MIPS_ISA_MIPS1} \
100 %{mips2: -D_MIPS_ISA=_MIPS_ISA_MIPS2} \
101 %{mips3: -D_MIPS_ISA=_MIPS_ISA_MIPS3} \
102 %{mips4: -D_MIPS_ISA=_MIPS_ISA_MIPS4} \
103 %{!mips*: -D_MIPS_ISA=_MIPS_ISA_MIPS3} \
104 %{mabi=32: -D_MIPS_SIM=_MIPS_SIM_ABI32} \
105 %{mabi=n32: -D_ABIN32=2 -D_MIPS_SIM=_ABIN32} \
106 %{mabi=64: -D_ABI64=3 -D_MIPS_SIM=_ABI64} \
107 %{!mabi*: -D_ABIN32=2 -D_MIPS_SIM=_ABIN32} \
108 %{!mint64: -D_MIPS_SZINT=32}%{mint64: -D_MIPS_SZINT=64} \
109 %{mabi=32: -D_MIPS_SZLONG=32} \
110 %{mabi=n32: -D_MIPS_SZLONG=32} \
111 %{mabi=64: -D_MIPS_SZLONG=64} \
112 %{!mabi*: -D_MIPS_SZLONG=32} \
113 %{mabi=32: -D_MIPS_SZPTR=32} \
114 %{mabi=n32: -D_MIPS_SZPTR=32} \
115 %{mabi=64: -D_MIPS_SZPTR=64} \
116 %{!mabi*: -D_MIPS_SZPTR=32} \
117 %{!mips1:%{!mips2: -D_COMPILER_VERSION=601}}            \
118 %{!mips*: -U__mips -D__mips=3} \
119 %{mabi=32: -U__mips64} \
120 %{mabi=n32: -D__mips64} \
121 %{mabi=64: -D__mips64} \
122 %{!mabi*: -D__mips64}"
123
124 /* Irix 6 uses DWARF-2.  */
125 #define DWARF2_DEBUGGING_INFO
126 #define MIPS_DEBUGGING_INFO
127 #undef PREFERRED_DEBUGGING_TYPE
128 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
129
130 /* Force the generation of dwarf .debug_frame sections even if not
131    compiling -g.  This guarantees that we can unwind the stack. */
132 #define DWARF2_FRAME_INFO 1
133 /* The size in bytes of a DWARF field indicating an offset or length
134    relative to a debug info section, specified to be 4 bytes in the DWARF-2
135    specification.  The SGI/MIPS ABI defines it to be the same as PTR_SIZE.  */
136 #define DWARF_OFFSET_SIZE PTR_SIZE
137
138 /* There is no GNU as port for Irix6 yet, so we set MD_EXEC_PREFIX so that
139    gcc will automatically find SGI as instead of searching the user's path.
140    The latter can fail when building a cross compiler if the user has . in
141    the path before /usr/bin, since then gcc will find and try to use the link
142    to the cross assembler which can't possibly work.  */
143
144 #undef MD_EXEC_PREFIX
145 #define MD_EXEC_PREFIX "/usr/bin/"
146
147 /* We have no need for MD_STARTFILE_PREFIX.  */
148 #undef MD_STARTFILE_PREFIX
149
150 #undef MACHINE_TYPE
151 #define MACHINE_TYPE "SGI running IRIX 6.x"
152
153 /* Irix 5 stuff that we don't need for Irix 6.  */
154 /* ??? We do need this for the -mabi=32 switch though.  */
155 #undef ASM_OUTPUT_UNDEF_FUNCTION
156 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
157 #undef ASM_DECLARE_FUNCTION_SIZE
158 #undef UNALIGNED_SHORT_ASM_OP
159 #undef UNALIGNED_INT_ASM_OP
160
161 /* Stuff we need for Irix 6 that isn't in Irix 5.  */
162
163 /* The SGI assembler doesn't like labels before the .ent, so we must output
164    the .ent and function name here, which is the normal place for it.  */
165
166 #undef ASM_DECLARE_FUNCTION_NAME
167 #define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL)                   \
168   do {                                                                  \
169     fputs ("\t.ent\t", STREAM);                                         \
170     assemble_name (STREAM, NAME);                                       \
171     fputs ("\n", STREAM);                                               \
172     assemble_name (STREAM, NAME);                                       \
173     fputs (":\n", STREAM);                                              \
174   } while (0)
175
176 /* Likewise, the SGI assembler doesn't like labels after the .end, so we
177    must output the .end here.  */
178 #define ASM_DECLARE_FUNCTION_SIZE(STREAM, NAME, DECL)                   \
179   do {                                                                  \
180     fputs ("\t.end\t", STREAM);                                         \
181     assemble_name (STREAM, NAME);                                       \
182     fputs ("\n", STREAM);                                               \
183   } while (0)
184
185 /* Tell function_prologue in mips.c that we have already output the .ent/.end
186    pseudo-ops.  */
187 #define FUNCTION_NAME_ALREADY_DECLARED
188
189 #undef SET_ASM_OP       /* Has no equivalent.  See ASM_OUTPUT_DEF below.  */
190
191 #if 0
192 /* This is *NOT* how to equate one symbol to another symbol.  The assembler
193    '=' syntax just equates a name to a constant expression.
194    See ASM_OUTPUT_WEAK_ALIAS.  */
195
196 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2)                              \
197  do {   fprintf ((FILE), "\t");                                         \
198         assemble_name (FILE, LABEL1);                                   \
199         fprintf (FILE, " = ");                                          \
200         assemble_name (FILE, LABEL2);                                   \
201         fprintf (FILE, "\n");                                           \
202   } while (0)
203 #endif
204
205 /* Define the strings used for the special svr4 .type and .size directives.  */
206
207 #define TYPE_ASM_OP     "\t.type\t"
208 #define SIZE_ASM_OP     "\t.size\t"
209
210 /* Irix assembler does not support the init_priority C++ attribute.  */
211 #undef SUPPORTS_INIT_PRIORITY
212 #define SUPPORTS_INIT_PRIORITY 0
213
214 /* A linker error can empirically be avoided by removing duplicate
215    library search directories.  */
216 #define LINK_ELIMINATE_DUPLICATE_LDIRECTORIES 1
217
218 #define POPSECTION_ASM_OP       "\t.popsection"
219
220 #define DEBUG_INFO_SECTION      ".debug_info,0x7000001e,0,0,1"
221 #define DEBUG_LINE_SECTION      ".debug_line,0x7000001e,0,0,1"
222 #define DEBUG_SFNAMES_SECTION   ".debug_sfnames,0x7000001e,0,0,1"
223 #define DEBUG_SRCINFO_SECTION   ".debug_srcinfo,0x7000001e,0,0,1"
224 #define DEBUG_MACINFO_SECTION   ".debug_macinfo,0x7000001e,0,0,1"
225 #define DEBUG_PUBNAMES_SECTION  ".debug_pubnames,0x7000001e,0,0,1"
226 #define DEBUG_ARANGES_SECTION   ".debug_aranges,0x7000001e,0,0,1"
227 #define DEBUG_FRAME_SECTION     ".debug_frame,0x7000001e,0x08000000,0,1"
228 #define DEBUG_ABBREV_SECTION    ".debug_abbrev,0x7000001e,0,0,1"
229 #define DEBUG_LOC_SECTION       ".debug_loc,0x7000001e,0,0,1"
230 #define DEBUG_STR_SECTION       ".debug_str,0x7000001e,0,0,1"
231 #define DEBUG_RANGES_SECTION    ".debug_ranges,0x7000001e,0,0,1"
232
233 /* ??? If no mabi=X option give, but a mipsX option is, then should depend
234    on the mipsX option.  */
235 /* If no mips[3,4] option given, give the appropriate default for mabi=X */
236 #undef SUBTARGET_ASM_SPEC
237 #define SUBTARGET_ASM_SPEC "%{!mabi*:-n32} %{!mips*: %{!mabi*:-mips3} %{mabi=n32:-mips3} %{mabi=64:-mips4}}"
238
239 /* Must pass -g0 to the assembler, otherwise it may overwrite our
240    debug info with its own debug info. */
241 /* Must pass -show instead of -v.  */
242 /* Must pass -G 0 to the assembler, otherwise we may get warnings about
243    GOT overflow.  */
244 /* ??? We pass -w to disable all assembler warnings.  The `label should be
245    inside .ent/.end block' warning that we get for DWARF II debug info labels
246    is particularly annoying.  */
247 #undef SUBTARGET_MIPS_AS_ASM_SPEC
248 #define SUBTARGET_MIPS_AS_ASM_SPEC "%{v:-show} -G 0 -w"
249
250 #undef SUBTARGET_ASM_DEBUGGING_SPEC
251 #define SUBTARGET_ASM_DEBUGGING_SPEC "-g0"
252
253 /* The MIPS assembler occasionally misoptimizes.  Since GCC should be
254    doing scheduling anyhow, just turn off optimization in the assembler.  */
255 #undef SUBTARGET_ASM_OPTIMIZING_SPEC
256 #define SUBTARGET_ASM_OPTIMIZING_SPEC "-O0"
257
258 /* Stuff for constructors.  Start here.  */
259
260 /* The assembler now accepts .section pseudo-ops, but it does not allow
261    one to change the section in the middle of a function, so we can't use
262    the INIT_SECTION_ASM_OP code in crtstuff.  But we can build up the ctor
263    and dtor lists this way, so we use -init and -fini to invoke the
264    do_global_* functions instead of running collect2.  */
265
266 #define BSS_SECTION_ASM_OP      "\t.section\t.bss"
267 #define CONST_SECTION_ASM_OP_32 "\t.rdata"
268 #define CONST_SECTION_ASM_OP_64 "\t.section\t.rodata"
269
270 /* The IRIX 6 assembler .section directive takes four additional args:
271    section type, flags, entry size, and alignment.  The alignment of the
272    .ctors and .dtors sections needs to be the same as the size of a pointer
273    so that the linker doesn't add padding between elements.  */
274 #if defined (CRT_BEGIN) || defined (CRT_END)
275
276 /* If we are included from crtstuff.c, these need to be plain strings.
277    _MIPS_SZPTR is defined in SUBTARGET_CPP_SPEC above.  */
278 #if _MIPS_SZPTR == 64
279 #define CTORS_SECTION_ASM_OP "\t.section\t.ctors,1,2,0,8"
280 #define DTORS_SECTION_ASM_OP "\t.section\t.dtors,1,2,0,8"
281 #define EH_FRAME_SECTION_ASM_OP "\t.section\t.eh_frame,1,2,0,8"
282 #else /* _MIPS_SZPTR != 64 */
283 #define CTORS_SECTION_ASM_OP "\t.section\t.ctors,1,2,0,4"
284 #define DTORS_SECTION_ASM_OP "\t.section\t.dtors,1,2,0,4"
285 #define EH_FRAME_SECTION_ASM_OP "\t.section\t.eh_frame,1,2,0,4"
286
287 #endif /* _MIPS_SZPTR == 64 */
288
289 #else /* ! (defined (CRT_BEGIN) || defined (CRT_END)) */
290
291 /* If we are included from varasm.c, these need to depend on -mabi.  */
292 #define CTORS_SECTION_ASM_OP \
293   (Pmode == DImode ? "\t.section\t.ctors,1,2,0,8" : "\t.section\t.ctors,1,2,0,4")
294 #define DTORS_SECTION_ASM_OP \
295   (Pmode == DImode ? "\t.section\t.dtors,1,2,0,8" : "\t.section\t.dtors,1,2,0,4")
296 #define EH_FRAME_SECTION_ASM_OP \
297   (Pmode == DImode ? "\t.section\t.eh_frame,1,2,0,8" : "\t.section\t.eh_frame,1,2,0,4")
298 #endif /* defined (CRT_BEGIN) || defined (CRT_END) */
299
300 /* A default list of other sections which we might be "in" at any given
301    time.  For targets that use additional sections (e.g. .tdesc) you
302    should override this definition in the target-specific file which
303    includes this file.  */
304
305 #undef EXTRA_SECTIONS
306 #define EXTRA_SECTIONS in_sdata, in_rdata, in_const, in_ctors, in_dtors
307
308 /* A default list of extra section function definitions.  For targets
309    that use additional sections (e.g. .tdesc) you should override this
310    definition in the target-specific file which includes this file.  */
311
312 /* ??? rdata_section is now same as svr4 const_section.  */
313
314 #undef EXTRA_SECTION_FUNCTIONS
315 #define EXTRA_SECTION_FUNCTIONS                                         \
316 void                                                                    \
317 sdata_section ()                                                        \
318 {                                                                       \
319   if (in_section != in_sdata)                                           \
320     {                                                                   \
321       fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP);             \
322       in_section = in_sdata;                                            \
323     }                                                                   \
324 }                                                                       \
325                                                                         \
326 void                                                                    \
327 rdata_section ()                                                        \
328 {                                                                       \
329   if (in_section != in_rdata)                                           \
330     {                                                                   \
331       if (mips_abi != ABI_32 && mips_abi != ABI_O64)                    \
332         fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP_64);        \
333       else                                                              \
334         fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP_32);        \
335       in_section = in_rdata;                                            \
336     }                                                                   \
337 }                                                                       \
338   CTORS_SECTION_FUNCTION                                                \
339   DTORS_SECTION_FUNCTION
340
341 #define CTORS_SECTION_FUNCTION                                          \
342 void                                                                    \
343 ctors_section ()                                                        \
344 {                                                                       \
345   if (in_section != in_ctors)                                           \
346     {                                                                   \
347       fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP);             \
348       in_section = in_ctors;                                            \
349     }                                                                   \
350 }
351
352 #define DTORS_SECTION_FUNCTION                                          \
353 void                                                                    \
354 dtors_section ()                                                        \
355 {                                                                       \
356   if (in_section != in_dtors)                                           \
357     {                                                                   \
358       fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP);             \
359       in_section = in_dtors;                                            \
360     }                                                                   \
361 }
362
363 /* A C statement (sans semicolon) to output an element in the table of
364    global constructors.  */
365 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME)                               \
366   do {                                                                  \
367     ctors_section ();                                                   \
368     fprintf (FILE, "\t%s\t ",                                           \
369              (Pmode == DImode) ? ".dword" : ".word");                   \
370     assemble_name (FILE, NAME);                                         \
371     fprintf (FILE, "\n");                                               \
372   } while (0)
373
374 /* A C statement (sans semicolon) to output an element in the table of
375    global destructors.  */
376 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME)                                \
377   do {                                                                  \
378     dtors_section ();                                                   \
379     fprintf (FILE, "\t%s\t ",                                           \
380              (Pmode == DImode) ? ".dword" : ".word");                   \
381     assemble_name (FILE, NAME);                                         \
382     fprintf (FILE, "\n");                                               \
383   } while (0)
384
385 /* A C statement to output something to the assembler file to switch to section
386    NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or
387    NULL_TREE.  */
388
389 #define ASM_OUTPUT_SECTION_NAME(F, DECL, NAME, RELOC)                   \
390 do {                                                                    \
391   extern FILE *asm_out_text_file;                                       \
392   if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL)                      \
393     fprintf (asm_out_text_file, "\t.section %s,1,6,4,4\n", (NAME));     \
394   else if ((DECL) && DECL_READONLY_SECTION (DECL, RELOC))               \
395     fprintf (F, "\t.section %s,1,2,0,8\n", (NAME));                     \
396   else if (! strcmp (NAME, ".bss"))                                     \
397     fprintf (F, "\t.section %s,\"aw\",@nobits\n", (NAME));              \
398   else                                                                  \
399     fprintf (F, "\t.section %s,1,3,0,8\n", (NAME));                     \
400 } while (0)
401
402 /* Stuff for constructors.  End here.  */
403
404 /* ??? Perhaps just include svr4.h in this file?  */
405
406 /* ??? SGI assembler may core dump when compiling with -g.
407    Sometimes as succeeds, but then we get a linker error. (cmds.c in 072.sc)
408    Getting rid of .file solves both problems.  */
409 #undef ASM_OUTPUT_FILENAME
410 #define ASM_OUTPUT_FILENAME(STREAM, NUM_SOURCE_FILENAMES, NAME) \
411 do                                                              \
412   {                                                             \
413     fprintf (STREAM, "\t#.file\t%d ", NUM_SOURCE_FILENAMES);    \
414     output_quoted_string (STREAM, NAME);                        \
415     fputs ("\n", STREAM);                                       \
416   }                                                             \
417 while (0)
418
419 /* ??? SGI assembler gives warning whenever .lcomm is used.  */
420 #undef ASM_OUTPUT_LOCAL
421 #define ASM_OUTPUT_ALIGNED_LOCAL(STREAM, NAME, SIZE, ALIGN)                \
422 do                                                                         \
423   {                                                                        \
424     if (mips_abi != ABI_32 && mips_abi != ABI_O64)                         \
425       {                                                                    \
426         fprintf (STREAM, "%s\n", BSS_SECTION_ASM_OP);                      \
427         mips_declare_object (STREAM, NAME, "", ":\n", 0);                  \
428         ASM_OUTPUT_ALIGN (STREAM, floor_log2 (ALIGN / BITS_PER_UNIT));     \
429         ASM_OUTPUT_SKIP (STREAM, SIZE);                                    \
430         fprintf (STREAM, "%s\n", POPSECTION_ASM_OP);                       \
431       }                                                                    \
432     else                                                                   \
433       mips_declare_object (STREAM, NAME, "\n\t.lcomm\t", ",%u\n", (SIZE)); \
434   }                                                                        \
435 while (0)
436
437 /* A C statement (sans semicolon) to output to the stdio stream
438    FILE the assembler definition of uninitialized global DECL named
439    NAME whose size is SIZE bytes and alignment is ALIGN bytes.
440    Try to use asm_output_aligned_bss to implement this macro.  */
441
442 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
443   asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
444
445 /* Write the extra assembler code needed to declare an object properly.  */
446
447 #undef ASM_DECLARE_OBJECT_NAME
448 #define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL)                     \
449 do                                                                      \
450  {                                                                      \
451    size_directive_output = 0;                                           \
452    if (!flag_inhibit_size_directive && DECL_SIZE (DECL))        \
453      {                                                                  \
454        size_directive_output = 1;                                       \
455        fprintf (STREAM, "%s", SIZE_ASM_OP);                             \
456        assemble_name (STREAM, NAME);                                    \
457        fprintf (STREAM, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
458      }                                                                  \
459    mips_declare_object (STREAM, NAME, "", ":\n", 0);                    \
460  }                                                                      \
461 while (0)
462
463 /* Define the `__builtin_va_list' type for the ABI.  On Irix6, this
464    type is `char *'.  */
465 #undef BUILD_VA_LIST_TYPE
466 #define BUILD_VA_LIST_TYPE(VALIST) \
467   (VALIST) = build_pointer_type (char_type_node)
468
469 /* Output the size directive for a decl in rest_of_decl_compilation
470    in the case where we did not do so before the initializer.
471    Once we find the error_mark_node, we know that the value of
472    size_directive_output was set
473    by ASM_DECLARE_OBJECT_NAME when it was run for the same decl.  */
474
475 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END)         \
476 do {                                                                     \
477      const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0);             \
478      if (!flag_inhibit_size_directive && DECL_SIZE (DECL)                \
479          && ! AT_END && TOP_LEVEL                                        \
480          && DECL_INITIAL (DECL) == error_mark_node                       \
481          && !size_directive_output)                                      \
482        {                                                                 \
483          size_directive_output = 1;                                      \
484          fprintf (FILE, "%s", SIZE_ASM_OP);                              \
485          assemble_name (FILE, name);                                     \
486          fprintf (FILE, ",%d\n",  int_size_in_bytes (TREE_TYPE (DECL))); \
487        }                                                                 \
488    } while (0)
489
490 #undef LOCAL_LABEL_PREFIX
491 #define LOCAL_LABEL_PREFIX ((mips_abi == ABI_32 || mips_abi == ABI_O64) \
492                             ? "$" : ".")
493
494 /* Profiling is supported via libprof1.a not -lc_p as in Irix 3.  */
495 /* ??? If no mabi=X option give, but a mipsX option is, then should depend
496    on the mipsX option.  */
497 #undef STARTFILE_SPEC
498 #define STARTFILE_SPEC \
499   "%{!shared: \
500      %{mabi=32:%{pg:gcrt1.o%s} \
501        %{!pg:%{p:mcrt1.o%s libprof1.a%s}%{!p:crt1.o%s}}} \
502      %{mabi=n32: \
503        %{mips4:%{pg:/usr/lib32/mips4/gcrt1.o%s} \
504          %{!pg:%{p:/usr/lib32/mips4/mcrt1.o%s /usr/lib32/mips4/libprof1.a%s} \
505            %{!p:/usr/lib32/mips4/crt1.o%s}}} \
506        %{!mips4:%{pg:/usr/lib32/mips3/gcrt1.o%s} \
507          %{!pg:%{p:/usr/lib32/mips3/mcrt1.o%s /usr/lib32/mips3/libprof1.a%s} \
508            %{!p:/usr/lib32/mips3/crt1.o%s}}}} \
509      %{mabi=64: \
510        %{mips4:%{pg:/usr/lib64/mips4/gcrt1.o} \
511          %{!pg:%{p:/usr/lib64/mips4/mcrt1.o /usr/lib64/mips4/libprof1.a} \
512            %{!p:/usr/lib64/mips4/crt1.o}}} \
513        %{!mips4:%{pg:/usr/lib64/mips3/gcrt1.o} \
514          %{!pg:%{p:/usr/lib64/mips3/mcrt1.o /usr/lib64/mips3/libprof1.a} \
515            %{!p:/usr/lib64/mips3/crt1.o}}}} \
516      %{!mabi*: \
517        %{mips4:%{pg:/usr/lib32/mips4/gcrt1.o%s} \
518          %{!pg:%{p:/usr/lib32/mips4/mcrt1.o%s /usr/lib32/mips4/libprof1.a%s} \
519            %{!p:/usr/lib32/mips4/crt1.o%s}}} \
520        %{!mips4:%{pg:/usr/lib32/mips3/gcrt1.o%s} \
521          %{!pg:%{p:/usr/lib32/mips3/mcrt1.o%s /usr/lib32/mips3/libprof1.a%s} \
522            %{!p:/usr/lib32/mips3/crt1.o%s}}}}} \
523    crtbegin.o%s"
524
525 #undef LIB_SPEC
526 #define LIB_SPEC \
527   "%{mabi=n32: %{mips4:-L/usr/lib32/mips4} %{!mips4:-L/usr/lib32/mips3} \
528      -L/usr/lib32} \
529    %{mabi=64: %{mips4:-L/usr/lib64/mips4} %{!mips4:-L/usr/lib64/mips3} \
530      -L/usr/lib64} \
531    %{!mabi*: %{mips4:-L/usr/lib32/mips4} %{!mips4:-L/usr/lib32/mips3} \
532      -L/usr/lib32} \
533    %{!shared: \
534      -dont_warn_unused %{p:libprof1.a%s}%{pg:libprof1.a%s} -lc -warn_unused}"
535
536 /* Avoid getting two warnings for libgcc.a everytime we link.  */
537 #undef LIBGCC_SPEC
538 #define LIBGCC_SPEC "-dont_warn_unused -lgcc -warn_unused"
539
540 /* ??? If no mabi=X option give, but a mipsX option is, then should depend
541    on the mipsX option.  */
542 #undef ENDFILE_SPEC
543 #define ENDFILE_SPEC \
544   "crtend.o%s \
545    %{!shared: \
546      %{mabi=32:crtn.o%s}\
547      %{mabi=n32:%{mips4:/usr/lib32/mips4/crtn.o%s}\
548        %{!mips4:/usr/lib32/mips3/crtn.o%s}}\
549      %{mabi=64:%{mips4:/usr/lib64/mips4/crtn.o%s}\
550        %{!mips4:/usr/lib64/mips3/crtn.o%s}}\
551      %{!mabi*:%{mips4:/usr/lib32/mips4/crtn.o%s}\
552        %{!mips4:/usr/lib32/mips3/crtn.o%s}}}"
553
554 /* ??? If no mabi=X option give, but a mipsX option is, then should depend
555    on the mipsX option.  */
556 #undef LINK_SPEC
557 #define LINK_SPEC "\
558 %{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
559 %{bestGnum} %{shared} %{non_shared} \
560 %{call_shared} %{no_archive} %{exact_version} %{w} \
561 %{!shared: %{!non_shared: %{!call_shared: -call_shared -no_unresolved}}} \
562 %{rpath} -init __do_global_ctors -fini __do_global_dtors \
563 %{shared:-hidden_symbol __do_global_ctors,__do_global_dtors,__EH_FRAME_BEGIN__,__frame_dummy} \
564 -_SYSTYPE_SVR4 -woff 131 \
565 %{mabi=32: -32}%{mabi=n32: -n32}%{mabi=64: -64}%{!mabi*: -n32}"