asan_init_version.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //===-- asan_init_version.h -------------------------------------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This file is a part of AddressSanitizer, an address sanity checker.
  10. //
  11. // This header defines a versioned __asan_init function to be called at the
  12. // startup of the instrumented program.
  13. //===----------------------------------------------------------------------===//
  14. #ifndef ASAN_INIT_VERSION_H
  15. #define ASAN_INIT_VERSION_H
  16. #include "sanitizer_common/sanitizer_platform.h"
  17. extern "C" {
  18. // Every time the ASan ABI changes we also change the version number in the
  19. // __asan_init function name. Objects built with incompatible ASan ABI
  20. // versions will not link with run-time.
  21. //
  22. // Changes between ABI versions:
  23. // v1=>v2: added 'module_name' to __asan_global
  24. // v2=>v3: stack frame description (created by the compiler)
  25. // contains the function PC as the 3rd field (see
  26. // DescribeAddressIfStack)
  27. // v3=>v4: added '__asan_global_source_location' to __asan_global
  28. // v4=>v5: changed the semantics and format of __asan_stack_malloc_ and
  29. // __asan_stack_free_ functions
  30. // v5=>v6: changed the name of the version check symbol
  31. // v6=>v7: added 'odr_indicator' to __asan_global
  32. // v7=>v8: added '__asan_(un)register_image_globals' functions for dead
  33. // stripping support on Mach-O platforms
  34. #if SANITIZER_WORDSIZE == 32 && SANITIZER_ANDROID
  35. // v8=>v9: 32-bit Android switched to dynamic shadow
  36. #define __asan_version_mismatch_check __asan_version_mismatch_check_v9
  37. #else
  38. #define __asan_version_mismatch_check __asan_version_mismatch_check_v8
  39. #endif
  40. }
  41. #endif // ASAN_INIT_VERSION_H