diff options
author | Christopher R. Palmer <crpalmer@gmail.com> | 2015-12-01 06:50:22 -0500 |
---|---|---|
committer | Ethan Chen <intervigil@gmail.com> | 2015-12-01 10:17:07 -0800 |
commit | 91d934ac73ae5a198ae0db4203c8fcf79e4df288 (patch) | |
tree | b0ab1f98a1558d7c30cb29e7df629352b39167c1 | |
parent | 81105204fbb28ca97408a5dfe9608c6982317f24 (diff) | |
download | bionic-91d934ac73ae5a198ae0db4203c8fcf79e4df288.zip bionic-91d934ac73ae5a198ae0db4203c8fcf79e4df288.tar.gz bionic-91d934ac73ae5a198ae0db4203c8fcf79e4df288.tar.bz2 |
Revert "Revert "linker: Reset the active shim libs each time we do a dlopen""
This reverts commit fd0140b028dedabc572f4659cc015edfeee3cd60.
Change-Id: I42b3acfcdc6b84251a396b9e42604bb5685196bd
-rw-r--r-- | linker/linker.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp index 2aafc6c..99807f1 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -896,13 +896,18 @@ static std::vector<std::string> g_ld_all_shim_libs; static linked_list_t<const std::string> g_active_shim_libs; -static void parse_LD_SHIM_LIBS(const char* path) { - parse_path(path, " :", &g_ld_all_shim_libs); +static void reset_g_active_shim_libs(void) { + g_active_shim_libs.clear(); for (const auto& pair : g_ld_all_shim_libs) { g_active_shim_libs.push_back(&pair); } } +static void parse_LD_SHIM_LIBS(const char* path) { + parse_path(path, " :", &g_ld_all_shim_libs); + reset_g_active_shim_libs(); +} + static bool shim_lib_matches(const char *shim_lib, const char *realpath) { const char *sep = strchr(shim_lib, '|'); return sep != nullptr && strncmp(realpath, shim_lib, sep - shim_lib) == 0; @@ -1745,6 +1750,7 @@ soinfo* do_dlopen(const char* name, int flags, const android_dlextinfo* extinfo) } ProtectedDataGuard guard; + reset_g_active_shim_libs(); soinfo* si = find_library(name, flags, extinfo); if (si != nullptr) { si->call_constructors(); |