Home | History | Annotate | Download | only in asan
      1 //===-- asan_init_version.h -------------------------------------*- C++ -*-===//
      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 AddressSanitizer, an address sanity checker.
     11 //
     12 // This header defines a versioned __asan_init function to be called at the
     13 // startup of the instrumented program.
     14 //===----------------------------------------------------------------------===//
     15 #ifndef ASAN_INIT_VERSION_H
     16 #define ASAN_INIT_VERSION_H
     17 
     18 #include "sanitizer_common/sanitizer_internal_defs.h"
     19 
     20 extern "C" {
     21   // This function should be called at the very beginning of the process,
     22   // before any instrumented code is executed and before any call to malloc.
     23   // Every time the ASan ABI changes we also change the version number in this
     24   // name. Objects build with incompatible ASan ABI version
     25   // will not link with run-time.
     26   // Changes between ABI versions:
     27   // v1=>v2: added 'module_name' to __asan_global
     28   // v2=>v3: stack frame description (created by the compiler)
     29   //         contains the function PC as the 3-rd field (see
     30   //         DescribeAddressIfStack).
     31   // v3=>v4: added '__asan_global_source_location' to __asan_global.
     32   SANITIZER_INTERFACE_ATTRIBUTE void __asan_init_v4();
     33   #define __asan_init __asan_init_v4
     34   #define __asan_init_name "__asan_init_v4"
     35 }
     36 
     37 #endif  // ASAN_INIT_VERSION_H
     38