hanchenye-llvm-project/compiler-rt
Alexey Samsonov 4f319cca42 [ASan] Print exact source location of global variables in error reports.
See https://code.google.com/p/address-sanitizer/issues/detail?id=299 for the
original feature request.

Introduce llvm.asan.globals metadata, which Clang (or any other frontend)
may use to report extra information about global variables to ASan
instrumentation pass in the backend. This metadata replaces
llvm.asan.dynamically_initialized_globals that was used to detect init-order
bugs. llvm.asan.globals contains the following data for each global:
  1) source location (file/line/column info);
  2) whether it is dynamically initialized;
  3) whether it is blacklisted (shouldn't be instrumented).

Source location data is then emitted in the binary and can be picked up
by ASan runtime in case it needs to print error report involving some global.
For example:

  0x... is located 4 bytes to the right of global variable 'C::array' defined in '/path/to/file:17:8' (0x...) of size 40

These source locations are printed even if the binary doesn't have any
debug info.

This is an ABI-breaking change. ASan initialization is renamed to
__asan_init_v4(). Pre-built libraries compiled with older Clang will not work
with the fresh runtime.

llvm-svn: 212188
2014-07-02 16:54:41 +00:00
..
SDKs Fix typos 2014-05-15 02:22:34 +00:00
android Move Android ucontext.h out of third_party. 2014-03-18 08:32:14 +00:00
cmake [Sanitizers Win] Move duplicate Windows-specific compiler flags to a common CMake variable 2014-05-30 12:42:57 +00:00
include [sanitizer] Add __sanitizer_maybe_open_cov_file(). 2014-05-21 13:43:52 +00:00
lib [ASan] Print exact source location of global variables in error reports. 2014-07-02 16:54:41 +00:00
make Unify the name of compiler-rt builtins library on Linux. 2014-05-22 21:12:43 +00:00
test [ASan] Print exact source location of global variables in error reports. 2014-07-02 16:54:41 +00:00
unittests [ASan] Optional support for dynamic ASan runtime on Linux. 2014-04-01 13:16:30 +00:00
www Rewrite compiler-rt.llvm.org to make it relevant 2014-02-27 14:39:48 +00:00
.arcconfig Update arc config to new domain. 2014-04-07 10:22:41 +00:00
.gitignore Add vim swap files to .gitignore 2014-03-20 19:44:33 +00:00
CMakeLists.txt [asan] adding support of 32-bit address sanitizer for MIPS 2014-06-24 12:08:18 +00:00
CODE_OWNERS.TXT Add myself as a c-rt owner of ASan/Win 2014-02-27 12:07:43 +00:00
CREDITS.TXT Add Guan-Hong Liu. 2014-06-16 08:38:19 +00:00
LICENSE.TXT Move Android ucontext.h out of third_party. 2014-03-18 08:32:14 +00:00
Makefile Revert r196490 and fix include paths in makefile-based build 2013-12-05 10:40:11 +00:00
README.txt Moved the builtins documentation to lib/builtins/ 2014-05-28 23:09:45 +00:00

README.txt

Compiler-RT
================================

This directory and its subdirectories contain source code for the compiler
support routines.

Compiler-RT is open source software. You may freely distribute it under the
terms of the license agreement found in LICENSE.txt.

================================