2018-11-16 Richard Biener <rguenther@suse.de>
[official-gcc.git] / libsanitizer / ubsan / ubsan_win_weak_interception.cc
blob9f0a8f1d38a0a3a3d947d119a7f4780fda18a474
1 //===-- ubsan_win_weak_interception.cc ------------------------------------===//
2 //
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
5 //
6 //===----------------------------------------------------------------------===//
7 // This module should be included in Ubsan when it is implemented as a shared
8 // library on Windows (dll), in order to delegate the calls of weak functions to
9 // the implementation in the main executable when a strong definition is
10 // provided.
11 //===----------------------------------------------------------------------===//
12 #ifdef SANITIZER_DYNAMIC
13 #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 main
17 // executable. If that is the case, override dll functions to point to strong
18 // 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_DYNAMIC