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 41 NOT_HERE_BEFORE_10_6(__absvdi2) 42 NOT_HERE_BEFORE_10_6(__absvsi2) 43 NOT_HERE_BEFORE_10_6(__absvti2) 44 NOT_HERE_BEFORE_10_6(__addvdi3) 45 NOT_HERE_BEFORE_10_6(__addvsi3) 46 NOT_HERE_BEFORE_10_6(__addvti3) 47 NOT_HERE_BEFORE_10_6(__ashldi3) 48 NOT_HERE_BEFORE_10_6(__ashlti3) 49 NOT_HERE_BEFORE_10_6(__ashrdi3) 50 NOT_HERE_BEFORE_10_6(__ashrti3) 51 NOT_HERE_BEFORE_10_6(__clear_cache) 52 NOT_HERE_BEFORE_10_6(__clzdi2) 53 NOT_HERE_BEFORE_10_6(__clzsi2) 54 NOT_HERE_BEFORE_10_6(__clzti2) 55 NOT_HERE_BEFORE_10_6(__cmpdi2) 56 NOT_HERE_BEFORE_10_6(__cmpti2) 57 NOT_HERE_BEFORE_10_6(__ctzdi2) 58 NOT_HERE_BEFORE_10_6(__ctzsi2) 59 NOT_HERE_BEFORE_10_6(__ctzti2) 60 NOT_HERE_BEFORE_10_6(__divdc3) 61 NOT_HERE_BEFORE_10_6(__divdi3) 62 NOT_HERE_BEFORE_10_6(__divsc3) 63 NOT_HERE_BEFORE_10_6(__divtc3) 64 NOT_HERE_BEFORE_10_6(__divti3) 65 NOT_HERE_BEFORE_10_6(__divxc3) 66 NOT_HERE_BEFORE_10_6(__enable_execute_stack) 67 NOT_HERE_BEFORE_10_6(__ffsdi2) 68 NOT_HERE_BEFORE_10_6(__ffsti2) 69 NOT_HERE_BEFORE_10_6(__fixdfdi) 70 NOT_HERE_BEFORE_10_6(__fixdfti) 71 NOT_HERE_BEFORE_10_6(__fixsfdi) 72 NOT_HERE_BEFORE_10_6(__fixsfti) 73 NOT_HERE_BEFORE_10_6(__fixtfdi) 74 NOT_HERE_BEFORE_10_6(__fixunsdfdi) 75 NOT_HERE_BEFORE_10_6(__fixunsdfsi) 76 NOT_HERE_BEFORE_10_6(__fixunsdfti) 77 NOT_HERE_BEFORE_10_6(__fixunssfdi) 78 NOT_HERE_BEFORE_10_6(__fixunssfsi) 79 NOT_HERE_BEFORE_10_6(__fixunssfti) 80 NOT_HERE_BEFORE_10_6(__fixunstfdi) 81 NOT_HERE_BEFORE_10_6(__fixunsxfdi) 82 NOT_HERE_BEFORE_10_6(__fixunsxfsi) 83 NOT_HERE_BEFORE_10_6(__fixunsxfti) 84 NOT_HERE_BEFORE_10_6(__fixxfdi) 85 NOT_HERE_BEFORE_10_6(__fixxfti) 86 NOT_HERE_BEFORE_10_6(__floatdidf) 87 NOT_HERE_BEFORE_10_6(__floatdisf) 88 NOT_HERE_BEFORE_10_6(__floatditf) 89 NOT_HERE_BEFORE_10_6(__floatdixf) 90 NOT_HERE_BEFORE_10_6(__floattidf) 91 NOT_HERE_BEFORE_10_6(__floattisf) 92 NOT_HERE_BEFORE_10_6(__floattixf) 93 NOT_HERE_BEFORE_10_6(__floatundidf) 94 NOT_HERE_BEFORE_10_6(__floatundisf) 95 NOT_HERE_BEFORE_10_6(__floatunditf) 96 NOT_HERE_BEFORE_10_6(__floatundixf) 97 NOT_HERE_BEFORE_10_6(__floatuntidf) 98 NOT_HERE_BEFORE_10_6(__floatuntisf) 99 NOT_HERE_BEFORE_10_6(__floatuntixf) 100 NOT_HERE_BEFORE_10_6(__gcc_personality_v0) 101 NOT_HERE_BEFORE_10_6(__lshrdi3) 102 NOT_HERE_BEFORE_10_6(__lshrti3) 103 NOT_HERE_BEFORE_10_6(__moddi3) 104 NOT_HERE_BEFORE_10_6(__modti3) 105 NOT_HERE_BEFORE_10_6(__muldc3) 106 NOT_HERE_BEFORE_10_6(__muldi3) 107 NOT_HERE_BEFORE_10_6(__mulsc3) 108 NOT_HERE_BEFORE_10_6(__multc3) 109 NOT_HERE_BEFORE_10_6(__multi3) 110 NOT_HERE_BEFORE_10_6(__mulvdi3) 111 NOT_HERE_BEFORE_10_6(__mulvsi3) 112 NOT_HERE_BEFORE_10_6(__mulvti3) 113 NOT_HERE_BEFORE_10_6(__mulxc3) 114 NOT_HERE_BEFORE_10_6(__negdi2) 115 NOT_HERE_BEFORE_10_6(__negti2) 116 NOT_HERE_BEFORE_10_6(__negvdi2) 117 NOT_HERE_BEFORE_10_6(__negvsi2) 118 NOT_HERE_BEFORE_10_6(__negvti2) 119 NOT_HERE_BEFORE_10_6(__paritydi2) 120 NOT_HERE_BEFORE_10_6(__paritysi2) 121 NOT_HERE_BEFORE_10_6(__parityti2) 122 NOT_HERE_BEFORE_10_6(__popcountdi2) 123 NOT_HERE_BEFORE_10_6(__popcountsi2) 124 NOT_HERE_BEFORE_10_6(__popcountti2) 125 NOT_HERE_BEFORE_10_6(__powidf2) 126 NOT_HERE_BEFORE_10_6(__powisf2) 127 NOT_HERE_BEFORE_10_6(__powitf2) 128 NOT_HERE_BEFORE_10_6(__powixf2) 129 NOT_HERE_BEFORE_10_6(__subvdi3) 130 NOT_HERE_BEFORE_10_6(__subvsi3) 131 NOT_HERE_BEFORE_10_6(__subvti3) 132 NOT_HERE_BEFORE_10_6(__ucmpdi2) 133 NOT_HERE_BEFORE_10_6(__ucmpti2) 134 NOT_HERE_BEFORE_10_6(__udivdi3) 135 NOT_HERE_BEFORE_10_6(__udivmoddi4) 136 NOT_HERE_BEFORE_10_6(__udivmodti4) 137 NOT_HERE_BEFORE_10_6(__udivti3) 138 NOT_HERE_BEFORE_10_6(__umoddi3) 139 NOT_HERE_BEFORE_10_6(__umodti3) 140 141 #if __ppc__ 142 NOT_HERE_BEFORE_10_6(__gcc_qadd) 143 NOT_HERE_BEFORE_10_6(__gcc_qdiv) 144 NOT_HERE_BEFORE_10_6(__gcc_qmul) 145 NOT_HERE_BEFORE_10_6(__gcc_qsub) 146 NOT_HERE_BEFORE_10_6(__trampoline_setup) 147 #endif // __ppc__ 148 149 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_compare_exchange) 150 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_compare_exchange_1) 151 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_compare_exchange_2) 152 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_compare_exchange_4) 153 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_compare_exchange_8) 154 155 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_exchange) 156 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_exchange_1) 157 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_exchange_2) 158 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_exchange_4) 159 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_exchange_8) 160 161 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_add_1) 162 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_add_2) 163 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_add_4) 164 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_add_8) 165 166 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_and_1) 167 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_and_2) 168 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_and_4) 169 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_and_8) 170 171 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_or_1) 172 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_or_2) 173 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_or_4) 174 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_or_8) 175 176 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_sub_1) 177 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_sub_2) 178 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_sub_4) 179 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_sub_8) 180 181 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_xor_1) 182 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_xor_2) 183 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_xor_4) 184 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_fetch_xor_8) 185 186 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_load) 187 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_load_1) 188 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_load_2) 189 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_load_4) 190 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_load_8) 191 192 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_store) 193 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_store_1) 194 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_store_2) 195 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_store_4) 196 NOT_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 215 NOT_HERE_UNTIL_AFTER_4_3(__absvdi2) 216 NOT_HERE_UNTIL_AFTER_4_3(__absvsi2) 217 NOT_HERE_UNTIL_AFTER_4_3(__adddf3) 218 NOT_HERE_UNTIL_AFTER_4_3(__adddf3vfp) 219 NOT_HERE_UNTIL_AFTER_4_3(__addsf3) 220 NOT_HERE_UNTIL_AFTER_4_3(__addsf3vfp) 221 NOT_HERE_UNTIL_AFTER_4_3(__addvdi3) 222 NOT_HERE_UNTIL_AFTER_4_3(__addvsi3) 223 NOT_HERE_UNTIL_AFTER_4_3(__ashldi3) 224 NOT_HERE_UNTIL_AFTER_4_3(__ashrdi3) 225 NOT_HERE_UNTIL_AFTER_4_3(__bswapdi2) 226 NOT_HERE_UNTIL_AFTER_4_3(__bswapsi2) 227 NOT_HERE_UNTIL_AFTER_4_3(__clzdi2) 228 NOT_HERE_UNTIL_AFTER_4_3(__clzsi2) 229 NOT_HERE_UNTIL_AFTER_4_3(__cmpdi2) 230 NOT_HERE_UNTIL_AFTER_4_3(__ctzdi2) 231 NOT_HERE_UNTIL_AFTER_4_3(__ctzsi2) 232 NOT_HERE_UNTIL_AFTER_4_3(__divdc3) 233 NOT_HERE_UNTIL_AFTER_4_3(__divdf3) 234 NOT_HERE_UNTIL_AFTER_4_3(__divdf3vfp) 235 NOT_HERE_UNTIL_AFTER_4_3(__divdi3) 236 NOT_HERE_UNTIL_AFTER_4_3(__divsc3) 237 NOT_HERE_UNTIL_AFTER_4_3(__divsf3) 238 NOT_HERE_UNTIL_AFTER_4_3(__divsf3vfp) 239 NOT_HERE_UNTIL_AFTER_4_3(__divsi3) 240 NOT_HERE_UNTIL_AFTER_4_3(__eqdf2) 241 NOT_HERE_UNTIL_AFTER_4_3(__eqdf2vfp) 242 NOT_HERE_UNTIL_AFTER_4_3(__eqsf2) 243 NOT_HERE_UNTIL_AFTER_4_3(__eqsf2vfp) 244 NOT_HERE_UNTIL_AFTER_4_3(__extendsfdf2) 245 NOT_HERE_UNTIL_AFTER_4_3(__extendsfdf2vfp) 246 NOT_HERE_UNTIL_AFTER_4_3(__ffsdi2) 247 NOT_HERE_UNTIL_AFTER_4_3(__fixdfdi) 248 NOT_HERE_UNTIL_AFTER_4_3(__fixdfsi) 249 NOT_HERE_UNTIL_AFTER_4_3(__fixdfsivfp) 250 NOT_HERE_UNTIL_AFTER_4_3(__fixsfdi) 251 NOT_HERE_UNTIL_AFTER_4_3(__fixsfsi) 252 NOT_HERE_UNTIL_AFTER_4_3(__fixsfsivfp) 253 NOT_HERE_UNTIL_AFTER_4_3(__fixunsdfdi) 254 NOT_HERE_UNTIL_AFTER_4_3(__fixunsdfsi) 255 NOT_HERE_UNTIL_AFTER_4_3(__fixunsdfsivfp) 256 NOT_HERE_UNTIL_AFTER_4_3(__fixunssfdi) 257 NOT_HERE_UNTIL_AFTER_4_3(__fixunssfsi) 258 NOT_HERE_UNTIL_AFTER_4_3(__fixunssfsivfp) 259 NOT_HERE_UNTIL_AFTER_4_3(__floatdidf) 260 NOT_HERE_UNTIL_AFTER_4_3(__floatdisf) 261 NOT_HERE_UNTIL_AFTER_4_3(__floatsidf) 262 NOT_HERE_UNTIL_AFTER_4_3(__floatsidfvfp) 263 NOT_HERE_UNTIL_AFTER_4_3(__floatsisf) 264 NOT_HERE_UNTIL_AFTER_4_3(__floatsisfvfp) 265 NOT_HERE_UNTIL_AFTER_4_3(__floatundidf) 266 NOT_HERE_UNTIL_AFTER_4_3(__floatundisf) 267 NOT_HERE_UNTIL_AFTER_4_3(__floatunsidf) 268 NOT_HERE_UNTIL_AFTER_4_3(__floatunsisf) 269 NOT_HERE_UNTIL_AFTER_4_3(__floatunssidfvfp) 270 NOT_HERE_UNTIL_AFTER_4_3(__floatunssisfvfp) 271 NOT_HERE_UNTIL_AFTER_4_3(__gedf2) 272 NOT_HERE_UNTIL_AFTER_4_3(__gedf2vfp) 273 NOT_HERE_UNTIL_AFTER_4_3(__gesf2) 274 NOT_HERE_UNTIL_AFTER_4_3(__gesf2vfp) 275 NOT_HERE_UNTIL_AFTER_4_3(__gtdf2) 276 NOT_HERE_UNTIL_AFTER_4_3(__gtdf2vfp) 277 NOT_HERE_UNTIL_AFTER_4_3(__gtsf2) 278 NOT_HERE_UNTIL_AFTER_4_3(__gtsf2vfp) 279 NOT_HERE_UNTIL_AFTER_4_3(__ledf2) 280 NOT_HERE_UNTIL_AFTER_4_3(__ledf2vfp) 281 NOT_HERE_UNTIL_AFTER_4_3(__lesf2) 282 NOT_HERE_UNTIL_AFTER_4_3(__lesf2vfp) 283 NOT_HERE_UNTIL_AFTER_4_3(__lshrdi3) 284 NOT_HERE_UNTIL_AFTER_4_3(__ltdf2) 285 NOT_HERE_UNTIL_AFTER_4_3(__ltdf2vfp) 286 NOT_HERE_UNTIL_AFTER_4_3(__ltsf2) 287 NOT_HERE_UNTIL_AFTER_4_3(__ltsf2vfp) 288 NOT_HERE_UNTIL_AFTER_4_3(__moddi3) 289 NOT_HERE_UNTIL_AFTER_4_3(__modsi3) 290 NOT_HERE_UNTIL_AFTER_4_3(__muldc3) 291 NOT_HERE_UNTIL_AFTER_4_3(__muldf3) 292 NOT_HERE_UNTIL_AFTER_4_3(__muldf3vfp) 293 NOT_HERE_UNTIL_AFTER_4_3(__muldi3) 294 NOT_HERE_UNTIL_AFTER_4_3(__mulsc3) 295 NOT_HERE_UNTIL_AFTER_4_3(__mulsf3) 296 NOT_HERE_UNTIL_AFTER_4_3(__mulsf3vfp) 297 NOT_HERE_UNTIL_AFTER_4_3(__mulvdi3) 298 NOT_HERE_UNTIL_AFTER_4_3(__mulvsi3) 299 NOT_HERE_UNTIL_AFTER_4_3(__nedf2) 300 NOT_HERE_UNTIL_AFTER_4_3(__nedf2vfp) 301 NOT_HERE_UNTIL_AFTER_4_3(__negdi2) 302 NOT_HERE_UNTIL_AFTER_4_3(__negvdi2) 303 NOT_HERE_UNTIL_AFTER_4_3(__negvsi2) 304 NOT_HERE_UNTIL_AFTER_4_3(__nesf2) 305 NOT_HERE_UNTIL_AFTER_4_3(__nesf2vfp) 306 NOT_HERE_UNTIL_AFTER_4_3(__paritydi2) 307 NOT_HERE_UNTIL_AFTER_4_3(__paritysi2) 308 NOT_HERE_UNTIL_AFTER_4_3(__popcountdi2) 309 NOT_HERE_UNTIL_AFTER_4_3(__popcountsi2) 310 NOT_HERE_UNTIL_AFTER_4_3(__powidf2) 311 NOT_HERE_UNTIL_AFTER_4_3(__powisf2) 312 NOT_HERE_UNTIL_AFTER_4_3(__subdf3) 313 NOT_HERE_UNTIL_AFTER_4_3(__subdf3vfp) 314 NOT_HERE_UNTIL_AFTER_4_3(__subsf3) 315 NOT_HERE_UNTIL_AFTER_4_3(__subsf3vfp) 316 NOT_HERE_UNTIL_AFTER_4_3(__subvdi3) 317 NOT_HERE_UNTIL_AFTER_4_3(__subvsi3) 318 NOT_HERE_UNTIL_AFTER_4_3(__truncdfsf2) 319 NOT_HERE_UNTIL_AFTER_4_3(__truncdfsf2vfp) 320 NOT_HERE_UNTIL_AFTER_4_3(__ucmpdi2) 321 NOT_HERE_UNTIL_AFTER_4_3(__udivdi3) 322 NOT_HERE_UNTIL_AFTER_4_3(__udivmoddi4) 323 NOT_HERE_UNTIL_AFTER_4_3(__udivsi3) 324 NOT_HERE_UNTIL_AFTER_4_3(__umoddi3) 325 NOT_HERE_UNTIL_AFTER_4_3(__umodsi3) 326 NOT_HERE_UNTIL_AFTER_4_3(__unorddf2) 327 NOT_HERE_UNTIL_AFTER_4_3(__unorddf2vfp) 328 NOT_HERE_UNTIL_AFTER_4_3(__unordsf2) 329 NOT_HERE_UNTIL_AFTER_4_3(__unordsf2vfp) 330 331 NOT_HERE_UNTIL_AFTER_4_3(__divmodsi4) 332 NOT_HERE_UNTIL_AFTER_4_3(__udivmodsi4) 333 #endif // __arm__ && __DYNAMIC__ 334 335 #else // !__APPLE__ 336 337 extern int avoid_empty_file; 338 339 #endif // !__APPLE__ 340