summaryrefslogtreecommitdiff
path: root/libnativeloader/native_loader.cpp
diff options
context:
space:
mode:
authorEvan Ralston <eralston@amazon.com>2017-02-03 17:09:46 -0800
committerEvan Ralston <eralston@amazon.com>2017-02-06 11:05:35 -0800
commit15a264e65c0df7574f2e8f2406ee6427b084cfff (patch)
treec18b30b17a97225a5ba45ddb813dd911a0fac441 /libnativeloader/native_loader.cpp
parent9cd890e9b7a1ae1d354815f529a0b3df1dd07aea (diff)
Log errors from loading public libraries
Prevent the boot from failing silently if one of the public libraries does not exist. Test: Add invalid element to public libraries and observe log is emited during boot failure. Change-Id: I0425085a1cc081068954f327f15be853a3ccd553
Diffstat (limited to 'libnativeloader/native_loader.cpp')
-rw-r--r--libnativeloader/native_loader.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libnativeloader/native_loader.cpp b/libnativeloader/native_loader.cpp
index 94c46fc19..8c2a5f7eb 100644
--- a/libnativeloader/native_loader.cpp
+++ b/libnativeloader/native_loader.cpp
@@ -246,7 +246,9 @@ class LibraryNamespaces {
// For now we rely on CTS test to catch things like this but
// it should probably be addressed in the future.
for (const auto& soname : sonames) {
- dlopen(soname.c_str(), RTLD_NOW | RTLD_NODELETE);
+ LOG_ALWAYS_FATAL_IF(dlopen(soname.c_str(), RTLD_NOW | RTLD_NODELETE) == nullptr,
+ "Error preloading public library %s: %s",
+ soname.c_str(), dlerror());
}
public_libraries_ = base::Join(sonames, ':');