Path: blob/main/contrib/llvm-project/compiler-rt/lib/ubsan/ubsan_init_standalone_preinit.cpp
35233 views
//===-- ubsan_init_standalone_preinit.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//8// Initialization of standalone UBSan runtime.9//10//===----------------------------------------------------------------------===//1112#include "ubsan_platform.h"13#if !CAN_SANITIZE_UB14#error "UBSan is not supported on this platform!"15#endif1617#include "sanitizer_common/sanitizer_internal_defs.h"18#include "ubsan_init.h"19#include "ubsan_signals_standalone.h"2021#if SANITIZER_CAN_USE_PREINIT_ARRAY2223namespace __ubsan {2425static void PreInitAsStandalone() {26InitAsStandalone();27InitializeDeadlySignals();28}2930} // namespace __ubsan3132__attribute__((section(".preinit_array"), used)) static auto preinit =33__ubsan::PreInitAsStandalone;34#endif // SANITIZER_CAN_USE_PREINIT_ARRAY353637