OSDN Git Service

* config/mips/linux.h (NO_IMPLICIT_EXTERN_C): Define.
[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 #undef TARGET_VERSION
22 #if TARGET_ENDIAN_DEFAULT == 0
23 #define TARGET_VERSION fprintf (stderr, " (MIPSel GNU/ELF)");
24 #else
25 #define TARGET_VERSION fprintf (stderr, " (MIPS GNU/ELF)");
26 #endif
27
28 /* Required to keep collect2.c happy */
29 #undef OBJECT_FORMAT_COFF 
30
31 /* If we don't set MASK_ABICALLS, we can't default to PIC. */
32 #undef TARGET_DEFAULT
33 #define TARGET_DEFAULT (MASK_ABICALLS|MASK_GAS)
34
35
36 /* Handle #pragma weak and #pragma pack.  */
37 #define HANDLE_SYSV_PRAGMA 1
38
39 /* Use more efficient ``thunks'' to implement C++ vtables. */
40 #undef DEFAULT_VTABLE_THUNKS
41 #define DEFAULT_VTABLE_THUNKS 1
42
43 /* Don't assume anything about the header files.  */
44 #define NO_IMPLICIT_EXTERN_C
45
46 /* Generate calls to memcpy, etc., not bcopy, etc.  */
47 #define TARGET_MEM_FUNCTIONS
48
49 /* Specify predefined symbols in preprocessor.  */
50 #undef CPP_PREDEFINES
51 #if TARGET_ENDIAN_DEFAULT == 0
52 #define CPP_PREDEFINES "-DMIPSEL -D_MIPSEL -Dunix -Dmips -D_mips \
53 -DR3000 -D_R3000 -Dlinux -Asystem(posix) -Acpu(mips) \
54 -Amachine(mips) -D__ELF__"
55 #else
56 #define CPP_PREDEFINES "-DMIPSEB -D_MIPSEB -Dunix -Dmips -D_mips \
57 -DR3000 -D_R3000 -Dlinux -Asystem(posix) -Acpu(mips) \
58 -Amachine(mips) -D__ELF__"
59 #endif
60
61 /* Provide a STARTFILE_SPEC appropriate for GNU/Linux.  Here we add
62    the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
63    provides part of the support for getting C++ file-scope static
64    object constructed before entering `main'. */
65
66 #undef  STARTFILE_SPEC
67 #define STARTFILE_SPEC \
68   "%{!shared: \
69      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\
70    crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
71
72 /* Provide a ENDFILE_SPEC appropriate for GNU/Linux.  Here we tack on
73    the GNU/Linux magical crtend.o file (see crtstuff.c) which
74    provides part of the support for getting C++ file-scope static
75    object constructed before entering `main', followed by a normal
76    GNU/Linux "finalizer" file, `crtn.o'.  */
77
78 #undef  ENDFILE_SPEC
79 #define ENDFILE_SPEC \
80   "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
81
82 /* From iris5.h */
83 /* -G is incompatible with -KPIC which is the default, so only allow objects
84    in the small data section if the user explicitly asks for it.  */
85 #undef MIPS_DEFAULT_GVALUE
86 #define MIPS_DEFAULT_GVALUE 0
87
88 #undef LIB_SPEC
89 /* Taken from sparc/linux.h.  */
90 #define LIB_SPEC \
91   "%{shared: -lc} \
92    %{!shared: %{mieee-fp:-lieee} %{pthread:-lpthread} \
93      %{profile:-lc_p} %{!profile: -lc}}"
94
95 /* Borrowed from sparc/linux.h */
96 #undef LINK_SPEC
97 #define LINK_SPEC "%{shared:-shared} \
98   %{!shared: \
99     %{!ibcs: \
100       %{!static: \
101         %{rdynamic:-export-dynamic} \
102         %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
103         %{static:-static}}}"
104
105
106 #undef SUBTARGET_ASM_SPEC
107 #define SUBTARGET_ASM_SPEC "-KPIC"
108
109 /* Undefine the following which were defined in elf.h.  This will cause the linux
110    port to continue to use collect2 for constructors/destructors.  These may be removed
111    when .ctor/.dtor section support is desired. */
112
113 #undef CTORS_SECTION_ASM_OP
114 #undef DTORS_SECTION_ASM_OP
115
116 #undef EXTRA_SECTIONS
117 #define EXTRA_SECTIONS in_sdata, in_sbss, in_rdata
118
119 #undef INVOKE__main
120 #undef NAME__MAIN
121 #undef SYMBOL__MAIN
122
123 #undef EXTRA_SECTION_FUNCTIONS
124 #define EXTRA_SECTION_FUNCTIONS                                         \
125   SECTION_FUNCTION_TEMPLATE(sdata_section, in_sdata, SDATA_SECTION_ASM_OP) \
126   SECTION_FUNCTION_TEMPLATE(sbss_section, in_sbss, SBSS_SECTION_ASM_OP) \
127   SECTION_FUNCTION_TEMPLATE(rdata_section, in_rdata, RDATA_SECTION_ASM_OP)
128
129 #undef ASM_OUTPUT_CONSTRUCTOR
130 #undef ASM_OUTPUT_DESTRUCTOR
131
132 #undef CTOR_LIST_BEGIN
133 #undef CTOR_LIST_END
134 #undef DTOR_LIST_BEGIN
135 #undef DTOR_LIST_END
136
137 /*  End of undefines to turn off .ctor/.dtor section support */