Retro68/gcc/libsanitizer/asan/asan_preinit.cc

24 lines
942 B
C++
Raw Normal View History

2014-09-21 17:33:12 +00:00
//===-- asan_preinit.cc ---------------------------------------------------===//
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file is a part of AddressSanitizer, an address sanity checker.
//
// Call __asan_init at the very early stage of process startup.
//===----------------------------------------------------------------------===//
#include "asan_internal.h"
2017-04-10 11:32:00 +00:00
using namespace __asan;
2015-08-28 15:33:40 +00:00
#if SANITIZER_CAN_USE_PREINIT_ARRAY
2014-09-21 17:33:12 +00:00
// The symbol is called __local_asan_preinit, because it's not intended to be
// exported.
2017-04-10 11:32:00 +00:00
// This code linked into the main executable when -fsanitize=address is in
// the link flags. It can only use exported interface functions.
2014-09-21 17:33:12 +00:00
__attribute__((section(".preinit_array"), used))
void (*__local_asan_preinit)(void) = __asan_init;
#endif