linker: initialize system properties
Bug: http://b/20567629
Bug: https://code.google.com/p/chromium/issues/detail?id=478886
Change-Id: I8d2d89b749015e7fcd6e7ea646911f2e617dd1ba
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 63e1b17..cea3a88 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -3022,6 +3022,8 @@
insert_soinfo_into_debug_map(linker_soinfo_for_gdb);
}
+extern "C" int __system_properties_init(void);
+
/*
* This code is called after the linker has linked itself and
* fixed it's own GOT. It is safe to make references to externs
@@ -3036,6 +3038,9 @@
// Initialize environment functions, and get to the ELF aux vectors table.
linker_env_init(args);
+ // Initialize system properties
+ __system_properties_init(); // may use 'environ'
+
// If this is a setuid/setgid program, close the security hole described in
// ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-02:23.stdio.asc
if (get_AT_SECURE()) {