OSDN Git Service

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