* lto.c (do_stream_out): Add PART parameter; open dump file.
[official-gcc.git] / libsanitizer / ubsan / ubsan_init_standalone_preinit.cc
blob80b2f3c3fd4f16881101eb7a1d2a07689f318b77
1 //===-- ubsan_init_standalone_preinit.cc
2 //------------------------------------------===//
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Initialization of standalone UBSan runtime.
11 //===----------------------------------------------------------------------===//
13 #include "ubsan_platform.h"
14 #if !CAN_SANITIZE_UB
15 #error "UBSan is not supported on this platform!"
16 #endif
18 #include "sanitizer_common/sanitizer_internal_defs.h"
19 #include "ubsan_init.h"
20 #include "ubsan_signals_standalone.h"
22 #if SANITIZER_CAN_USE_PREINIT_ARRAY
24 namespace __ubsan {
26 static void PreInitAsStandalone() {
27 InitAsStandalone();
28 InitializeDeadlySignals();
31 } // namespace __ubsan
33 __attribute__((section(".preinit_array"), used)) void (*__local_ubsan_preinit)(
34 void) = __ubsan::PreInitAsStandalone;
35 #endif // SANITIZER_CAN_USE_PREINIT_ARRAY