2002-05-09 Hassan Aurag <aurag@cae.com>
[official-gcc.git] / gcc / config / mips / iris6gld.h
blobaddc0f7d82eceb6950152e8491b2a89737bb19cf
1 /* Definitions of target machine for GNU compiler. Iris version 6 with
2 GNU ld.
3 Copyright (C) 1999, 2000 Free Software Foundation, Inc.
4 Written by Mark Mitchell <mark@codesourcery.com>.
6 This file is part of GNU CC.
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 #undef LIB_SPEC
24 #define LIB_SPEC \
25 "%{mabi=n32: %{mips4:-L/usr/lib32/mips4} %{!mips4:-L/usr/lib32/mips3} \
26 -L/usr/lib32} \
27 %{mabi=64: %{mips4:-L/usr/lib64/mips4} %{!mips4:-L/usr/lib64/mips3} \
28 -L/usr/lib64} \
29 %{!mabi*: %{mips4:-L/usr/lib32/mips4} %{!mips4:-L/usr/lib32/mips3} \
30 -L/usr/lib32} \
31 %{!shared: \
32 %{p:libprof1.a%s}%{pg:libprof1.a%s} -lc}"
34 /* Use the default libgcc spec. */
35 #undef LIBGCC_SPEC
37 /* ??? If no mabi=X option give, but a mipsX option is, then should depend
38 on the mipsX option. */
39 #undef LINK_SPEC
40 #define LINK_SPEC "\
41 %{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
42 %{bestGnum} %{shared} %{non_shared} \
43 %{call_shared} %{no_archive} %{exact_version} \
44 %{static: -non_shared} \
45 %{!static: \
46 %{!shared: %{!non_shared: %{!call_shared: -call_shared}}}} \
47 %{rpath} -init __do_global_ctors -fini __do_global_dtors \
48 %{mabi=32: -melf32bsmip}%{mabi=n32: -melf32bmipn32}%{mabi=64: -melf64bmip}%{!mabi*: -melf32bmipn32}"
50 /* The GNU linker supports one-only sections. */
51 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
52 #define UNIQUE_SECTION(DECL, RELOC) \
53 do \
54 { \
55 int len; \
56 int sec; \
57 const char *name; \
58 char *string; \
59 const char *prefix; \
60 static const char *const prefixes[/*4*/3][2] = \
61 { \
62 { ".text.", ".gnu.linkonce.t." }, \
63 { ".rodata.", ".gnu.linkonce.r." }, \
64 { ".data.", ".gnu.linkonce.d." } \
65 /* Do not generate unique sections for uninitialised \
66 data since we do not have support for this in the \
67 linker scripts yet... \
68 , { ".bss.", ".gnu.linkonce.b." } */ \
69 }; \
71 if (TREE_CODE (DECL) == FUNCTION_DECL) \
72 sec = 0; \
73 /* else if (DECL_INITIAL (DECL) == 0 \
74 || DECL_INITIAL (DECL) == error_mark_node) \
75 sec = 3; */ \
76 else if (DECL_READONLY_SECTION (DECL, RELOC)) \
77 sec = 1; \
78 else \
79 sec = 2; \
81 name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
82 prefix = prefixes[sec][DECL_ONE_ONLY(DECL)]; \
83 len = strlen (name) + strlen (prefix); \
84 string = alloca (len + 1); \
86 sprintf (string, "%s%s", prefix, name); \
88 DECL_SECTION_NAME (DECL) = build_string (len, string); \
89 } \
90 while (0)