[compiler-rt] r313584 - [ubsan] Add file missing from r313583

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 15:43:28 PDT 2017


Author: vitalybuka
Date: Mon Sep 18 15:43:28 2017
New Revision: 313584

URL: http://llvm.org/viewvc/llvm-project?rev=313584&view=rev
Log:
[ubsan] Add file missing from r313583

Added:
    compiler-rt/trunk/lib/ubsan/ubsan_init_standalone_preinit.cc

Added: compiler-rt/trunk/lib/ubsan/ubsan_init_standalone_preinit.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/ubsan_init_standalone_preinit.cc?rev=313584&view=auto
==============================================================================
--- compiler-rt/trunk/lib/ubsan/ubsan_init_standalone_preinit.cc (added)
+++ compiler-rt/trunk/lib/ubsan/ubsan_init_standalone_preinit.cc Mon Sep 18 15:43:28 2017
@@ -0,0 +1,26 @@
+//===-- ubsan_init_standalone_preinit.cc
+//------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Initialization of standalone UBSan runtime.
+//
+//===----------------------------------------------------------------------===//
+
+#include "ubsan_platform.h"
+#if !CAN_SANITIZE_UB
+#error "UBSan is not supported on this platform!"
+#endif
+
+#include "sanitizer_common/sanitizer_internal_defs.h"
+#include "ubsan_init.h"
+
+#if SANITIZER_CAN_USE_PREINIT_ARRAY
+__attribute__((section(".preinit_array"), used)) void (*__local_ubsan_preinit)(
+    void) = __ubsan::InitAsStandalone;
+#endif // SANITIZER_CAN_USE_PREINIT_ARRAY




More information about the llvm-commits mailing list