OSDN Git Service

e780a4bb3b8a5492bb5195aa989b261357e1911d
[pf3gnuchains/gcc-fork.git] / gcc / config / mips / linux.h
1 /* Definitions for MIPS running Linux-based GNU systems with ELF format.
2    Copyright (C) 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 /* Required to keep collect2.c happy */
22 #undef OBJECT_FORMAT_COFF 
23
24 #define HAVE_ATEXIT
25
26 /* If we don't set MASK_ABICALLS, we can't default to PIC. */
27 #undef TARGET_DEFAULT
28 #define TARGET_DEFAULT (MASK_ABICALLS|MASK_GAS)
29
30
31 /* Provide a STARTFILE_SPEC appropriate for GNU/Linux.  Here we add
32    the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
33    provides part of the support for getting C++ file-scope static
34    object constructed before entering `main'. */
35
36 #undef  STARTFILE_SPEC
37 #define STARTFILE_SPEC \
38   "%{!shared: \
39      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\
40    crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
41
42 /* Provide a ENDFILE_SPEC appropriate for GNU/Linux.  Here we tack on
43    the GNU/Linux magical crtend.o file (see crtstuff.c) which
44    provides part of the support for getting C++ file-scope static
45    object constructed before entering `main', followed by a normal
46    GNU/Linux "finalizer" file, `crtn.o'.  */
47
48 #undef  ENDFILE_SPEC
49 #define ENDFILE_SPEC \
50   "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
51
52 /* From iris5.h */
53 /* -G is incompatible with -KPIC which is the default, so only allow objects
54    in the small data section if the user explicitly asks for it.  */
55 #undef MIPS_DEFAULT_GVALUE
56 #define MIPS_DEFAULT_GVALUE 0
57
58 /* Borrowed from sparc/linux.h */
59 #undef LINK_SPEC
60 #define LINK_SPEC "-Y P,/usr/lib %{shared:-shared} \
61   %{!shared: \
62     %{!ibcs: \
63       %{!static: \
64         %{rdynamic:-export-dynamic} \
65         %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
66         %{static:-static}}}"
67
68
69 #undef SUBTARGET_ASM_SPEC
70 #define SUBTARGET_ASM_SPEC "-KPIC"