OSDN Git Service

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