linker: Update LD_SHIM_LIBS parser function
* Upgrade the code using the same changes as
42d5fcb9f494eb45de3b6bf759f4a18076e84728
bda20e78f0f314dbbf0f0bbcf0740cf2d6a4b85e
Change-Id: Ic8be0871945bd9feccd0f94a6770f3cc78a70a0f
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 9ddb60e..9084e92 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -1255,7 +1255,14 @@
}
static void parse_LD_SHIM_LIBS(const char* path) {
- parse_path(path, " :", &g_ld_all_shim_libs);
+ g_ld_all_shim_libs.clear();
+ if (path != nullptr) {
+ // We have historically supported ':' as well as ' ' in LD_SHIM_LIBS.
+ g_ld_all_shim_libs = android::base::Split(path, " :");
+ std::remove_if(g_ld_all_shim_libs.begin(),
+ g_ld_all_shim_libs.end(),
+ [] (const std::string& s) { return s.empty(); });
+ }
reset_g_active_shim_libs();
}