rust: Implement TARGET_RUST_OS_INFO for *-*-darwin*
[official-gcc.git] / libsanitizer / hwasan / hwasan_preinit.cpp
blob8c9c95f413be3f5cffce0ae9eff6f58dc9247744
1 //===-- hwasan_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-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file is a part of HWAddressSanitizer, an address sanity checker.
11 // Call __hwasan_init at the very early stage of process startup.
12 //===----------------------------------------------------------------------===//
13 #include "hwasan_interface_internal.h"
14 #include "sanitizer_common/sanitizer_internal_defs.h"
16 #if SANITIZER_CAN_USE_PREINIT_ARRAY
17 // The symbol is called __local_hwasan_preinit, because it's not intended to
18 // be exported.
19 // This code linked into the main executable when -fsanitize=hwaddress is in
20 // the link flags. It can only use exported interface functions.
21 __attribute__((section(".preinit_array"), used)) static void (
22 *__local_hwasan_preinit)(void) = __hwasan_init;
23 #endif