diff options
author | Zhenhua WANG <zhenhua.wang@intel.com> | 2017-02-27 10:14:45 +0800 |
---|---|---|
committer | Calin Juravle <calin@google.com> | 2017-03-29 17:34:11 -0700 |
commit | e8fb11dfa1b376124d0a1a349c8800799f25606a (patch) | |
tree | 6b10f653cd6c76db1966a007aaea26498509a3fa /libnativeloader | |
parent | c169b2018fb72ea31da68616548dcf6582cb0a93 (diff) | |
download | core-e8fb11dfa1b376124d0a1a349c8800799f25606a.tar.gz core-e8fb11dfa1b376124d0a1a349c8800799f25606a.tar.bz2 core-e8fb11dfa1b376124d0a1a349c8800799f25606a.zip |
NativeBridge: add "linked namespace" semantic corresponding to linker
For dynamic linking perspective, semantics of NativeBridge needs to
align with dynamic linker. This patch adds "linked namespace" semantic
which shares some libraries from one namespace to another.
Test: make test-art-host-run-test-115-native-bridge
Change-Id: I71ce1dde19d61363d5eb9731fd4795a8c315b3a0
Diffstat (limited to 'libnativeloader')
-rw-r--r-- | libnativeloader/native_loader.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libnativeloader/native_loader.cpp b/libnativeloader/native_loader.cpp index 74f2f1d31..f3391d1be 100644 --- a/libnativeloader/native_loader.cpp +++ b/libnativeloader/native_loader.cpp @@ -183,6 +183,11 @@ class LibraryNamespaces { return false; } + if (!NativeBridgeLinkNamespaces(ns, nullptr, public_libraries_.c_str())) { + *error_msg = NativeBridgeGetError(); + return false; + } + native_loader_ns = NativeLoaderNamespace(ns); } @@ -324,8 +329,8 @@ class LibraryNamespaces { // and now initialize native bridge namespaces if necessary. if (NativeBridgeInitialized()) { - initialized_ = NativeBridgeInitNamespace(public_libraries_.c_str(), - is_native_bridge ? library_path : nullptr); + initialized_ = NativeBridgeInitAnonymousNamespace(public_libraries_.c_str(), + is_native_bridge ? library_path : nullptr); if (!initialized_) { *error_msg = NativeBridgeGetError(); } |