[ASan] Disable strict init-order checking if dlopen() is called.
authorAlexey Samsonov <vonosmas@gmail.com>
Tue, 24 Feb 2015 00:37:27 +0000 (00:37 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Tue, 24 Feb 2015 00:37:27 +0000 (00:37 +0000)
commitf535d33fee75d2f3fd75e05b9414549e7db594e3
treef2934943dcb1d82144649c8b148924cfa84914cf
parent3aa0bd81a2fdbe7ed8dc6a90ceb3b931adf6a2dd
[ASan] Disable strict init-order checking if dlopen() is called.

Revise the fix to https://code.google.com/p/address-sanitizer/issues/detail?id=178:
always disable strict init-order checking the first time dlopen() is
called: at this point shared library is allowed to access globals
defined in the main executable, as they are guaranteed to be
initialized. Revise the test cases:
* simplify init-order-dlopen.cc test case: make it Linux-specific
  (there's no strict init-order checking on other platforms anyway),
  and single-threaded.
* reinforce init-order-pthread-create.cc test case: make sure that
  init-order checker would produce a false positive unless we
  turn it off at the moment we call pthread_create().

llvm-svn: 230288
compiler-rt/lib/asan/asan_interceptors.cc
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
compiler-rt/test/asan/TestCases/Helpers/init-order-pthread-create-extra.cc
compiler-rt/test/asan/TestCases/Linux/init-order-dlopen.cc [new file with mode: 0644]
compiler-rt/test/asan/TestCases/Posix/init-order-dlopen.cc [deleted file]
compiler-rt/test/asan/TestCases/init-order-pthread-create.cc