llvm-project/compiler-rt
Dan Liew 8bffb63497 Introduce a way to allow the ASan dylib on Darwin platforms to be loaded via `dlopen()`.
Summary:

The purpose of this option is provide a way for the ASan dylib
to be loaded via `dlopen()` without triggering most initialization
steps (e.g. shadow memory set up) that normally occur when the
ASan dylib is loaded.

This new functionality is exposed by

- A `SANITIZER_SUPPORTS_INIT_FOR_DLOPEN` macro which indicates if the
  feature is supported. This only true for Darwin currently.
- A `HandleDlopenInit()` function which should return true if the library
  is being loaded via `dlopen()` and
  `SANITIZER_SUPPORTS_INIT_FOR_DLOPEN` is supported. Platforms that
  support this may perform any initialization they wish inside this
  function.

Although disabling initialization is something that could potentially
apply to other sanitizers it appears to be unnecessary for other
sanitizers so this patch only makes the change for ASan.

rdar://problem/45284065

Reviewers: kubamracek, george.karpenkov, kcc, eugenis, krytarowski

Subscribers: #sanitizers, llvm-commits

Differential Revision: https://reviews.llvm.org/D54469

llvm-svn: 348078
2018-12-01 15:45:42 +00:00
..
cmake [CMake] Add a missing case of TO_CMAKE_PATH 2018-11-27 09:23:15 +00:00
docs [sanitizers] Make it possible to XFAIL on the effective target, not just the default. 2016-08-09 11:50:53 +00:00
include Regenerate syscall hooks for NetBSD 8.99.25 2018-10-30 11:10:36 +00:00
lib Introduce a way to allow the ASan dylib on Darwin platforms to be loaded via `dlopen()`. 2018-12-01 15:45:42 +00:00
test Introduce a way to allow the ASan dylib on Darwin platforms to be loaded via `dlopen()`. 2018-12-01 15:45:42 +00:00
unittests [XRay] Add LD_LIBRARY_PATH to env variables for Unit Tests 2018-09-27 23:15:05 +00:00
utils Update generate_netbsd_ioctls.awk for NetBSD 8.99.25 2018-10-31 12:52:08 +00:00
www
.arcconfig [compiler-rt] Set up .arcconfig to point to new Diffusion CRT repository 2017-12-06 20:55:32 +00:00
.gitignore Add .pyc files to .gitignore to compiler-rt 2017-07-24 21:51:12 +00:00
CMakeLists.txt [CMake] When built with LLVM, not use `-Wl,-z,defs` 2018-10-29 22:16:56 +00:00
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
README.txt

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.

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