* config/m32r/m32r.h: Add support for m32r2 processor. Including
[official-gcc.git] / gcc / config / arm / linux-elf.h
blobbcc9749b3ca98b5af81bcf1f618d4688a8a41c2c
1 /* Definitions for ARM running Linux-based GNU systems using ELF
2 Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003
3 Free Software Foundation, Inc.
4 Contributed by Philip Blundell <philb@gnu.org>
6 This file is part of GCC.
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.
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.
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. */
23 /* elfos.h should have already been included. Now just override
24 any conflicting definitions and add any extras. */
26 /* Run-time Target Specification. */
27 #undef TARGET_VERSION
28 #define TARGET_VERSION fputs (" (ARM GNU/Linux with ELF)", stderr);
30 /* Do not assume anything about header files. */
31 #define NO_IMPLICIT_EXTERN_C
33 /* Default is to use APCS-32 mode. */
34 #undef TARGET_DEFAULT
35 #define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS)
37 #define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
39 #undef MULTILIB_DEFAULTS
40 #define MULTILIB_DEFAULTS \
41 { "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" }
43 #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
45 /* The GNU C++ standard library requires that these macros be defined. */
46 #undef CPLUSPLUS_CPP_SPEC
47 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
49 /* Now we define the strings used to build the spec file. */
50 #undef LIB_SPEC
51 #define LIB_SPEC \
52 "%{pthread:-lpthread} \
53 %{shared:-lc} \
54 %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
56 #define LIBGCC_SPEC "%{msoft-float:-lfloat} -lgcc"
58 /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
59 the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
60 provides part of the support for getting C++ file-scope static
61 object constructed before entering `main'. */
63 #undef STARTFILE_SPEC
64 #define STARTFILE_SPEC \
65 "%{!shared: \
66 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
67 %{!p:%{profile:gcrt1.o%s} \
68 %{!profile:crt1.o%s}}}} \
69 crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
71 /* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on
72 the GNU/Linux magical crtend.o file (see crtstuff.c) which
73 provides part of the support for getting C++ file-scope static
74 object constructed before entering `main', followed by a normal
75 GNU/Linux "finalizer" file, `crtn.o'. */
77 #undef ENDFILE_SPEC
78 #define ENDFILE_SPEC \
79 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
81 #undef LINK_SPEC
82 #define LINK_SPEC "%{h*} %{version:-v} \
83 %{b} %{Wl,*:%*} \
84 %{static:-Bstatic} \
85 %{shared:-shared} \
86 %{symbolic:-Bsymbolic} \
87 %{rdynamic:-export-dynamic} \
88 %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
89 -X \
90 %{mbig-endian:-EB}" \
91 SUBTARGET_EXTRA_LINK_SPEC
93 #define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
95 /* This is how we tell the assembler that two symbols have the same value. */
96 #define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \
97 do \
98 { \
99 assemble_name (FILE, NAME1); \
100 fputs (" = ", FILE); \
101 assemble_name (FILE, NAME2); \
102 fputc ('\n', FILE); \
104 while (0)
106 /* NWFPE always understands FPA instructions. */
107 #undef FPUTYPE_DEFAULT
108 #define FPUTYPE_DEFAULT FPUTYPE_FPA_EMU3
110 /* Call the function profiler with a given profile label. */
111 #undef ARM_FUNCTION_PROFILER
112 #define ARM_FUNCTION_PROFILER(STREAM, LABELNO) \
114 fprintf (STREAM, "\tbl\tmcount%s\n", NEED_PLT_RELOC ? "(PLT)" : ""); \
117 /* The linux profiler clobbers the link register. Make sure the
118 prologue knows to save it. */
119 #define PROFILE_HOOK(X) \
120 emit_insn (gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, LR_REGNUM)))
122 #undef CC1_SPEC
123 #define CC1_SPEC "%{profile:-p}"
125 #define LINK_GCC_C_SEQUENCE_SPEC \
126 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"