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