| 1 | //===----------------------------------------------------------------------===// |
| 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 | /// \file |
| 10 | /// Call __csan_offload_init at the very early stage of process startup. |
| 11 | /// |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "csan_offload.h" |
| 15 | #include "sanitizer_common/sanitizer_internal_defs.h" |
| 16 | |
| 17 | #if SANITIZER_CAN_USE_PREINIT_ARRAY |
| 18 | // This section is linked into the main executable when offloading uses CSan |
| 19 | // to perform initialization at a very early stage. |
| 20 | __attribute__((section(".preinit_array" ), used)) static auto preinit = |
| 21 | __csan_offload_init; |
| 22 | #endif |
| 23 | |