OSDN Git Service

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