Replace TLS_SLOT_BIONIC_PREINIT w/ shared globals
Instead of passing the address of a KernelArgumentBlock to libc.so for
initialization, use __loader_shared_globals() to initialize globals.
Most of the work happened in the previous CLs. This CL switches a few
KernelArgumentBlock::getauxval calls to [__bionic_]getauxval and stops
routing the KernelArgumentBlock address through the libc init functions.
Bug: none
Test: bionic unit tests
Change-Id: I96c7b02c21d55c454558b7a5a9243c682782f2dd
Merged-In: I96c7b02c21d55c454558b7a5a9243c682782f2dd
(cherry picked from commit 746ad15912cfa82271424747e94d8125acc43d8c)
diff --git a/libc/bionic/libc_init_common.cpp b/libc/bionic/libc_init_common.cpp
index fca628b..f1fbfa9 100644
--- a/libc/bionic/libc_init_common.cpp
+++ b/libc/bionic/libc_init_common.cpp
@@ -43,7 +43,6 @@
#include <async_safe/log.h>
-#include "private/KernelArgumentBlock.h"
#include "private/WriteProtected.h"
#include "private/bionic_defs.h"
#include "private/bionic_globals.h"
@@ -58,14 +57,14 @@
// Not public, but well-known in the BSDs.
const char* __progname;
-void __libc_init_globals(KernelArgumentBlock& args) {
+void __libc_init_globals() {
// Initialize libc globals that are needed in both the linker and in libc.
// In dynamic binaries, this is run at least twice for different copies of the
// globals, once for the linker's copy and once for the one in libc.so.
__libc_globals.initialize();
- __libc_globals.mutate([&args](libc_globals* globals) {
- __libc_init_vdso(globals, args);
- __libc_init_setjmp_cookie(globals, args);
+ __libc_globals.mutate([](libc_globals* globals) {
+ __libc_init_vdso(globals);
+ __libc_init_setjmp_cookie(globals);
});
}