• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===--------------------- Unwind_AppleExtras.cpp -------------------------===//
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 
10 #include "config.h"
11 
12 
13 // static linker symbols to prevent wrong two level namespace for _Unwind symbols
14 #if defined(__arm__)
15    #define NOT_HERE_BEFORE_5_0(sym)     \
16        extern const char sym##_tmp30 __asm("$ld$hide$os3.0$_" #sym ); \
17        __attribute__((visibility("default"))) const char sym##_tmp30 = 0; \
18        extern const char sym##_tmp31 __asm("$ld$hide$os3.1$_" #sym ); \
19           __attribute__((visibility("default"))) const char sym##_tmp31 = 0; \
20        extern const char sym##_tmp32 __asm("$ld$hide$os3.2$_" #sym );\
21            __attribute__((visibility("default"))) const char sym##_tmp32 = 0; \
22        extern const char sym##_tmp40 __asm("$ld$hide$os4.0$_" #sym ); \
23           __attribute__((visibility("default"))) const char sym##_tmp40 = 0; \
24        extern const char sym##_tmp41 __asm("$ld$hide$os4.1$_" #sym ); \
25           __attribute__((visibility("default"))) const char sym##_tmp41 = 0; \
26        extern const char sym##_tmp42 __asm("$ld$hide$os4.2$_" #sym ); \
27           __attribute__((visibility("default"))) const char sym##_tmp42 = 0; \
28        extern const char sym##_tmp43 __asm("$ld$hide$os4.3$_" #sym ); \
29           __attribute__((visibility("default"))) const char sym##_tmp43 = 0;
30 #elif defined(__aarch64__)
31   #define NOT_HERE_BEFORE_10_6(sym)
32   #define NEVER_HERE(sym)
33 #else
34   #define NOT_HERE_BEFORE_10_6(sym) \
35     extern const char sym##_tmp4 __asm("$ld$hide$os10.4$_" #sym ); \
36           __attribute__((visibility("default"))) const char sym##_tmp4 = 0; \
37     extern const char sym##_tmp5 __asm("$ld$hide$os10.5$_" #sym ); \
38           __attribute__((visibility("default"))) const char sym##_tmp5 = 0;
39   #define NEVER_HERE(sym) \
40     extern const char sym##_tmp4 __asm("$ld$hide$os10.4$_" #sym ); \
41           __attribute__((visibility("default"))) const char sym##_tmp4 = 0; \
42     extern const char sym##_tmp5 __asm("$ld$hide$os10.5$_" #sym ); \
43           __attribute__((visibility("default"))) const char sym##_tmp5 = 0; \
44     extern const char sym##_tmp6 __asm("$ld$hide$os10.6$_" #sym ); \
45           __attribute__((visibility("default"))) const char sym##_tmp6 = 0;
46 #endif
47 
48 
49 #if defined(_LIBUNWIND_BUILD_ZERO_COST_APIS)
50 
51 //
52 // symbols in libSystem.dylib in 10.6 and later, but are in libgcc_s.dylib in
53 // earlier versions
54 //
55 NOT_HERE_BEFORE_10_6(_Unwind_DeleteException)
56 NOT_HERE_BEFORE_10_6(_Unwind_Find_FDE)
57 NOT_HERE_BEFORE_10_6(_Unwind_ForcedUnwind)
58 NOT_HERE_BEFORE_10_6(_Unwind_GetGR)
59 NOT_HERE_BEFORE_10_6(_Unwind_GetIP)
60 NOT_HERE_BEFORE_10_6(_Unwind_GetLanguageSpecificData)
61 NOT_HERE_BEFORE_10_6(_Unwind_GetRegionStart)
62 NOT_HERE_BEFORE_10_6(_Unwind_RaiseException)
63 NOT_HERE_BEFORE_10_6(_Unwind_Resume)
64 NOT_HERE_BEFORE_10_6(_Unwind_SetGR)
65 NOT_HERE_BEFORE_10_6(_Unwind_SetIP)
66 NOT_HERE_BEFORE_10_6(_Unwind_Backtrace)
67 NOT_HERE_BEFORE_10_6(_Unwind_FindEnclosingFunction)
68 NOT_HERE_BEFORE_10_6(_Unwind_GetCFA)
69 NOT_HERE_BEFORE_10_6(_Unwind_GetDataRelBase)
70 NOT_HERE_BEFORE_10_6(_Unwind_GetTextRelBase)
71 NOT_HERE_BEFORE_10_6(_Unwind_Resume_or_Rethrow)
72 NOT_HERE_BEFORE_10_6(_Unwind_GetIPInfo)
73 NOT_HERE_BEFORE_10_6(__register_frame)
74 NOT_HERE_BEFORE_10_6(__deregister_frame)
75 
76 //
77 // symbols in libSystem.dylib for compatibility, but we don't want any new code
78 // using them
79 //
80 NEVER_HERE(__register_frame_info_bases)
81 NEVER_HERE(__register_frame_info)
82 NEVER_HERE(__register_frame_info_table_bases)
83 NEVER_HERE(__register_frame_info_table)
84 NEVER_HERE(__register_frame_table)
85 NEVER_HERE(__deregister_frame_info)
86 NEVER_HERE(__deregister_frame_info_bases)
87 
88 #endif // defined(_LIBUNWIND_BUILD_ZERO_COST_APIS)
89 
90 
91 
92 
93 #if defined(_LIBUNWIND_BUILD_SJLJ_APIS)
94 //
95 // symbols in libSystem.dylib in iOS 5.0 and later, but are in libgcc_s.dylib in
96 // earlier versions
97 //
98 NOT_HERE_BEFORE_5_0(_Unwind_GetLanguageSpecificData)
99 NOT_HERE_BEFORE_5_0(_Unwind_GetRegionStart)
100 NOT_HERE_BEFORE_5_0(_Unwind_GetIP)
101 NOT_HERE_BEFORE_5_0(_Unwind_SetGR)
102 NOT_HERE_BEFORE_5_0(_Unwind_SetIP)
103 NOT_HERE_BEFORE_5_0(_Unwind_DeleteException)
104 NOT_HERE_BEFORE_5_0(_Unwind_SjLj_Register)
105 NOT_HERE_BEFORE_5_0(_Unwind_GetGR)
106 NOT_HERE_BEFORE_5_0(_Unwind_GetIPInfo)
107 NOT_HERE_BEFORE_5_0(_Unwind_GetCFA)
108 NOT_HERE_BEFORE_5_0(_Unwind_SjLj_Resume)
109 NOT_HERE_BEFORE_5_0(_Unwind_SjLj_RaiseException)
110 NOT_HERE_BEFORE_5_0(_Unwind_SjLj_Resume_or_Rethrow)
111 NOT_HERE_BEFORE_5_0(_Unwind_SjLj_Unregister)
112 
113 #endif // defined(_LIBUNWIND_BUILD_SJLJ_APIS)
114