]>
Commit | Line | Data |
---|---|---|
b3f8d95d | 1 | /* Configuration file for ARM BPABI targets. |
99dee823 | 2 | Copyright (C) 2004-2021 Free Software Foundation, Inc. |
b3f8d95d MM |
3 | Contributed by CodeSourcery, LLC |
4 | ||
5 | This file is part of GCC. | |
6 | ||
7 | GCC is free software; you can redistribute it and/or modify it | |
8 | under the terms of the GNU General Public License as published | |
2f83c7d6 | 9 | by the Free Software Foundation; either version 3, or (at your |
b3f8d95d MM |
10 | option) any later version. |
11 | ||
12 | GCC is distributed in the hope that it will be useful, but WITHOUT | |
13 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
14 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public | |
15 | License for more details. | |
16 | ||
999db125 GJL |
17 | Under Section 7 of GPL version 3, you are granted additional |
18 | permissions described in the GCC Runtime Library Exception, version | |
19 | 3.1, as published by the Free Software Foundation. | |
20 | ||
c7eca9fe GJL |
21 | You should have received a copy of the GNU General Public License and |
22 | a copy of the GCC Runtime Library Exception along with this program; | |
23 | see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | |
2f83c7d6 | 24 | <http://www.gnu.org/licenses/>. */ |
b3f8d95d MM |
25 | |
26 | /* Use the AAPCS ABI by default. */ | |
27 | #define ARM_DEFAULT_ABI ARM_ABI_AAPCS | |
28 | ||
63d03dce | 29 | /* Assume that AAPCS ABIs should adhere to the full BPABI. */ |
b3f8d95d MM |
30 | #define TARGET_BPABI (TARGET_AAPCS_BASED) |
31 | ||
617a1b71 | 32 | /* BPABI targets use EABI frame unwinding tables. */ |
f0a0390e RH |
33 | #undef ARM_UNWIND_INFO |
34 | #define ARM_UNWIND_INFO 1 | |
617a1b71 | 35 | |
d3a9662c BF |
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 | ||
077fc835 | 44 | /* EABI targets should enable interworking by default. */ |
d3a9662c BF |
45 | #undef TARGET_DEFAULT |
46 | #define TARGET_DEFAULT (MASK_INTERWORK | TARGET_ENDIAN_DEFAULT) | |
077fc835 | 47 | |
b3f8d95d MM |
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 | ||
c112cf2b | 52 | /* The BPABI integer comparison routines return { -1, 0, 1 }. */ |
b3f8d95d MM |
53 | #define TARGET_LIB_INT_CMP_BIASED !TARGET_BPABI |
54 | ||
c02a5ccb SL |
55 | #define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\ |
56 | "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}" | |
26272ba2 | 57 | |
45d53c67 CL |
58 | #define TARGET_FDPIC_ASM_SPEC "" |
59 | ||
63d03dce RE |
60 | #define BE8_LINK_SPEC \ |
61 | "%{!r:%{!mbe32:%:be8_linkopt(%{mlittle-endian:little}" \ | |
62 | " %{mbig-endian:big}" \ | |
63 | " %{mbe8:be8}" \ | |
64 | " %{march=*:arch %*})}}" | |
7664c548 | 65 | |
87c2399d | 66 | /* Tell the assembler to build BPABI binaries. */ |
d3a9662c | 67 | #undef SUBTARGET_EXTRA_ASM_SPEC |
c02a5ccb | 68 | #define SUBTARGET_EXTRA_ASM_SPEC \ |
45d53c67 CL |
69 | "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=5}" TARGET_FIX_V4BX_SPEC \ |
70 | TARGET_FDPIC_ASM_SPEC | |
87c2399d | 71 | |
433d52fd PB |
72 | #ifndef SUBTARGET_EXTRA_LINK_SPEC |
73 | #define SUBTARGET_EXTRA_LINK_SPEC "" | |
74 | #endif | |
75 | ||
37953bd3 MF |
76 | /* Split out the EABI common values so other targets can use it. */ |
77 | #define EABI_LINK_SPEC \ | |
78 | TARGET_FIX_V4BX_SPEC BE8_LINK_SPEC | |
79 | ||
b3f8d95d | 80 | /* The generic link spec in elf.h does not support shared libraries. */ |
8abc1906 DK |
81 | #define BPABI_LINK_SPEC \ |
82 | "%{mbig-endian:-EB} %{mlittle-endian:-EL} " \ | |
b3f8d95d | 83 | "%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} " \ |
37953bd3 | 84 | "-X" SUBTARGET_EXTRA_LINK_SPEC EABI_LINK_SPEC |
b3f8d95d | 85 | |
8abc1906 DK |
86 | #undef LINK_SPEC |
87 | #define LINK_SPEC BPABI_LINK_SPEC | |
88 | ||
40a1c5cb MM |
89 | /* The BPABI requires that we always use an out-of-line implementation |
90 | of RTTI comparison, even if the target supports weak symbols, | |
91 | because the same object file might be used on a target that does | |
92 | not support merging symbols across DLL boundaries. This macro is | |
93 | broken out separately so that it can be used within | |
94 | TARGET_OS_CPP_BUILTINS in configuration files for systems based on | |
95 | the BPABI. */ | |
96 | #define TARGET_BPABI_CPP_BUILTINS() \ | |
97 | do \ | |
98 | { \ | |
b54c93b7 | 99 | builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0"); \ |
40a1c5cb MM |
100 | } \ |
101 | while (false) | |
102 | ||
077fc835 | 103 | #undef TARGET_OS_CPP_BUILTINS |
40a1c5cb MM |
104 | #define TARGET_OS_CPP_BUILTINS() \ |
105 | TARGET_BPABI_CPP_BUILTINS() | |
7abc66b1 JB |
106 | |
107 | /* The BPABI specifies the use of .{init,fini}_array. Therefore, we | |
108 | do not want GCC to put anything into the .{init,fini} sections. */ | |
109 | #undef INIT_SECTION_ASM_OP | |
110 | #undef FINI_SECTION_ASM_OP | |
111 | #define INIT_ARRAY_SECTION_ASM_OP ARM_EABI_CTORS_SECTION_OP | |
112 | #define FINI_ARRAY_SECTION_ASM_OP ARM_EABI_DTORS_SECTION_OP | |
a7e8c652 PB |
113 | |
114 | /* The legacy _mcount implementation assumes r11 points to a | |
115 | 4-word APCS frame. This is generally not true for EABI targets, | |
116 | particularly not in Thumb mode. We assume the mcount | |
117 | implementation does not require a counter variable (No Counter). | |
118 | Note that __gnu_mcount_nc will be entered with a misaligned stack. | |
119 | This is OK because it uses a special calling convention anyway. */ | |
120 | ||
d53767cc AS |
121 | #undef NO_PROFILE_COUNTERS |
122 | #define NO_PROFILE_COUNTERS 1 | |
a7e8c652 PB |
123 | #undef ARM_FUNCTION_PROFILER |
124 | #define ARM_FUNCTION_PROFILER(STREAM, LABELNO) \ | |
125 | { \ | |
126 | fprintf (STREAM, "\tpush\t{lr}\n"); \ | |
127 | fprintf (STREAM, "\tbl\t__gnu_mcount_nc\n"); \ | |
128 | } | |
129 | ||
130 | #undef SUBTARGET_FRAME_POINTER_REQUIRED | |
131 | #define SUBTARGET_FRAME_POINTER_REQUIRED 0 | |
d53767cc AS |
132 | |
133 | /* __gnu_mcount_nc restores the original LR value before returning. Ensure | |
134 | that there is no unnecessary hook set up. */ | |
135 | #undef PROFILE_HOOK |