|
19 | 19 |
|
20 | 20 | #if !SANITIZER_LINUX && !SANITIZER_FREEBSD && !SANITIZER_APPLE && \ |
21 | 21 | !SANITIZER_NETBSD && !SANITIZER_WINDOWS && !SANITIZER_FUCHSIA && \ |
22 | | - !SANITIZER_SOLARIS && !SANITIZER_HAIKU |
| 22 | + !SANITIZER_SOLARIS && !SANITIZER_HAIKU && !SANITIZER_AIX |
23 | 23 | # error "Interception doesn't work on this operating system." |
24 | 24 | #endif |
25 | 25 |
|
@@ -168,6 +168,16 @@ const interpose_substitution substitution_##func_name[] \ |
168 | 168 | extern "C" ret_type func(__VA_ARGS__); |
169 | 169 | # define DECLARE_WRAPPER_WINAPI(ret_type, func, ...) \ |
170 | 170 | extern "C" __declspec(dllimport) ret_type __stdcall func(__VA_ARGS__); |
| 171 | +#elif SANITIZER_AIX |
| 172 | +# define WRAP(x) __interceptor_##x |
| 173 | +# define TRAMPOLINE(x) WRAP(x) |
| 174 | +// # define WRAPPER_NAME(x) "__interceptor_" #x |
| 175 | +# define INTERCEPTOR_ATTRIBUTE __attribute__((visibility("default"))) |
| 176 | +// AIX's linker will not select the weak symbol, so don't use weak for the |
| 177 | +// interceptors. |
| 178 | +# define DECLARE_WRAPPER(ret_type, func, ...) \ |
| 179 | + extern "C" ret_type func(__VA_ARGS__) \ |
| 180 | + __attribute__((alias("__interceptor_" #func), visibility("default"))); |
171 | 181 | #elif !SANITIZER_FUCHSIA // LINUX, FREEBSD, NETBSD, SOLARIS |
172 | 182 | # define INTERCEPTOR_ATTRIBUTE __attribute__((visibility("default"))) |
173 | 183 | # if ASM_INTERCEPTOR_TRAMPOLINE_SUPPORT |
@@ -367,12 +377,17 @@ inline void DoesNotSupportStaticLinking() {} |
367 | 377 |
|
368 | 378 | #define INCLUDED_FROM_INTERCEPTION_LIB |
369 | 379 |
|
370 | | -#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD || \ |
| 380 | +#if SANITIZER_AIX |
| 381 | +# include "interception_aix.h" |
| 382 | +# define INTERCEPT_FUNCTION(func) INTERCEPT_FUNCTION_AIX(func) |
| 383 | +# define INTERCEPT_FUNCTION_VER(func, symver) INTERCEPT_FUNCTION_AIX(func) |
| 384 | + |
| 385 | +#elif SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD || \ |
371 | 386 | SANITIZER_SOLARIS || SANITIZER_HAIKU |
372 | 387 |
|
373 | | -# include "interception_linux.h" |
374 | | -# define INTERCEPT_FUNCTION(func) INTERCEPT_FUNCTION_LINUX_OR_FREEBSD(func) |
375 | | -# define INTERCEPT_FUNCTION_VER(func, symver) \ |
| 388 | +# include "interception_linux.h" |
| 389 | +# define INTERCEPT_FUNCTION(func) INTERCEPT_FUNCTION_LINUX_OR_FREEBSD(func) |
| 390 | +# define INTERCEPT_FUNCTION_VER(func, symver) \ |
376 | 391 | INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) |
377 | 392 | #elif SANITIZER_APPLE |
378 | 393 | # include "interception_mac.h" |
|
0 commit comments