OSDN Git Service

* config/arm/arm.c (target_float_switch): New variable..
[pf3gnuchains/gcc-fork.git] / gcc / config / arm / linux-elf.h
1 /* Definitions for ARM running Linux-based GNU systems using ELF
2    Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
3    Free Software Foundation, Inc.
4    Contributed by Philip Blundell <philb@gnu.org>
5
6    This file is part of GCC.
7
8    GCC is free software; you can redistribute it and/or modify it
9    under the terms of the GNU General Public License as published
10    by the Free Software Foundation; either version 2, or (at your
11    option) any later version.
12
13    GCC is distributed in the hope that it will be useful, but WITHOUT
14    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
16    License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program; 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 /* elfos.h should have already been included.  Now just override
24    any conflicting definitions and add any extras.  */
25
26 /* Run-time Target Specification.  */
27 #undef  TARGET_VERSION
28 #define TARGET_VERSION  fputs (" (ARM GNU/Linux with ELF)", stderr);
29
30 /* Do not assume anything about header files.  */
31 #define NO_IMPLICIT_EXTERN_C
32
33 #undef  TARGET_DEFAULT_FLOAT_ABI
34 #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
35
36 #undef  TARGET_DEFAULT
37 #define TARGET_DEFAULT (0)
38
39 #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
40
41 #define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
42
43 #undef  MULTILIB_DEFAULTS
44 #define MULTILIB_DEFAULTS \
45         { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
46
47 /* The GNU C++ standard library requires that these macros be defined.  */
48 #undef CPLUSPLUS_CPP_SPEC
49 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
50
51 /* Now we define the strings used to build the spec file.  */
52 #undef  LIB_SPEC
53 #define LIB_SPEC \
54   "%{pthread:-lpthread} \
55    %{shared:-lc} \
56    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
57
58 #define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
59
60 /* Provide a STARTFILE_SPEC appropriate for GNU/Linux.  Here we add
61    the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
62    provides part of the support for getting C++ file-scope static
63    object constructed before entering `main'.  */
64    
65 #undef  STARTFILE_SPEC
66 #define STARTFILE_SPEC \
67   "%{!shared: \
68      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
69                        %{!p:%{profile:gcrt1.o%s} \
70                          %{!profile:crt1.o%s}}}} \
71    crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
72
73 /* Provide a ENDFILE_SPEC appropriate for GNU/Linux.  Here we tack on
74    the GNU/Linux magical crtend.o file (see crtstuff.c) which
75    provides part of the support for getting C++ file-scope static
76    object constructed before entering `main', followed by a normal
77    GNU/Linux "finalizer" file, `crtn.o'.  */
78
79 #undef  ENDFILE_SPEC
80 #define ENDFILE_SPEC \
81   "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
82
83 #undef  LINK_SPEC
84 #define LINK_SPEC "%{h*} %{version:-v} \
85    %{b} %{Wl,*:%*} \
86    %{static:-Bstatic} \
87    %{shared:-shared} \
88    %{symbolic:-Bsymbolic} \
89    %{rdynamic:-export-dynamic} \
90    %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
91    -X \
92    %{mbig-endian:-EB}" \
93    SUBTARGET_EXTRA_LINK_SPEC
94
95 #define TARGET_OS_CPP_BUILTINS()                \
96   do                                            \
97     {                                           \
98         LINUX_TARGET_OS_CPP_BUILTINS();         \
99         if (flag_pic)                           \
100           {                                     \
101                 builtin_define ("__PIC__");     \
102                 builtin_define ("__pic__");     \
103           }                                     \
104     }                                           \
105   while (0)
106
107 /* This is how we tell the assembler that two symbols have the same value.  */
108 #define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \
109   do                                       \
110     {                                      \
111       assemble_name (FILE, NAME1);         \
112       fputs (" = ", FILE);                 \
113       assemble_name (FILE, NAME2);         \
114       fputc ('\n', FILE);                  \
115     }                                      \
116   while (0)
117
118 /* NWFPE always understands FPA instructions.  */
119 #undef  FPUTYPE_DEFAULT
120 #define FPUTYPE_DEFAULT FPUTYPE_FPA_EMU3
121
122 /* Call the function profiler with a given profile label.  */
123 #undef  ARM_FUNCTION_PROFILER
124 #define ARM_FUNCTION_PROFILER(STREAM, LABELNO)                          \
125 {                                                                       \
126   fprintf (STREAM, "\tbl\tmcount%s\n", NEED_PLT_RELOC ? "(PLT)" : "");  \
127 }
128
129 /* The linux profiler clobbers the link register.  Make sure the
130    prologue knows to save it.  */
131 #define PROFILE_HOOK(X)                                         \
132   emit_insn (gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, LR_REGNUM)))
133
134 #undef  CC1_SPEC
135 #define CC1_SPEC "%{profile:-p}"
136
137 #define LINK_GCC_C_SEQUENCE_SPEC \
138   "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
139
140 /* Use --as-needed -lgcc_s for eh support.  */
141 #ifdef HAVE_LD_AS_NEEDED
142 #define USE_LD_AS_NEEDED 1
143 #endif