brintos

brintos / llvm-project-archived public Read only

0
0
Text · 919 B · 69700f2 Raw
25 lines · cpp
1//===-- tsan_preinit.cpp --------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8//9// This file is a part of ThreadSanitizer.10//11// Call __tsan_init at the very early stage of process startup.12//===----------------------------------------------------------------------===//13 14#include "sanitizer_common/sanitizer_internal_defs.h"15#include "tsan_interface.h"16 17#if SANITIZER_CAN_USE_PREINIT_ARRAY18 19// This section is linked into the main executable when -fsanitize=thread is20// specified to perform initialization at a very early stage.21__attribute__((section(".preinit_array"), used)) static auto preinit =22    __tsan_init;23 24#endif25