diff options
author | Dimitry Ivanov <dimitry@google.com> | 2017-05-16 23:08:20 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-16 23:08:20 +0000 |
commit | 91779f4867dd92024c90a3212b92ec4ded983123 (patch) | |
tree | a9d0362a080f8c0f8319a263baca608436393b5c | |
parent | 59abd613d4a29f2c1f1135f6999cef206d5201e1 (diff) | |
parent | 15db97879715bab20c5f8cfbc6abb72664b417ca (diff) | |
download | bionic-91779f4867dd92024c90a3212b92ec4ded983123.tar.gz |
Merge "linker: remove link from external library on unload" into mnc-dev am: 8dee813dfa
am: 15db978797
Change-Id: I7998e10917cad017c6a8684c6439c19c149c5928
-rw-r--r-- | linker/linked_list.h | 6 | ||||
-rw-r--r-- | linker/linker.cpp | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/linker/linked_list.h b/linker/linked_list.h index 8003dbf84..0572e635b 100644 --- a/linker/linked_list.h +++ b/linker/linked_list.h @@ -127,7 +127,13 @@ class LinkedList { } else { p->next = next; } + + if (tail_ == e) { + tail_ = p; + } + Allocator::free(e); + e = next; } else { p = e; diff --git a/linker/linker.cpp b/linker/linker.cpp index d3ac1d000..19f5e94c4 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -1597,6 +1597,9 @@ static void soinfo_unload(soinfo* root) { if (local_unload_list.contains(child)) { continue; } else if (child->is_linked() && child->get_local_group_root() != root) { + child->get_parents().remove_if([&] (const soinfo* parent) { + return parent == si; + }); external_unload_list.push_back(child); } else { depth_first_list.push_front(child); |