From 272b36d1b5cbab951239b32ed679a9dbc4ffdf1a Mon Sep 17 00:00:00 2001 From: Kiyoung Kim Date: Wed, 19 Feb 2020 16:08:47 +0900 Subject: 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 --- libnativeloader/native_loader.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libnativeloader/native_loader.cpp') 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 #include +#include #include #include #include @@ -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()); -- cgit v1.2.3-59-g8ed1b