1//===-- apple_versioning.c - Adds versioning symbols for ld ---------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#if __APPLE__
10#include <Availability.h>
11
12#if __IPHONE_OS_VERSION_MIN_REQUIRED
13#define NOT_HERE_BEFORE_10_6(sym)
14#define NOT_HERE_IN_10_8_AND_EARLIER(sym) \
15 extern const char sym##_tmp61 __asm("$ld$hide$os6.1$_" #sym); \
16 __attribute__((visibility("default"))) const char sym##_tmp61 = 0; \
17 extern const char sym##_tmp60 __asm("$ld$hide$os6.0$_" #sym); \
18 __attribute__((visibility("default"))) const char sym##_tmp60 = 0; \
19 extern const char sym##_tmp51 __asm("$ld$hide$os5.1$_" #sym); \
20 __attribute__((visibility("default"))) const char sym##_tmp51 = 0; \
21 extern const char sym##_tmp50 __asm("$ld$hide$os5.0$_" #sym); \
22 __attribute__((visibility("default"))) const char sym##_tmp50 = 0;
23#else
24#define NOT_HERE_BEFORE_10_6(sym) \
25 extern const char sym##_tmp4 __asm("$ld$hide$os10.4$_" #sym); \
26 __attribute__((visibility("default"))) const char sym##_tmp4 = 0; \
27 extern const char sym##_tmp5 __asm("$ld$hide$os10.5$_" #sym); \
28 __attribute__((visibility("default"))) const char sym##_tmp5 = 0;
29#define NOT_HERE_IN_10_8_AND_EARLIER(sym) \
30 extern const char sym##_tmp8 __asm("$ld$hide$os10.8$_" #sym); \
31 __attribute__((visibility("default"))) const char sym##_tmp8 = 0; \
32 extern const char sym##_tmp7 __asm("$ld$hide$os10.7$_" #sym); \
33 __attribute__((visibility("default"))) const char sym##_tmp7 = 0; \
34 extern const char sym##_tmp6 __asm("$ld$hide$os10.6$_" #sym); \
35 __attribute__((visibility("default"))) const char sym##_tmp6 = 0;
36#endif
37
38// Symbols in libSystem.dylib in 10.6 and later,
39// but are in libgcc_s.dylib in earlier versions
40
41NOT_HERE_BEFORE_10_6(__absvdi2)
42NOT_HERE_BEFORE_10_6(__absvsi2)
43NOT_HERE_BEFORE_10_6(__absvti2)
44NOT_HERE_BEFORE_10_6(__addvdi3)
45NOT_HERE_BEFORE_10_6(__addvsi3)
46NOT_HERE_BEFORE_10_6(__addvti3)
47NOT_HERE_BEFORE_10_6(__ashldi3)
48NOT_HERE_BEFORE_10_6(__ashlti3)
49NOT_HERE_BEFORE_10_6(__ashrdi3)
50NOT_HERE_BEFORE_10_6(__ashrti3)
51NOT_HERE_BEFORE_10_6(__clear_cache)
52NOT_HERE_BEFORE_10_6(__clzdi2)
53NOT_HERE_BEFORE_10_6(__clzsi2)
54NOT_HERE_BEFORE_10_6(__clzti2)
55NOT_HERE_BEFORE_10_6(__cmpdi2)
56NOT_HERE_BEFORE_10_6(__cmpti2)
57NOT_HERE_BEFORE_10_6(__ctzdi2)
58NOT_HERE_BEFORE_10_6(__ctzsi2)
59NOT_HERE_BEFORE_10_6(__ctzti2)
60NOT_HERE_BEFORE_10_6(__divdc3)
61NOT_HERE_BEFORE_10_6(__divdi3)
62NOT_HERE_BEFORE_10_6(__divsc3)
63NOT_HERE_BEFORE_10_6(__divtc3)
64NOT_HERE_BEFORE_10_6(__divti3)
65NOT_HERE_BEFORE_10_6(__divxc3)
66NOT_HERE_BEFORE_10_6(__enable_execute_stack)
67NOT_HERE_BEFORE_10_6(__ffsdi2)
68NOT_HERE_BEFORE_10_6(__ffsti2)
69NOT_HERE_BEFORE_10_6(__fixdfdi)
70NOT_HERE_BEFORE_10_6(__fixdfti)
71NOT_HERE_BEFORE_10_6(__fixsfdi)
72NOT_HERE_BEFORE_10_6(__fixsfti)
73NOT_HERE_BEFORE_10_6(__fixtfdi)
74NOT_HERE_BEFORE_10_6(__fixunsdfdi)
75NOT_HERE_BEFORE_10_6(__fixunsdfsi)
76NOT_HERE_BEFORE_10_6(__fixunsdfti)
77NOT_HERE_BEFORE_10_6(__fixunssfdi)
78NOT_HERE_BEFORE_10_6(__fixunssfsi)
79NOT_HERE_BEFORE_10_6(__fixunssfti)
80NOT_HERE_BEFORE_10_6(__fixunstfdi)
81NOT_HERE_BEFORE_10_6(__fixunsxfdi)
82NOT_HERE_BEFORE_10_6(__fixunsxfsi)
83NOT_HERE_BEFORE_10_6(__fixunsxfti)
84NOT_HERE_BEFORE_10_6(__fixxfdi)
85NOT_HERE_BEFORE_10_6(__fixxfti)
86NOT_HERE_BEFORE_10_6(__floatdidf)
87NOT_HERE_BEFORE_10_6(__floatdisf)
88NOT_HERE_BEFORE_10_6(__floatditf)
89NOT_HERE_BEFORE_10_6(__floatdixf)
90NOT_HERE_BEFORE_10_6(__floattidf)
91NOT_HERE_BEFORE_10_6(__floattisf)
92NOT_HERE_BEFORE_10_6(__floattixf)
93NOT_HERE_BEFORE_10_6(__floatundidf)
94NOT_HERE_BEFORE_10_6(__floatundisf)
95NOT_HERE_BEFORE_10_6(__floatunditf)
96NOT_HERE_BEFORE_10_6(__floatundixf)
97NOT_HERE_BEFORE_10_6(__floatuntidf)
98NOT_HERE_BEFORE_10_6(__floatuntisf)
99NOT_HERE_BEFORE_10_6(__floatuntixf)
100NOT_HERE_BEFORE_10_6(__gcc_personality_v0)
101NOT_HERE_BEFORE_10_6(__lshrdi3)
102NOT_HERE_BEFORE_10_6(__lshrti3)
103NOT_HERE_BEFORE_10_6(__moddi3)
104NOT_HERE_BEFORE_10_6(__modti3)
105NOT_HERE_BEFORE_10_6(__muldc3)
106NOT_HERE_BEFORE_10_6(__muldi3)
107NOT_HERE_BEFORE_10_6(__mulsc3)
108NOT_HERE_BEFORE_10_6(__multc3)
109NOT_HERE_BEFORE_10_6(__multi3)
110NOT_HERE_BEFORE_10_6(__mulvdi3)
111NOT_HERE_BEFORE_10_6(__mulvsi3)
112NOT_HERE_BEFORE_10_6(__mulvti3)
113NOT_HERE_BEFORE_10_6(__mulxc3)
114NOT_HERE_BEFORE_10_6(__negdi2)
115NOT_HERE_BEFORE_10_6(__negti2)
116NOT_HERE_BEFORE_10_6(__negvdi2)
117NOT_HERE_BEFORE_10_6(__negvsi2)
118NOT_HERE_BEFORE_10_6(__negvti2)
119NOT_HERE_BEFORE_10_6(__paritydi2)
120NOT_HERE_BEFORE_10_6(__paritysi2)
121NOT_HERE_BEFORE_10_6(__parityti2)
122NOT_HERE_BEFORE_10_6(__popcountdi2)
123NOT_HERE_BEFORE_10_6(__popcountsi2)
124NOT_HERE_BEFORE_10_6(__popcountti2)
125NOT_HERE_BEFORE_10_6(__powidf2)
126NOT_HERE_BEFORE_10_6(__powisf2)
127NOT_HERE_BEFORE_10_6(__powitf2)
128NOT_HERE_BEFORE_10_6(__powixf2)
129NOT_HERE_BEFORE_10_6(__subvdi3)
130NOT_HERE_BEFORE_10_6(__subvsi3)
131NOT_HERE_BEFORE_10_6(__subvti3)
132NOT_HERE_BEFORE_10_6(__ucmpdi2)
133NOT_HERE_BEFORE_10_6(__ucmpti2)
134NOT_HERE_BEFORE_10_6(__udivdi3)
135NOT_HERE_BEFORE_10_6(__udivmoddi4)
136NOT_HERE_BEFORE_10_6(__udivmodti4)
137NOT_HERE_BEFORE_10_6(__udivti3)
138NOT_HERE_BEFORE_10_6(__umoddi3)
139NOT_HERE_BEFORE_10_6(__umodti3)
140
141#if __powerpc__
142NOT_HERE_BEFORE_10_6(__gcc_qadd)
143NOT_HERE_BEFORE_10_6(__gcc_qdiv)
144NOT_HERE_BEFORE_10_6(__gcc_qmul)
145NOT_HERE_BEFORE_10_6(__gcc_qsub)
146NOT_HERE_BEFORE_10_6(__trampoline_setup)
147#endif // __powerpc__
148
149NOT_HERE_IN_10_8_AND_EARLIER(__atomic_compare_exchange)
150NOT_HERE_IN_10_8_AND_EARLIER(__atomic_compare_exchange_1)
151NOT_HERE_IN_10_8_AND_EARLIER(__atomic_compare_exchange_2)
152NOT_HERE_IN_10_8_AND_EARLIER(__atomic_compare_exchange_4)
153NOT_HERE_IN_10_8_AND_EARLIER(__atomic_compare_exchange_8)
154
155NOT_HERE_IN_10_8_AND_EARLIER(__atomic_exchange)
156NOT_HERE_IN_10_8_AND_EARLIER(__atomic_exchange_1)
157NOT_HERE_IN_10_8_AND_EARLIER(__atomic_exchange_2)
158NOT_HERE_IN_10_8_AND_EARLIER(__atomic_exchange_4)
159NOT_HERE_IN_10_8_AND_EARLIER(__atomic_exchange_8)
160
161NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_add_1)
162NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_add_2)
163NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_add_4)
164NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_add_8)
165
166NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_and_1)
167NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_and_2)
168NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_and_4)
169NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_and_8)
170
171NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_or_1)
172NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_or_2)
173NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_or_4)
174NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_or_8)
175
176NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_sub_1)
177NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_sub_2)
178NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_sub_4)
179NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_sub_8)
180
181NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_xor_1)
182NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_xor_2)
183NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_xor_4)
184NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_xor_8)
185
186NOT_HERE_IN_10_8_AND_EARLIER(__atomic_load)
187NOT_HERE_IN_10_8_AND_EARLIER(__atomic_load_1)
188NOT_HERE_IN_10_8_AND_EARLIER(__atomic_load_2)
189NOT_HERE_IN_10_8_AND_EARLIER(__atomic_load_4)
190NOT_HERE_IN_10_8_AND_EARLIER(__atomic_load_8)
191
192NOT_HERE_IN_10_8_AND_EARLIER(__atomic_store)
193NOT_HERE_IN_10_8_AND_EARLIER(__atomic_store_1)
194NOT_HERE_IN_10_8_AND_EARLIER(__atomic_store_2)
195NOT_HERE_IN_10_8_AND_EARLIER(__atomic_store_4)
196NOT_HERE_IN_10_8_AND_EARLIER(__atomic_store_8)
197
198#if __arm__ && __DYNAMIC__
199#define NOT_HERE_UNTIL_AFTER_4_3(sym) \
200 extern const char sym##_tmp1 __asm("$ld$hide$os3.0$_" #sym); \
201 __attribute__((visibility("default"))) const char sym##_tmp1 = 0; \
202 extern const char sym##_tmp2 __asm("$ld$hide$os3.1$_" #sym); \
203 __attribute__((visibility("default"))) const char sym##_tmp2 = 0; \
204 extern const char sym##_tmp3 __asm("$ld$hide$os3.2$_" #sym); \
205 __attribute__((visibility("default"))) const char sym##_tmp3 = 0; \
206 extern const char sym##_tmp4 __asm("$ld$hide$os4.0$_" #sym); \
207 __attribute__((visibility("default"))) const char sym##_tmp4 = 0; \
208 extern const char sym##_tmp5 __asm("$ld$hide$os4.1$_" #sym); \
209 __attribute__((visibility("default"))) const char sym##_tmp5 = 0; \
210 extern const char sym##_tmp6 __asm("$ld$hide$os4.2$_" #sym); \
211 __attribute__((visibility("default"))) const char sym##_tmp6 = 0; \
212 extern const char sym##_tmp7 __asm("$ld$hide$os4.3$_" #sym); \
213 __attribute__((visibility("default"))) const char sym##_tmp7 = 0;
214
215NOT_HERE_UNTIL_AFTER_4_3(__absvdi2)
216NOT_HERE_UNTIL_AFTER_4_3(__absvsi2)
217NOT_HERE_UNTIL_AFTER_4_3(__adddf3)
218NOT_HERE_UNTIL_AFTER_4_3(__adddf3vfp)
219NOT_HERE_UNTIL_AFTER_4_3(__addsf3)
220NOT_HERE_UNTIL_AFTER_4_3(__addsf3vfp)
221NOT_HERE_UNTIL_AFTER_4_3(__addvdi3)
222NOT_HERE_UNTIL_AFTER_4_3(__addvsi3)
223NOT_HERE_UNTIL_AFTER_4_3(__ashldi3)
224NOT_HERE_UNTIL_AFTER_4_3(__ashrdi3)
225NOT_HERE_UNTIL_AFTER_4_3(__bswapdi2)
226NOT_HERE_UNTIL_AFTER_4_3(__bswapsi2)
227NOT_HERE_UNTIL_AFTER_4_3(__clzdi2)
228NOT_HERE_UNTIL_AFTER_4_3(__clzsi2)
229NOT_HERE_UNTIL_AFTER_4_3(__cmpdi2)
230NOT_HERE_UNTIL_AFTER_4_3(__ctzdi2)
231NOT_HERE_UNTIL_AFTER_4_3(__ctzsi2)
232NOT_HERE_UNTIL_AFTER_4_3(__divdc3)
233NOT_HERE_UNTIL_AFTER_4_3(__divdf3)
234NOT_HERE_UNTIL_AFTER_4_3(__divdf3vfp)
235NOT_HERE_UNTIL_AFTER_4_3(__divdi3)
236NOT_HERE_UNTIL_AFTER_4_3(__divsc3)
237NOT_HERE_UNTIL_AFTER_4_3(__divsf3)
238NOT_HERE_UNTIL_AFTER_4_3(__divsf3vfp)
239NOT_HERE_UNTIL_AFTER_4_3(__divsi3)
240NOT_HERE_UNTIL_AFTER_4_3(__eqdf2)
241NOT_HERE_UNTIL_AFTER_4_3(__eqdf2vfp)
242NOT_HERE_UNTIL_AFTER_4_3(__eqsf2)
243NOT_HERE_UNTIL_AFTER_4_3(__eqsf2vfp)
244NOT_HERE_UNTIL_AFTER_4_3(__extendsfdf2)
245NOT_HERE_UNTIL_AFTER_4_3(__extendsfdf2vfp)
246NOT_HERE_UNTIL_AFTER_4_3(__ffsdi2)
247NOT_HERE_UNTIL_AFTER_4_3(__fixdfdi)
248NOT_HERE_UNTIL_AFTER_4_3(__fixdfsi)
249NOT_HERE_UNTIL_AFTER_4_3(__fixdfsivfp)
250NOT_HERE_UNTIL_AFTER_4_3(__fixsfdi)
251NOT_HERE_UNTIL_AFTER_4_3(__fixsfsi)
252NOT_HERE_UNTIL_AFTER_4_3(__fixsfsivfp)
253NOT_HERE_UNTIL_AFTER_4_3(__fixunsdfdi)
254NOT_HERE_UNTIL_AFTER_4_3(__fixunsdfsi)
255NOT_HERE_UNTIL_AFTER_4_3(__fixunsdfsivfp)
256NOT_HERE_UNTIL_AFTER_4_3(__fixunssfdi)
257NOT_HERE_UNTIL_AFTER_4_3(__fixunssfsi)
258NOT_HERE_UNTIL_AFTER_4_3(__fixunssfsivfp)
259NOT_HERE_UNTIL_AFTER_4_3(__floatdidf)
260NOT_HERE_UNTIL_AFTER_4_3(__floatdisf)
261NOT_HERE_UNTIL_AFTER_4_3(__floatsidf)
262NOT_HERE_UNTIL_AFTER_4_3(__floatsidfvfp)
263NOT_HERE_UNTIL_AFTER_4_3(__floatsisf)
264NOT_HERE_UNTIL_AFTER_4_3(__floatsisfvfp)
265NOT_HERE_UNTIL_AFTER_4_3(__floatundidf)
266NOT_HERE_UNTIL_AFTER_4_3(__floatundisf)
267NOT_HERE_UNTIL_AFTER_4_3(__floatunsidf)
268NOT_HERE_UNTIL_AFTER_4_3(__floatunsisf)
269NOT_HERE_UNTIL_AFTER_4_3(__floatunssidfvfp)
270NOT_HERE_UNTIL_AFTER_4_3(__floatunssisfvfp)
271NOT_HERE_UNTIL_AFTER_4_3(__gedf2)
272NOT_HERE_UNTIL_AFTER_4_3(__gedf2vfp)
273NOT_HERE_UNTIL_AFTER_4_3(__gesf2)
274NOT_HERE_UNTIL_AFTER_4_3(__gesf2vfp)
275NOT_HERE_UNTIL_AFTER_4_3(__gtdf2)
276NOT_HERE_UNTIL_AFTER_4_3(__gtdf2vfp)
277NOT_HERE_UNTIL_AFTER_4_3(__gtsf2)
278NOT_HERE_UNTIL_AFTER_4_3(__gtsf2vfp)
279NOT_HERE_UNTIL_AFTER_4_3(__ledf2)
280NOT_HERE_UNTIL_AFTER_4_3(__ledf2vfp)
281NOT_HERE_UNTIL_AFTER_4_3(__lesf2)
282NOT_HERE_UNTIL_AFTER_4_3(__lesf2vfp)
283NOT_HERE_UNTIL_AFTER_4_3(__lshrdi3)
284NOT_HERE_UNTIL_AFTER_4_3(__ltdf2)
285NOT_HERE_UNTIL_AFTER_4_3(__ltdf2vfp)
286NOT_HERE_UNTIL_AFTER_4_3(__ltsf2)
287NOT_HERE_UNTIL_AFTER_4_3(__ltsf2vfp)
288NOT_HERE_UNTIL_AFTER_4_3(__moddi3)
289NOT_HERE_UNTIL_AFTER_4_3(__modsi3)
290NOT_HERE_UNTIL_AFTER_4_3(__muldc3)
291NOT_HERE_UNTIL_AFTER_4_3(__muldf3)
292NOT_HERE_UNTIL_AFTER_4_3(__muldf3vfp)
293NOT_HERE_UNTIL_AFTER_4_3(__muldi3)
294NOT_HERE_UNTIL_AFTER_4_3(__mulsc3)
295NOT_HERE_UNTIL_AFTER_4_3(__mulsf3)
296NOT_HERE_UNTIL_AFTER_4_3(__mulsf3vfp)
297NOT_HERE_UNTIL_AFTER_4_3(__mulvdi3)
298NOT_HERE_UNTIL_AFTER_4_3(__mulvsi3)
299NOT_HERE_UNTIL_AFTER_4_3(__nedf2)
300NOT_HERE_UNTIL_AFTER_4_3(__nedf2vfp)
301NOT_HERE_UNTIL_AFTER_4_3(__negdi2)
302NOT_HERE_UNTIL_AFTER_4_3(__negvdi2)
303NOT_HERE_UNTIL_AFTER_4_3(__negvsi2)
304NOT_HERE_UNTIL_AFTER_4_3(__nesf2)
305NOT_HERE_UNTIL_AFTER_4_3(__nesf2vfp)
306NOT_HERE_UNTIL_AFTER_4_3(__paritydi2)
307NOT_HERE_UNTIL_AFTER_4_3(__paritysi2)
308NOT_HERE_UNTIL_AFTER_4_3(__popcountdi2)
309NOT_HERE_UNTIL_AFTER_4_3(__popcountsi2)
310NOT_HERE_UNTIL_AFTER_4_3(__powidf2)
311NOT_HERE_UNTIL_AFTER_4_3(__powisf2)
312NOT_HERE_UNTIL_AFTER_4_3(__subdf3)
313NOT_HERE_UNTIL_AFTER_4_3(__subdf3vfp)
314NOT_HERE_UNTIL_AFTER_4_3(__subsf3)
315NOT_HERE_UNTIL_AFTER_4_3(__subsf3vfp)
316NOT_HERE_UNTIL_AFTER_4_3(__subvdi3)
317NOT_HERE_UNTIL_AFTER_4_3(__subvsi3)
318NOT_HERE_UNTIL_AFTER_4_3(__truncdfsf2)
319NOT_HERE_UNTIL_AFTER_4_3(__truncdfsf2vfp)
320NOT_HERE_UNTIL_AFTER_4_3(__ucmpdi2)
321NOT_HERE_UNTIL_AFTER_4_3(__udivdi3)
322NOT_HERE_UNTIL_AFTER_4_3(__udivmoddi4)
323NOT_HERE_UNTIL_AFTER_4_3(__udivsi3)
324NOT_HERE_UNTIL_AFTER_4_3(__umoddi3)
325NOT_HERE_UNTIL_AFTER_4_3(__umodsi3)
326NOT_HERE_UNTIL_AFTER_4_3(__unorddf2)
327NOT_HERE_UNTIL_AFTER_4_3(__unorddf2vfp)
328NOT_HERE_UNTIL_AFTER_4_3(__unordsf2)
329NOT_HERE_UNTIL_AFTER_4_3(__unordsf2vfp)
330
331NOT_HERE_UNTIL_AFTER_4_3(__divmodsi4)
332NOT_HERE_UNTIL_AFTER_4_3(__udivmodsi4)
333#endif // __arm__ && __DYNAMIC__
334
335#else // !__APPLE__
336
337extern int avoid_empty_file;
338
339#endif // !__APPLE__
340

source code of compiler-rt/lib/builtins/apple_versioning.c