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