aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-06-08 23:21:07 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-06-08 23:21:07 +0000
commit8848e127c7aa9a7964c06cea0f4429b825e454f1 (patch)
tree2c24a26b97bdcf124828c7ab49db8db9854e2a3d
parent30682f8b47ee4c78bfb9aed7a28206e04b78f7d5 (diff)
parentd13cb58b3afda031fbe38f6dc8eaca28237c8a3b (diff)
downloadandroid_bionic-8848e127c7aa9a7964c06cea0f4429b825e454f1.tar.gz
android_bionic-8848e127c7aa9a7964c06cea0f4429b825e454f1.tar.bz2
android_bionic-8848e127c7aa9a7964c06cea0f4429b825e454f1.zip
Snap for 5645193 from d13cb58b3afda031fbe38f6dc8eaca28237c8a3b to qt-qpr1-release
Change-Id: I37ff98127f03694e199e8acae723c1f5f1a9e04e
-rw-r--r--linker/linker.cpp7
-rw-r--r--tests/dlfcn_test.cpp4
2 files changed, 11 insertions, 0 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp
index b59df7302..324f3ef23 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -1162,6 +1162,13 @@ static int open_library(android_namespace_t* ns,
}
}
+#if !defined(__ANDROID_APEX__)
+ if (fd == -1) {
+ std::vector<std::string> bootstrap_paths = { std::string(kSystemLibDir) + "/bootstrap" };
+ fd = open_library_on_paths(zip_archive_cache, name, file_offset, bootstrap_paths, realpath);
+ }
+#endif
+
if (fd == -1) {
fd = open_library_on_paths(zip_archive_cache, name, file_offset, ns->get_default_library_paths(), realpath);
}
diff --git a/tests/dlfcn_test.cpp b/tests/dlfcn_test.cpp
index f3be9883d..7ff553d49 100644
--- a/tests/dlfcn_test.cpp
+++ b/tests/dlfcn_test.cpp
@@ -999,6 +999,7 @@ TEST(dlfcn, dlopen_executable_by_absolute_path) {
#error "Unknown architecture"
#endif
#define PATH_TO_LIBC PATH_TO_SYSTEM_LIB "libc.so"
+#define PATH_TO_BOOTSTRAP_LIBC PATH_TO_SYSTEM_LIB "bootstrap/libc.so"
#define ALTERNATE_PATH_TO_LIBC ALTERNATE_PATH_TO_SYSTEM_LIB "libc.so"
TEST(dlfcn, dladdr_libc) {
@@ -1018,6 +1019,9 @@ TEST(dlfcn, dladdr_libc) {
sizeof(ALTERNATE_PATH_TO_SYSTEM_LIB) - 1) == 0) {
// Platform with emulated architecture. Symlink on ARC++.
ASSERT_TRUE(realpath(ALTERNATE_PATH_TO_LIBC, libc_realpath) == libc_realpath);
+ } else if (strncmp(PATH_TO_BOOTSTRAP_LIBC, info.dli_fname,
+ sizeof(PATH_TO_BOOTSTRAP_LIBC) - 1) == 0) {
+ ASSERT_TRUE(realpath(PATH_TO_BOOTSTRAP_LIBC, libc_realpath) == libc_realpath);
} else {
// /system/lib is symlink when this test is executed on host.
ASSERT_TRUE(realpath(PATH_TO_LIBC, libc_realpath) == libc_realpath);