OSDN Git Service

* gbl-ctors.h: Lose HAVE_ATEXIT. Don't define ON_EXIT.
[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, 1999 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 /* If we don't set MASK_ABICALLS, we can't default to PIC. */
25 #undef TARGET_DEFAULT
26 #define TARGET_DEFAULT (MASK_ABICALLS|MASK_GAS)
27
28
29 /* Provide a STARTFILE_SPEC appropriate for GNU/Linux.  Here we add
30    the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
31    provides part of the support for getting C++ file-scope static
32    object constructed before entering `main'. */
33
34 #undef  STARTFILE_SPEC
35 #define STARTFILE_SPEC \
36   "%{!shared: \
37      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\
38    crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
39
40 /* Provide a ENDFILE_SPEC appropriate for GNU/Linux.  Here we tack on
41    the GNU/Linux magical crtend.o file (see crtstuff.c) which
42    provides part of the support for getting C++ file-scope static
43    object constructed before entering `main', followed by a normal
44    GNU/Linux "finalizer" file, `crtn.o'.  */
45
46 #undef  ENDFILE_SPEC
47 #define ENDFILE_SPEC \
48   "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
49
50 /* From iris5.h */
51 /* -G is incompatible with -KPIC which is the default, so only allow objects
52    in the small data section if the user explicitly asks for it.  */
53 #undef MIPS_DEFAULT_GVALUE
54 #define MIPS_DEFAULT_GVALUE 0
55
56 #undef LIB_SPEC
57 /* Taken from sparc/linux.h.  */
58 #define LIB_SPEC \
59   "%{shared: -lc} \
60    %{!shared: %{mieee-fp:-lieee} %{pthread:-lpthread} \
61      %{profile:-lc_p} %{!profile: -lc}}"
62
63 /* Borrowed from sparc/linux.h */
64 #undef LINK_SPEC
65 #define LINK_SPEC "-Y P,/usr/lib %{shared:-shared} \
66   %{!shared: \
67     %{!ibcs: \
68       %{!static: \
69         %{rdynamic:-export-dynamic} \
70         %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
71         %{static:-static}}}"
72
73
74 #undef SUBTARGET_ASM_SPEC
75 #define SUBTARGET_ASM_SPEC "-KPIC"
76
77 /* Undefine the following which were defined in elf.h.  This will cause the linux
78    port to continue to use collect2 for constructors/destructors.  These may be removed
79    when .ctor/.dtor section support is desired. */
80
81 #undef CTORS_SECTION_ASM_OP
82 #undef DTORS_SECTION_ASM_OP
83
84 #undef EXTRA_SECTIONS
85 #define EXTRA_SECTIONS in_sdata, in_rdata
86
87 #undef INVOKE__main
88 #undef NAME__MAIN
89 #undef SYMBOL__MAIN
90
91 #undef EXTRA_SECTION_FUNCTIONS
92 #define EXTRA_SECTION_FUNCTIONS                                         \
93   SECTION_FUNCTION_TEMPLATE(sdata_section, in_sdata, SDATA_SECTION_ASM_OP) \
94   SECTION_FUNCTION_TEMPLATE(rdata_section, in_rdata, RDATA_SECTION_ASM_OP)
95
96 #undef ASM_OUTPUT_CONSTRUCTOR
97 #undef ASM_OUTPUT_DESTRUCTOR
98
99 #undef CTOR_LIST_BEGIN
100 #undef CTOR_LIST_END
101 #undef DTOR_LIST_BEGIN
102 #undef DTOR_LIST_END
103
104 /*  End of undefines to turn off .ctor/.dtor section support */