OSDN Git Service

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