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>
Wed, 16 Aug 2017 05:38:07 +0000 (14:38 +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.

Change-Id: Ia363dfadf0200317b875e26bb4b2fae849af1384

linker/linker.cpp

index a212624..8aadd14 100644 (file)
@@ -3506,6 +3506,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