mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-04-01 12:43:47 +00:00
"Reland "[hwasan] Provide aliases for c allocation functions for Fuchsia"
This reverts commit 7b6c0ce9c6c1e2cc3076e787e0e8d9a43bc2bfcc. See if this works on the android builder this time by keeping the original WRAP declaration.
This commit is contained in:
parent
a72162cc52
commit
39ece7583a
@ -16,10 +16,9 @@
|
||||
#include "interception/interception.h"
|
||||
#include "sanitizer_common/sanitizer_allocator_dlsym.h"
|
||||
#include "sanitizer_common/sanitizer_allocator_interface.h"
|
||||
#include "sanitizer_common/sanitizer_mallinfo.h"
|
||||
#include "sanitizer_common/sanitizer_tls_get_addr.h"
|
||||
|
||||
#if !SANITIZER_FUCHSIA
|
||||
|
||||
using namespace __hwasan;
|
||||
|
||||
struct DlsymAlloc : public DlSymAllocator<DlsymAlloc> {
|
||||
@ -155,12 +154,19 @@ void *__sanitizer_malloc(uptr size) {
|
||||
|
||||
} // extern "C"
|
||||
|
||||
#if HWASAN_WITH_INTERCEPTORS
|
||||
#if HWASAN_WITH_INTERCEPTORS || SANITIZER_FUCHSIA
|
||||
#if SANITIZER_FUCHSIA
|
||||
// Fuchsia does not use WRAP/wrappers used for the interceptor infrastructure.
|
||||
# define INTERCEPTOR_ALIAS(RET, FN, ARGS...) \
|
||||
extern "C" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE RET FN( \
|
||||
ARGS) ALIAS("__sanitizer_" #FN)
|
||||
#else
|
||||
# define INTERCEPTOR_ALIAS(RET, FN, ARGS...) \
|
||||
extern "C" SANITIZER_INTERFACE_ATTRIBUTE RET WRAP(FN)(ARGS) \
|
||||
ALIAS("__sanitizer_" #FN); \
|
||||
extern "C" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE RET FN( \
|
||||
ARGS) ALIAS("__sanitizer_" #FN)
|
||||
#endif
|
||||
|
||||
INTERCEPTOR_ALIAS(int, posix_memalign, void **memptr, SIZE_T alignment,
|
||||
SIZE_T size);
|
||||
@ -183,5 +189,3 @@ INTERCEPTOR_ALIAS(int, mallopt, int cmd, int value);
|
||||
INTERCEPTOR_ALIAS(void, malloc_stats, void);
|
||||
# endif
|
||||
#endif // #if HWASAN_WITH_INTERCEPTORS
|
||||
|
||||
#endif // SANITIZER_FUCHSIA
|
||||
|
Loading…
x
Reference in New Issue
Block a user