xref: /freebsd-src/contrib/llvm-project/compiler-rt/lib/asan/asan_win_weak_interception.cpp (revision 5b27928474e6a4103d65b347544705c40c9618fd)
1*68d75effSDimitry Andric //===-- asan_win_weak_interception.cpp ------------------------------------===//
2*68d75effSDimitry Andric //
3*68d75effSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*68d75effSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*68d75effSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*68d75effSDimitry Andric //
7*68d75effSDimitry Andric //===----------------------------------------------------------------------===//
8*68d75effSDimitry Andric // This module should be included in Address Sanitizer when it is implemented as
9*68d75effSDimitry Andric // a shared library on Windows (dll), in order to delegate the calls of weak
10*68d75effSDimitry Andric // functions to the implementation in the main executable when a strong
11*68d75effSDimitry Andric // definition is provided.
12*68d75effSDimitry Andric //===----------------------------------------------------------------------===//
13*68d75effSDimitry Andric #ifdef SANITIZER_DYNAMIC
14*68d75effSDimitry Andric #include "sanitizer_common/sanitizer_win_weak_interception.h"
15*68d75effSDimitry Andric #include "asan_interface_internal.h"
16*68d75effSDimitry Andric // Check if strong definitions for weak functions are present in the main
17*68d75effSDimitry Andric // executable. If that is the case, override dll functions to point to strong
18*68d75effSDimitry Andric // implementations.
19*68d75effSDimitry Andric #define INTERFACE_FUNCTION(Name)
20*68d75effSDimitry Andric #define INTERFACE_WEAK_FUNCTION(Name) INTERCEPT_SANITIZER_WEAK_FUNCTION(Name)
21*68d75effSDimitry Andric #include "asan_interface.inc"
22*68d75effSDimitry Andric #endif // SANITIZER_DYNAMIC
23