blob: 5a190959c15dd3c5acd3b56dec7a00deab20e052 [file] [log] [blame]
Sergey Matveev6b0f6af2013-11-25 14:30:37 +00001//===-- lsan_preinit.cc ---------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file is a part of LeakSanitizer.
11//
12// Call __lsan_init at the very early stage of process startup.
13//===----------------------------------------------------------------------===//
14
15#include "lsan.h"
16
Alexey Samsonov21780542014-07-25 22:05:02 +000017#if SANITIZER_CAN_USE_PREINIT_ARRAY
Sergey Matveev6b0f6af2013-11-25 14:30:37 +000018 // 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;
22#endif