1353944Sdim//===-- asan_win_weak_interception.cpp ------------------------------------===// 2353944Sdim// 3353944Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4353944Sdim// See https://llvm.org/LICENSE.txt for license information. 5353944Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6353944Sdim// 7353944Sdim//===----------------------------------------------------------------------===// 8353944Sdim// This module should be included in Address Sanitizer when it is implemented as 9353944Sdim// a shared library on Windows (dll), in order to delegate the calls of weak 10353944Sdim// functions to the implementation in the main executable when a strong 11353944Sdim// definition is provided. 12353944Sdim//===----------------------------------------------------------------------===// 13353944Sdim#ifdef SANITIZER_DYNAMIC 14353944Sdim#include "sanitizer_common/sanitizer_win_weak_interception.h" 15353944Sdim#include "asan_interface_internal.h" 16353944Sdim// Check if strong definitions for weak functions are present in the main 17353944Sdim// executable. If that is the case, override dll functions to point to strong 18353944Sdim// implementations. 19353944Sdim#define INTERFACE_FUNCTION(Name) 20353944Sdim#define INTERFACE_WEAK_FUNCTION(Name) INTERCEPT_SANITIZER_WEAK_FUNCTION(Name) 21353944Sdim#include "asan_interface.inc" 22353944Sdim#endif // SANITIZER_DYNAMIC 23