OSDN Git Service

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