1//===-asan_abi.cpp - ASan Stable ABI---------------------------------------===//
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#include "asan_abi.h"
10
11extern "C" {
12// Functions concerning instrumented global variables:
13void __asan_abi_register_image_globals(void) {}
14void __asan_abi_unregister_image_globals(void) {}
15void __asan_abi_register_elf_globals(bool *flag, void *start, void *stop) {}
16void __asan_abi_unregister_elf_globals(bool *flag, void *start, void *stop) {}
17void __asan_abi_register_globals(void *globals, size_t n) {}
18void __asan_abi_unregister_globals(void *globals, size_t n) {}
19
20// Functions concerning dynamic library initialization
21void __asan_abi_before_dynamic_init(const char *module_name) {}
22void __asan_abi_after_dynamic_init(void) {}
23
24// Functions concerning block memory destinations
25void *__asan_abi_memcpy(void *d, const void *s, size_t n) { return NULL; }
26void *__asan_abi_memmove(void *d, const void *s, size_t n) { return NULL; }
27void *__asan_abi_memset(void *p, int c, size_t n) { return NULL; }
28
29// Functions concerning RTL startup and initialization
30void __asan_abi_init(void) {}
31void __asan_abi_handle_no_return(void) {}
32
33// Functions concerning memory load and store reporting
34void __asan_abi_report_load_n(void *p, size_t n, bool abort) {}
35void __asan_abi_report_exp_load_n(void *p, size_t n, int exp, bool abort) {}
36void __asan_abi_report_store_n(void *p, size_t n, bool abort) {}
37void __asan_abi_report_exp_store_n(void *p, size_t n, int exp, bool abort) {}
38
39// Functions concerning memory load and store
40void __asan_abi_load_n(void *p, size_t n, bool abort) {}
41void __asan_abi_exp_load_n(void *p, size_t n, int exp, bool abort) {}
42void __asan_abi_store_n(void *p, size_t n, bool abort) {}
43void __asan_abi_exp_store_n(void *p, size_t n, int exp, bool abort) {}
44
45// Functions concerning query about whether memory is poisoned
46int __asan_abi_address_is_poisoned(void const volatile *p) { return 0; }
47void *__asan_abi_region_is_poisoned(void const volatile *p, size_t size) {
48 return NULL;
49}
50
51// Functions concerning the poisoning of memory
52void __asan_abi_poison_memory_region(void const volatile *p, size_t n) {}
53void __asan_abi_unpoison_memory_region(void const volatile *p, size_t n) {}
54
55// Functions concerning the partial poisoning of memory
56void __asan_abi_set_shadow_xx_n(void *p, unsigned char xx, size_t n) {}
57
58// Functions concerning stack poisoning
59void __asan_abi_poison_stack_memory(void *p, size_t n) {}
60void __asan_abi_unpoison_stack_memory(void *p, size_t n) {}
61
62// Functions concerning redzone poisoning
63void __asan_abi_poison_intra_object_redzone(void *p, size_t size) {}
64void __asan_abi_unpoison_intra_object_redzone(void *p, size_t size) {}
65
66// Functions concerning array cookie poisoning
67void __asan_abi_poison_cxx_array_cookie(void *p) {}
68void *__asan_abi_load_cxx_array_cookie(void **p) { return NULL; }
69
70// Functions concerning fake stacks
71void *__asan_abi_get_current_fake_stack(void) { return NULL; }
72void *__asan_abi_addr_is_in_fake_stack(void *fake_stack, void *addr, void **beg,
73 void **end) {
74 return NULL;
75}
76
77// Functions concerning poisoning and unpoisoning fake stack alloca
78void __asan_abi_alloca_poison(void *addr, size_t size) {}
79void __asan_abi_allocas_unpoison(void *top, void *bottom) {}
80
81// Functions concerning fake stack malloc
82void *__asan_abi_stack_malloc_n(size_t scale, size_t size) { return NULL; }
83void *__asan_abi_stack_malloc_always_n(size_t scale, size_t size) {
84 return NULL;
85}
86
87// Functions concerning fake stack free
88void __asan_abi_stack_free_n(int scale, void *p, size_t n) {}
89}
90

source code of compiler-rt/lib/asan_abi/asan_abi.cpp