Make default namespace handle the 'visible' flag.
'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
diff --git a/linker/linker.cpp b/linker/linker.cpp
index a212624..8aadd14 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -3506,6 +3506,9 @@
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