diff options
author | Kiyoung Kim <kiyoungkim@google.com> | 2020-02-19 16:08:47 +0900 |
---|---|---|
committer | Kiyoung Kim <kiyoungkim@google.com> | 2020-02-21 01:04:32 +0000 |
commit | 272b36d1b5cbab951239b32ed679a9dbc4ffdf1a (patch) | |
tree | 07e82dbd51885c2ff453da524fa2a46e48adf3ef /libnativeloader/native_loader.cpp | |
parent | 2ad7c98dda05b0c8a049895cd68b3d2850156912 (diff) |
Rename APEX Namespace
Current APEX Namespace is named with APEX name itself, which also uses
.(dot) so linker configuration can keep the syntax safe.
For example, if there are APEX modules named 'A' and 'A.link.A', then
'namespace.A.link.A.link.A = a.so' phrase can be ambiguous from the
linker. To allow any additional linker syntax in the future, we should
avoid dot separator from the namespace name.
Bug: 148826508
Test: m -j passed
Test: boot succeeded from cuttlefish and walleye
Change-Id: I11b6da1b59b4ebf3016f1d783636c7e5d0f8309a
Diffstat (limited to 'libnativeloader/native_loader.cpp')
-rw-r--r-- | libnativeloader/native_loader.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libnativeloader/native_loader.cpp b/libnativeloader/native_loader.cpp index 3998f61eaa..988e8a841c 100644 --- a/libnativeloader/native_loader.cpp +++ b/libnativeloader/native_loader.cpp @@ -21,6 +21,7 @@ #include <dlfcn.h> #include <sys/types.h> +#include <algorithm> #include <memory> #include <mutex> #include <string> @@ -61,6 +62,7 @@ android_namespace_t* FindExportedNamespace(const char* caller_location) { LOG_ALWAYS_FATAL_IF((slash_index == std::string::npos), "Error finding namespace of apex: no slash in path %s", caller_location); std::string name = location.substr(start_index, slash_index - start_index); + std::replace(name.begin(), name.end(), '.', '_'); android_namespace_t* boot_namespace = android_get_exported_namespace(name.c_str()); LOG_ALWAYS_FATAL_IF((boot_namespace == nullptr), "Error finding namespace of apex: no namespace called %s", name.c_str()); |