1 //===-- lsan_preinit.cc ---------------------------------------------------===//
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
6 //===----------------------------------------------------------------------===//
8 // This file is a part of LeakSanitizer.
10 // Call __lsan_init at the very early stage of process startup.
11 //===----------------------------------------------------------------------===//
15 #ifndef LSAN_USE_PREINIT_ARRAY
16 #define LSAN_USE_PREINIT_ARRAY 1
19 #if LSAN_USE_PREINIT_ARRAY && !defined(PIC)
20 // We force __lsan_init to be called before anyone else by placing it into
21 // .preinit_array section.
22 __attribute__((section(".preinit_array"), used
))
23 void (*__local_lsan_preinit
)(void) = __lsan_init
;