@@ -125,15 +125,13 @@ void NORETURN CheckFailed(const char *file, int, const char *cond, u64, u64) {
125
125
} // namespace __sanitizer
126
126
#endif
127
127
128
- #define INTERFACE extern " C" __attribute__((visibility(" default" )))
129
-
130
128
#define HANDLER_RECOVER (name, kind ) \
131
- INTERFACE void __ubsan_handle_##name##_minimal( ) { \
129
+ SANITIZER_INTERFACE_WEAK_DEF ( void , __ubsan_handle_##name##_minimal) { \
132
130
__ubsan_report_error (kind, GET_CALLER_PC (), nullptr ); \
133
131
}
134
132
135
133
#define HANDLER_NORECOVER (name, kind ) \
136
- INTERFACE void __ubsan_handle_##name##_minimal_abort( ) { \
134
+ SANITIZER_INTERFACE_WEAK_DEF ( void , __ubsan_handle_##name##_minimal_abort) { \
137
135
uintptr_t caller = GET_CALLER_PC (); \
138
136
__ubsan_report_error_fatal (kind, caller, nullptr ); \
139
137
abort_with_message (kind, caller, nullptr ); \
@@ -144,13 +142,14 @@ void NORETURN CheckFailed(const char *file, int, const char *cond, u64, u64) {
144
142
HANDLER_NORECOVER(name, kind)
145
143
146
144
#define HANDLER_RECOVER_PTR (name, kind ) \
147
- INTERFACE void __ubsan_handle_##name##_minimal(const uintptr_t address) { \
145
+ SANITIZER_INTERFACE_WEAK_DEF (void , __ubsan_handle_##name##_minimal, \
146
+ const uintptr_t address) { \
148
147
__ubsan_report_error (kind, GET_CALLER_PC (), &address); \
149
148
}
150
149
151
150
#define HANDLER_NORECOVER_PTR (name, kind ) \
152
- INTERFACE void __ubsan_handle_##name##_minimal_abort( \
153
- const uintptr_t address) { \
151
+ SANITIZER_INTERFACE_WEAK_DEF ( void , __ubsan_handle_##name##_minimal_abort, \
152
+ const uintptr_t address) { \
154
153
uintptr_t caller = GET_CALLER_PC (); \
155
154
__ubsan_report_error_fatal (kind, caller, &address); \
156
155
abort_with_message (kind, caller, &address); \
0 commit comments