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