xref: /freebsd-src/contrib/llvm-project/compiler-rt/lib/ubsan/ubsan_win_weak_interception.cpp (revision 5b27928474e6a4103d65b347544705c40c9618fd)
1*68d75effSDimitry Andric //===-- ubsan_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 Ubsan when it is implemented as a shared
9*68d75effSDimitry Andric // library on Windows (dll), in order to delegate the calls of weak functions to
10*68d75effSDimitry Andric // the implementation in the main executable when a strong definition is
11*68d75effSDimitry Andric // 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 "ubsan_flags.h"
16*68d75effSDimitry Andric #include "ubsan_monitor.h"
17*68d75effSDimitry Andric // Check if strong definitions for weak functions are present in the main
18*68d75effSDimitry Andric // executable. If that is the case, override dll functions to point to strong
19*68d75effSDimitry Andric // implementations.
20*68d75effSDimitry Andric #define INTERFACE_FUNCTION(Name)
21*68d75effSDimitry Andric #define INTERFACE_WEAK_FUNCTION(Name) INTERCEPT_SANITIZER_WEAK_FUNCTION(Name)
22*68d75effSDimitry Andric #include "ubsan_interface.inc"
23*68d75effSDimitry Andric #endif // SANITIZER_DYNAMIC
24