OSDN Git Service

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