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, 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, 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"
85 #define LINK_SPEC "%{h*} %{version:-v} \
89 %{symbolic:-Bsymbolic} \
90 %{rdynamic:-export-dynamic} \
91 %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
94 SUBTARGET_EXTRA_LINK_SPEC
96 #define TARGET_OS_CPP_BUILTINS() \
99 LINUX_TARGET_OS_CPP_BUILTINS(); \
102 builtin_define ("__PIC__"); \
103 builtin_define ("__pic__"); \
108 /* This is how we tell the assembler that two symbols have the same value. */
109 #define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \
112 assemble_name (FILE, NAME1); \
113 fputs (" = ", FILE); \
114 assemble_name (FILE, NAME2); \
115 fputc ('\n', FILE); \
119 /* NWFPE always understands FPA instructions. */
120 #undef FPUTYPE_DEFAULT
121 #define FPUTYPE_DEFAULT FPUTYPE_FPA_EMU3
123 /* Call the function profiler with a given profile label. */
124 #undef ARM_FUNCTION_PROFILER
125 #define ARM_FUNCTION_PROFILER(STREAM, LABELNO) \
127 fprintf (STREAM, "\tbl\tmcount%s\n", \
128 (TARGET_ARM && NEED_PLT_RELOC) ? "(PLT)" : ""); \
131 /* The 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)))
137 #define CC1_SPEC "%{profile:-p}"
139 #define LINK_GCC_C_SEQUENCE_SPEC \
140 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
142 /* Use --as-needed -lgcc_s for eh support. */
143 #ifdef HAVE_LD_AS_NEEDED
144 #define USE_LD_AS_NEEDED 1