OSDN Git Service

2010-12-20 Sanjin Liu <scliu@faraday-tech.com>
[pf3gnuchains/gcc-fork.git] / gcc / config / arm / bpabi.h
1 /* Configuration file for ARM BPABI targets.
2    Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010
3    Free Software Foundation, Inc.
4    Contributed by CodeSourcery, LLC   
5
6    This file is part of GCC.
7
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 3, or (at your
11    option) any later version.
12
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.
17
18    You should have received a copy of the GNU General Public License
19    along with GCC; see the file COPYING3.  If not see
20    <http://www.gnu.org/licenses/>.  */
21
22 /* Use the AAPCS ABI by default.  */
23 #define ARM_DEFAULT_ABI ARM_ABI_AAPCS
24
25 /* Assume that AAPCS ABIs should adhere to the full BPABI.  */ 
26 #define TARGET_BPABI (TARGET_AAPCS_BASED)
27
28 /* BPABI targets use EABI frame unwinding tables.  */
29 #undef ARM_UNWIND_INFO
30 #define ARM_UNWIND_INFO 1
31
32 /* Section 4.1 of the AAPCS requires the use of VFP format.  */
33 #undef  FPUTYPE_DEFAULT
34 #define FPUTYPE_DEFAULT "vfp"
35
36 /* TARGET_BIG_ENDIAN_DEFAULT is set in
37    config.gcc for big endian configurations.  */
38 #if TARGET_BIG_ENDIAN_DEFAULT
39 #define TARGET_ENDIAN_DEFAULT MASK_BIG_END
40 #else
41 #define TARGET_ENDIAN_DEFAULT 0
42 #endif
43
44 /* EABI targets should enable interworking by default.  */
45 #undef  TARGET_DEFAULT
46 #define TARGET_DEFAULT (MASK_INTERWORK | TARGET_ENDIAN_DEFAULT)
47
48 /* The ARM BPABI functions return a boolean; they use no special
49    calling convention.  */
50 #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) TARGET_BPABI
51
52 /* The BPABI integer comparison routines return { -1, 0, 1 }.  */
53 #define TARGET_LIB_INT_CMP_BIASED !TARGET_BPABI
54
55 #define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\
56   "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}"
57
58 #define BE8_LINK_SPEC " %{mbig-endian:%{march=armv7-a|mcpu=cortex-a5"\
59   "|mcpu=cortex-a8|mcpu=cortex-a9|mcpu=cortex-a15:%{!r:--be8}}}"
60
61 /* Tell the assembler to build BPABI binaries.  */
62 #undef  SUBTARGET_EXTRA_ASM_SPEC
63 #define SUBTARGET_EXTRA_ASM_SPEC \
64   "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=5}" TARGET_FIX_V4BX_SPEC
65
66 #ifndef SUBTARGET_EXTRA_LINK_SPEC
67 #define SUBTARGET_EXTRA_LINK_SPEC ""
68 #endif
69
70 /* The generic link spec in elf.h does not support shared libraries.  */
71 #define BPABI_LINK_SPEC \
72   "%{mbig-endian:-EB} %{mlittle-endian:-EL} "           \
73   "%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} "        \
74   "-X" SUBTARGET_EXTRA_LINK_SPEC TARGET_FIX_V4BX_SPEC BE8_LINK_SPEC
75
76 #undef  LINK_SPEC
77 #define LINK_SPEC BPABI_LINK_SPEC
78
79 /* The BPABI requires that we always use an out-of-line implementation
80    of RTTI comparison, even if the target supports weak symbols,
81    because the same object file might be used on a target that does
82    not support merging symbols across DLL boundaries.  This macro is
83    broken out separately so that it can be used within
84    TARGET_OS_CPP_BUILTINS in configuration files for systems based on
85    the BPABI.  */
86 #define TARGET_BPABI_CPP_BUILTINS()                     \
87   do                                                    \
88     {                                                   \
89       builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0");      \
90     }                                                   \
91   while (false)
92
93 #undef TARGET_OS_CPP_BUILTINS
94 #define TARGET_OS_CPP_BUILTINS() \
95   TARGET_BPABI_CPP_BUILTINS()
96
97 /* The BPABI specifies the use of .{init,fini}_array.  Therefore, we
98    do not want GCC to put anything into the .{init,fini} sections.  */
99 #undef INIT_SECTION_ASM_OP
100 #undef FINI_SECTION_ASM_OP
101 #define INIT_ARRAY_SECTION_ASM_OP ARM_EABI_CTORS_SECTION_OP
102 #define FINI_ARRAY_SECTION_ASM_OP ARM_EABI_DTORS_SECTION_OP
103
104 /* The legacy _mcount implementation assumes r11 points to a
105     4-word APCS frame.  This is generally not true for EABI targets,
106     particularly not in Thumb mode.  We assume the mcount
107     implementation does not require a counter variable (No Counter).
108     Note that __gnu_mcount_nc will be entered with a misaligned stack.
109     This is OK because it uses a special calling convention anyway.  */
110
111 #undef  NO_PROFILE_COUNTERS
112 #define NO_PROFILE_COUNTERS 1
113 #undef  ARM_FUNCTION_PROFILER
114 #define ARM_FUNCTION_PROFILER(STREAM, LABELNO)                          \
115 {                                                                       \
116   fprintf (STREAM, "\tpush\t{lr}\n");                                   \
117   fprintf (STREAM, "\tbl\t__gnu_mcount_nc\n");                          \
118 }
119
120 #undef SUBTARGET_FRAME_POINTER_REQUIRED
121 #define SUBTARGET_FRAME_POINTER_REQUIRED 0
122
123 /* __gnu_mcount_nc restores the original LR value before returning.  Ensure
124    that there is no unnecessary hook set up.  */
125 #undef PROFILE_HOOK