OSDN Git Service

2001-08-01 H.J. Lu <hjl@gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / config / mips / iris6gld.h
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>.
5
6 This file is part of GNU CC.
7
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.
12
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.
17
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.  */
22
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}"
33
34 /* Use the default libgcc spec.  */
35 #undef LIBGCC_SPEC
36
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}"
49
50 /* The GNU linker supports one-only sections.  */
51 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
52 #undef  UNIQUE_SECTION_P
53 #define UNIQUE_SECTION_P(DECL) (DECL_ONE_ONLY (DECL))
54 #define UNIQUE_SECTION(DECL, RELOC)                             \
55   do                                                            \
56     {                                                           \
57       int len;                                                  \
58       int sec;                                                  \
59       char *name;                                               \
60       char *string;                                             \
61       char *prefix;                                             \
62       static char *prefixes[/*4*/3][2] =                        \
63       {                                                         \
64         { ".text.",   ".gnu.linkonce.t." },                     \
65         { ".rodata.", ".gnu.linkonce.r." },                     \
66         { ".data.",   ".gnu.linkonce.d." }                      \
67         /* Do not generate unique sections for uninitialised    \
68            data since we do not have support for this in the    \
69            linker scripts yet...                                \
70         , { ".bss.",    ".gnu.linkonce.b." }  */                \
71       };                                                        \
72                                                                 \
73       if (TREE_CODE (DECL) == FUNCTION_DECL)                    \
74         sec = 0;                                                \
75    /* else if (DECL_INITIAL (DECL) == 0                         \
76                || DECL_INITIAL (DECL) == error_mark_node)       \
77         sec =  3; */                                            \
78       else if (DECL_READONLY_SECTION (DECL, RELOC))             \
79         sec = 1;                                                \
80       else                                                      \
81         sec = 2;                                                \
82                                                                 \
83       name   = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
84       prefix = prefixes[sec][DECL_ONE_ONLY(DECL)];              \
85       len    = strlen (name) + strlen (prefix);                 \
86       string = alloca (len + 1);                                \
87                                                                 \
88       sprintf (string, "%s%s", prefix, name);                   \
89                                                                 \
90       DECL_SECTION_NAME (DECL) = build_string (len, string);    \
91     }                                                           \
92   while (0)