OSDN Git Service

PR target/16350
[pf3gnuchains/gcc-fork.git] / gcc / config / arm / bpabi.h
1 /* Configuration file for ARM BPABI targets.
2    Copyright (C) 2004, 2005, 2007
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 #define TARGET_UNWIND_INFO 1
30
31 /* Section 4.1 of the AAPCS requires the use of VFP format.  */
32 #undef  FPUTYPE_DEFAULT
33 #define FPUTYPE_DEFAULT FPUTYPE_VFP
34
35 /* TARGET_BIG_ENDIAN_DEFAULT is set in
36    config.gcc for big endian configurations.  */
37 #if TARGET_BIG_ENDIAN_DEFAULT
38 #define TARGET_ENDIAN_DEFAULT MASK_BIG_END
39 #else
40 #define TARGET_ENDIAN_DEFAULT 0
41 #endif
42
43 /* EABI targets should enable interworking by default.  */
44 #undef  TARGET_DEFAULT
45 #define TARGET_DEFAULT (MASK_INTERWORK | TARGET_ENDIAN_DEFAULT)
46
47 /* The ARM BPABI functions return a boolean; they use no special
48    calling convention.  */
49 #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) TARGET_BPABI
50
51 /* The BPABI integer comparison routines return { -1, 0, 1 }.  */
52 #define TARGET_LIB_INT_CMP_BIASED !TARGET_BPABI
53
54 /* Tell the assembler to build BPABI binaries.  */
55 #undef  SUBTARGET_EXTRA_ASM_SPEC
56 #define SUBTARGET_EXTRA_ASM_SPEC "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=4}"
57
58 /* The generic link spec in elf.h does not support shared libraries.  */
59 #undef  LINK_SPEC
60 #define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} "           \
61   "%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} "        \
62   "-X"
63
64 #if defined (__thumb__)
65 #define RENAME_LIBRARY_SET ".thumb_set"
66 #else
67 #define RENAME_LIBRARY_SET ".set"
68 #endif
69
70 /* Make __aeabi_AEABI_NAME an alias for __GCC_NAME.  */
71 #define RENAME_LIBRARY(GCC_NAME, AEABI_NAME)            \
72   __asm__ (".globl\t__aeabi_" #AEABI_NAME "\n"          \
73            RENAME_LIBRARY_SET "\t__aeabi_" #AEABI_NAME  \
74              ", __" #GCC_NAME "\n");
75
76 /* Give some libgcc functions an additional __aeabi name.  */
77 #ifdef L_muldi3
78 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (muldi3, lmul)
79 #endif
80 #ifdef L_muldi3
81 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (muldi3, lmul)
82 #endif
83 #ifdef L_fixdfdi
84 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixdfdi, d2lz)
85 #endif
86 #ifdef L_fixunsdfdi
87 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunsdfdi, d2ulz)
88 #endif
89 #ifdef L_fixsfdi
90 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixsfdi, f2lz)
91 #endif
92 #ifdef L_fixunssfdi
93 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunssfdi, f2ulz)
94 #endif
95 #ifdef L_floatdidf
96 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdidf, l2d)
97 #endif
98 #ifdef L_floatdisf
99 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdisf, l2f)
100 #endif
101
102 /* The BPABI requires that we always use an out-of-line implementation
103    of RTTI comparison, even if the target supports weak symbols,
104    because the same object file might be used on a target that does
105    not support merging symbols across DLL boundaries.  This macro is
106    broken out separately so that it can be used within
107    TARGET_OS_CPP_BUILTINS in configuration files for systems based on
108    the BPABI.  */
109 #define TARGET_BPABI_CPP_BUILTINS()                     \
110   do                                                    \
111     {                                                   \
112       builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0");      \
113     }                                                   \
114   while (false)
115
116 #undef TARGET_OS_CPP_BUILTINS
117 #define TARGET_OS_CPP_BUILTINS() \
118   TARGET_BPABI_CPP_BUILTINS()
119
120 /* The BPABI specifies the use of .{init,fini}_array.  Therefore, we
121    do not want GCC to put anything into the .{init,fini} sections.  */
122 #undef INIT_SECTION_ASM_OP
123 #undef FINI_SECTION_ASM_OP
124 #define INIT_ARRAY_SECTION_ASM_OP ARM_EABI_CTORS_SECTION_OP
125 #define FINI_ARRAY_SECTION_ASM_OP ARM_EABI_DTORS_SECTION_OP