OSDN Git Service

Make default namespace handle the 'visible' flag.
authorJustin Yun <justinyun@google.com>
Fri, 7 Jul 2017 07:21:53 +0000 (16:21 +0900)
committerJustin Yun <justinyun@google.com>
Thu, 17 Aug 2017 01:12:51 +0000 (10:12 +0900)
'visible' flag was interpreted only the namespaces other than 'default'.
The flag has to be handled without exception once it is set.

Bug: 63411330
Test: Build and boot without errors.
Test: Add `namespace.default.visible = true` to [vendor] process in
      'ld.config.txt' and reboot the device.

Merged-In: Ia363dfadf0200317b875e26bb4b2fae849af1384
Change-Id: Ia363dfadf0200317b875e26bb4b2fae849af1384
(cherry picked from commit 90de9f081e098ef019457d6529ef6d7fb3c09873)

linker/linker.cpp

index 4397551..078b3d5 100644 (file)
@@ -3533,6 +3533,9 @@ std::vector<android_namespace_t*> init_default_namespaces(const char* executable
   g_default_namespace.set_permitted_paths(default_ns_config->permitted_paths());
 
   namespaces[default_ns_config->name()] = &g_default_namespace;
+  if (default_ns_config->visible()) {
+    g_exported_namespaces[default_ns_config->name()] = &g_default_namespace;
+  }
 
   // 2. Initialize other namespaces