1 /* Definitions for ARM running Linux-based GNU systems using ELF
2 Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 Free Software Foundation, Inc.
5 Contributed by Philip Blundell <philb@gnu.org>
7 This file is part of GCC.
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.
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.
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. */
24 /* elfos.h should have already been included. Now just override
25 any conflicting definitions and add any extras. */
27 /* Run-time Target Specification. */
29 #define TARGET_VERSION fputs (" (ARM GNU/Linux with ELF)", stderr);
31 /* Do not assume anything about header files. */
32 #define NO_IMPLICIT_EXTERN_C
34 #undef TARGET_DEFAULT_FLOAT_ABI
35 #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
38 #define TARGET_DEFAULT (0)
40 #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
42 #define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
44 #undef MULTILIB_DEFAULTS
45 #define MULTILIB_DEFAULTS \
46 { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
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)"
52 /* Now we define the strings used to build the spec file. */
55 "%{pthread:-lpthread} \
57 %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
59 #define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
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'. */
67 #define STARTFILE_SPEC \
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}"
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'. */
81 #define ENDFILE_SPEC \
82 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
84 #define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.2"
86 #define LINUX_TARGET_LINK_SPEC "%{h*} %{version:-v} \
90 %{symbolic:-Bsymbolic} \
91 %{rdynamic:-export-dynamic} \
92 %{!dynamic-linker:-dynamic-linker " LINUX_TARGET_INTERPRETER "} \
95 SUBTARGET_EXTRA_LINK_SPEC
98 #define LINK_SPEC LINUX_TARGET_LINK_SPEC
100 #define TARGET_OS_CPP_BUILTINS() \
103 LINUX_TARGET_OS_CPP_BUILTINS(); \
106 builtin_define ("__PIC__"); \
107 builtin_define ("__pic__"); \
112 /* This is how we tell the assembler that two symbols have the same value. */
113 #define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \
116 assemble_name (FILE, NAME1); \
117 fputs (" = ", FILE); \
118 assemble_name (FILE, NAME2); \
119 fputc ('\n', FILE); \
123 /* NWFPE always understands FPA instructions. */
124 #undef FPUTYPE_DEFAULT
125 #define FPUTYPE_DEFAULT FPUTYPE_FPA_EMU3
127 /* Call the function profiler with a given profile label. */
128 #undef ARM_FUNCTION_PROFILER
129 #define ARM_FUNCTION_PROFILER(STREAM, LABELNO) \
131 fprintf (STREAM, "\tbl\tmcount%s\n", \
132 (TARGET_ARM && NEED_PLT_RELOC) ? "(PLT)" : ""); \
135 /* The GNU/Linux profiler clobbers the link register. Make sure the
136 prologue knows to save it. */
137 #define PROFILE_HOOK(X) \
138 emit_insn (gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, LR_REGNUM)))
140 /* The GNU/Linux profiler needs a frame pointer. */
141 #define SUBTARGET_FRAME_POINTER_REQUIRED current_function_profile
144 #define CC1_SPEC "%{profile:-p}"
146 #define LINK_GCC_C_SEQUENCE_SPEC \
147 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
149 /* Use --as-needed -lgcc_s for eh support. */
150 #ifdef HAVE_LD_AS_NEEDED
151 #define USE_LD_AS_NEEDED 1