Path: blob/main/contrib/llvm-project/compiler-rt/lib/ubsan/ubsan_win_weak_interception.cpp
35233 views
//===-- ubsan_win_weak_interception.cpp -----------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7// This module should be included in Ubsan when it is implemented as a shared8// library on Windows (dll), in order to delegate the calls of weak functions to9// the implementation in the main executable when a strong definition is10// provided.11//===----------------------------------------------------------------------===//12#ifdef SANITIZER_DYNAMIC13#include "sanitizer_common/sanitizer_win_weak_interception.h"14#include "ubsan_flags.h"15#include "ubsan_monitor.h"16// Check if strong definitions for weak functions are present in the main17// executable. If that is the case, override dll functions to point to strong18// implementations.19#define INTERFACE_FUNCTION(Name)20#define INTERFACE_WEAK_FUNCTION(Name) INTERCEPT_SANITIZER_WEAK_FUNCTION(Name)21#include "ubsan_interface.inc"22#endif // SANITIZER_DYNAMIC232425