1 //===-- lsan_preinit.cc ---------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file is a part of LeakSanitizer.
12 // Call __lsan_init at the very early stage of process startup.
13 //===----------------------------------------------------------------------===//
17 #if SANITIZER_CAN_USE_PREINIT_ARRAY
18 // We force __lsan_init to be called before anyone else by placing it into
19 // .preinit_array section.
20 __attribute__((section(".preinit_array"), used))
21 void (*__local_lsan_preinit)(void) = __lsan_init;