Merge from trunk @ 138209
[official-gcc.git] / gcc / config / arm / bpabi.h
blobe28d9ead45e77a42ea2f2c88907b6d3452ebad29
1 /* Configuration file for ARM BPABI targets.
2 Copyright (C) 2004, 2005, 2007, 2008
3 Free Software Foundation, Inc.
4 Contributed by CodeSourcery, LLC
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 3, 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 GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
22 /* Use the AAPCS ABI by default. */
23 #define ARM_DEFAULT_ABI ARM_ABI_AAPCS
25 /* Assume that AAPCS ABIs should adhere to the full BPABI. */
26 #define TARGET_BPABI (TARGET_AAPCS_BASED)
28 /* BPABI targets use EABI frame unwinding tables. */
29 #define TARGET_UNWIND_INFO 1
31 /* Section 4.1 of the AAPCS requires the use of VFP format. */
32 #undef FPUTYPE_DEFAULT
33 #define FPUTYPE_DEFAULT FPUTYPE_VFP
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
43 /* EABI targets should enable interworking by default. */
44 #undef TARGET_DEFAULT
45 #define TARGET_DEFAULT (MASK_INTERWORK | TARGET_ENDIAN_DEFAULT)
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
51 /* The BPABI integer comparison routines return { -1, 0, 1 }. */
52 #define TARGET_LIB_INT_CMP_BIASED !TARGET_BPABI
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}"
58 #ifndef SUBTARGET_EXTRA_LINK_SPEC
59 #define SUBTARGET_EXTRA_LINK_SPEC ""
60 #endif
62 /* The generic link spec in elf.h does not support shared libraries. */
63 #define BPABI_LINK_SPEC \
64 "%{mbig-endian:-EB} %{mlittle-endian:-EL} " \
65 "%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} " \
66 "-X" SUBTARGET_EXTRA_LINK_SPEC
68 #undef LINK_SPEC
69 #define LINK_SPEC BPABI_LINK_SPEC
71 #if defined (__thumb__)
72 #define RENAME_LIBRARY_SET ".thumb_set"
73 #else
74 #define RENAME_LIBRARY_SET ".set"
75 #endif
77 /* Make __aeabi_AEABI_NAME an alias for __GCC_NAME. */
78 #define RENAME_LIBRARY(GCC_NAME, AEABI_NAME) \
79 __asm__ (".globl\t__aeabi_" #AEABI_NAME "\n" \
80 RENAME_LIBRARY_SET "\t__aeabi_" #AEABI_NAME \
81 ", __" #GCC_NAME "\n");
83 /* Give some libgcc functions an additional __aeabi name. */
84 #ifdef L_muldi3
85 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (muldi3, lmul)
86 #endif
87 #ifdef L_muldi3
88 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (muldi3, lmul)
89 #endif
90 #ifdef L_fixdfdi
91 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixdfdi, d2lz)
92 #endif
93 #ifdef L_fixunsdfdi
94 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunsdfdi, d2ulz)
95 #endif
96 #ifdef L_fixsfdi
97 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixsfdi, f2lz)
98 #endif
99 #ifdef L_fixunssfdi
100 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunssfdi, f2ulz)
101 #endif
102 #ifdef L_floatdidf
103 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdidf, l2d)
104 #endif
105 #ifdef L_floatdisf
106 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdisf, l2f)
107 #endif
109 /* These renames are needed on ARMv6M. Other targets get them from
110 assembly routines. */
111 #ifdef L_fixunsdfsi
112 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunsdfsi, d2uiz)
113 #endif
114 #ifdef L_fixunssfsi
115 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunssfsi, f2uiz)
116 #endif
117 #ifdef L_floatundidf
118 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatundidf, ul2d)
119 #endif
120 #ifdef L_floatundisf
121 #define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatundisf, ul2f)
122 #endif
124 /* The BPABI requires that we always use an out-of-line implementation
125 of RTTI comparison, even if the target supports weak symbols,
126 because the same object file might be used on a target that does
127 not support merging symbols across DLL boundaries. This macro is
128 broken out separately so that it can be used within
129 TARGET_OS_CPP_BUILTINS in configuration files for systems based on
130 the BPABI. */
131 #define TARGET_BPABI_CPP_BUILTINS() \
132 do \
134 builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0"); \
136 while (false)
138 #undef TARGET_OS_CPP_BUILTINS
139 #define TARGET_OS_CPP_BUILTINS() \
140 TARGET_BPABI_CPP_BUILTINS()
142 /* The BPABI specifies the use of .{init,fini}_array. Therefore, we
143 do not want GCC to put anything into the .{init,fini} sections. */
144 #undef INIT_SECTION_ASM_OP
145 #undef FINI_SECTION_ASM_OP
146 #define INIT_ARRAY_SECTION_ASM_OP ARM_EABI_CTORS_SECTION_OP
147 #define FINI_ARRAY_SECTION_ASM_OP ARM_EABI_DTORS_SECTION_OP