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, 2006
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#undef  TARGET_DEFAULT_FLOAT_ABI
32#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
33
34#undef  TARGET_DEFAULT
35#define TARGET_DEFAULT (0)
36
37#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
38
39#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
40
41#undef  MULTILIB_DEFAULTS
42#define MULTILIB_DEFAULTS \
43	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
44
45/* Now we define the strings used to build the spec file.  */
46#undef  LIB_SPEC
47#define LIB_SPEC \
48  "%{pthread:-lpthread} \
49   %{shared:-lc} \
50   %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
51
52#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
53
54#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
55
56#define LINUX_TARGET_LINK_SPEC  "%{h*} %{version:-v} \
57   %{b} \
58   %{static:-Bstatic} \
59   %{shared:-shared} \
60   %{symbolic:-Bsymbolic} \
61   %{rdynamic:-export-dynamic} \
62   %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "} \
63   -X \
64   %{mbig-endian:-EB}" \
65   SUBTARGET_EXTRA_LINK_SPEC
66
67#undef  LINK_SPEC
68#define LINK_SPEC LINUX_TARGET_LINK_SPEC
69
70#define TARGET_OS_CPP_BUILTINS()		\
71  do						\
72    {						\
73	LINUX_TARGET_OS_CPP_BUILTINS();		\
74    }						\
75  while (0)
76
77/* This is how we tell the assembler that two symbols have the same value.  */
78#define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \
79  do					   \
80    {					   \
81      assemble_name (FILE, NAME1); 	   \
82      fputs (" = ", FILE);		   \
83      assemble_name (FILE, NAME2);	   \
84      fputc ('\n', FILE);		   \
85    }					   \
86  while (0)
87
88/* NWFPE always understands FPA instructions.  */
89#undef  FPUTYPE_DEFAULT
90#define FPUTYPE_DEFAULT FPUTYPE_FPA_EMU3
91
92/* Call the function profiler with a given profile label.  */
93#undef  ARM_FUNCTION_PROFILER
94#define ARM_FUNCTION_PROFILER(STREAM, LABELNO)  			\
95{									\
96  fprintf (STREAM, "\tbl\tmcount%s\n",					\
97	   (TARGET_ARM && NEED_PLT_RELOC) ? "(PLT)" : "");		\
98}
99
100/* The GNU/Linux profiler clobbers the link register.  Make sure the
101   prologue knows to save it.  */
102#define PROFILE_HOOK(X)						\
103  emit_insn (gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, LR_REGNUM)))
104
105/* The GNU/Linux profiler needs a frame pointer.  */
106#define SUBTARGET_FRAME_POINTER_REQUIRED current_function_profile
107