linker: disable ld.config.txt in ASAN mode
Currently, multiple namespaces does not support ASAN mode where some
symbols should be intercepted via LD_PRELOAD; LD_PRELOADed libs are not
preloaded into the linked namespaces other than the default namespace.
Until we fix the problem, we temporarily disable ld.config.txt in ASAN
mode.
Bug: 38114603
Test: 1. ./external/compiler-rt/lib/asan/scripts/asan_device_setup --lib
prebuilts/clang/host/linux-x86/clang-stable/lib64/clang/3.8/lib/linux
2. enable talkback shortcut
3. in the home screen, hold vol-up/down together
4. device does not reboots and talkback shortcut is toggled
Test: bionic-unit-tests and linker-unit-tests successful
Change-Id: I091874dd36b36f56dff2ad899d76ff86931909ed
diff --git a/linker/linker_config.cpp b/linker/linker_config.cpp
index b9205cc..a398260 100644
--- a/linker/linker_config.cpp
+++ b/linker/linker_config.cpp
@@ -370,6 +370,15 @@
bool is_asan,
const Config** config,
std::string* error_msg) {
+ // TODO(b/38114603) Currently, multiple namespaces does not support ASAN mode
+ // where some symbols should be intercepted via LD_PRELOAD; LD_PRELOADed libs
+ // are not being preloaded into the linked namespaces other than the default
+ // namespace. Until we fix the problem, we temporarily disable ld.config.txt
+ // in ASAN mode.
+ if (is_asan) {
+ return false;
+ }
+
g_config.clear();
std::unordered_map<std::string, PropertyValue> property_map;