summaryrefslogtreecommitdiff
path: root/linker/linker.cpp
diff options
context:
space:
mode:
authorNIEJuhu <niejuhu@xiaomi.com>2019-12-20 18:51:21 +0800
committerNIEJuhu <niejuhu@xiaomi.com>2019-12-27 11:32:29 +0800
commite2871bd0d88f94a729550b428c0551fbc952a04e (patch)
treea6dcf6d11877001abdefd5d0a0aec4c4db7027b6 /linker/linker.cpp
parentca1834de7a8180ee8db0a629fa950387c9da49b1 (diff)
Do not add duplicate soinfos to g_default_namespace
The soinfo instances of linker and vdso have been added to g_default_namespace before init_default_namespace() is called. So init_default_namespace() don't have to add them a second time. Test: manual Change-Id: I29b3da782b1e9445509f45a7698561fc3e19e9a1
Diffstat (limited to 'linker/linker.cpp')
-rw-r--r--linker/linker.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 1393eb521..1e77daf0c 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -4195,11 +4195,13 @@ std::vector<android_namespace_t*> init_default_namespaces(const char* executable
// we also need vdso to be available for all namespaces (if present)
soinfo* vdso = solist_get_vdso();
for (auto it : namespaces) {
- it.second->add_soinfo(ld_android_so);
- if (vdso != nullptr) {
- it.second->add_soinfo(vdso);
+ if (it.second != &g_default_namespace) {
+ it.second->add_soinfo(ld_android_so);
+ if (vdso != nullptr) {
+ it.second->add_soinfo(vdso);
+ }
+ // somain and ld_preloads are added to these namespaces after LD_PRELOAD libs are linked
}
- // somain and ld_preloads are added to these namespaces after LD_PRELOAD libs are linked
}
set_application_target_sdk_version(config->target_sdk_version());