Merge "Inline __libc_init_global_stack_chk_guard."
am: 6ef8415d09
Change-Id: Ie3b7c78b764ce441af746e0f7d3aa923d6bede2d
diff --git a/libc/bionic/__libc_init_main_thread.cpp b/libc/bionic/__libc_init_main_thread.cpp
index a18a831..8645df2 100644
--- a/libc/bionic/__libc_init_main_thread.cpp
+++ b/libc/bionic/__libc_init_main_thread.cpp
@@ -42,10 +42,6 @@
// Declared in "private/bionic_ssp.h".
uintptr_t __stack_chk_guard = 0;
-void __libc_init_global_stack_chk_guard(KernelArgumentBlock& args) {
- __libc_safe_arc4random_buf(&__stack_chk_guard, sizeof(__stack_chk_guard), args);
-}
-
// Setup for the main thread. For dynamic executables, this is called by the
// linker _before_ libc is mapped in memory. This means that all writes to
// globals from this function will apply to linker-private copies and will not
@@ -96,7 +92,7 @@
// The TLS stack guard is set from the global, so ensure that we've initialized the global
// before we initialize the TLS. Dynamic executables will initialize their copy of the global
// stack protector from the one in the main thread's TLS.
- __libc_init_global_stack_chk_guard(args);
+ __libc_safe_arc4random_buf(&__stack_chk_guard, sizeof(__stack_chk_guard), args);
__init_thread_stack_guard(&main_thread);
__init_thread(&main_thread);