// Leave the variable uninitialized for the sake of the dynamic loader, which // links in this file. The loader will initialize this variable before // relocating itself. #ifdefined(__i386__)
__LIBC_HIDDEN__ void* __libc_sysinfo; #endif
static TlsModule mod;
TlsModules& modules = __libc_shared_globals()->tls_modules; if (__bionic_get_tls_segment(phdr_start, phdr_ct, 0, &mod.segment)) { if (!__bionic_check_tls_align(mod.segment.aligned_size.align.value)) {
async_safe_fatal("error: TLS segment alignment in \"%s\" is not a power of 2: %zu\n",
progname, mod.segment.aligned_size.align.value);
}
mod.static_offset = layout.reserve_exe_segment_and_tcb(&mod.segment, progname);
mod.first_generation = kTlsGenerationFirst;
modules.module_count = 1;
modules.static_module_count = 1;
modules.module_table = &mod;
} else {
layout.reserve_exe_segment_and_tcb(nullptr, progname);
} // Enable the fast path in __tls_get_addr.
__libc_tls_generation_copy = modules.generation;
layout.finish_layout();
}
void __libc_init_profiling_handlers() { // The dynamic variant of this function is more interesting, but this // at least ensures that static binaries aren't killed by the kernel's // default disposition for these two real-time signals that would have // handlers installed if this was a dynamic binary.
signal(BIONIC_SIGNAL_PROFILER, SIG_IGN);
signal(BIONIC_SIGNAL_ART_PROFILER, SIG_IGN);
}
// The executable may have its own destructors listed in its .fini_array // so we need to ensure that these are called when the program exits // normally. if (structors->fini_array_count > 0) {
__cxa_atexit(call_fini_array, const_cast<structors_array_t*>(structors), nullptr);
} #if !__has_feature(hwaddress_sanitizer)
__libc_init_mte_late(); #endif
// Wait until everything is initialized before enabled systracing.
__get_bionic_tls().bionic_systrace_enabled = true;
exit(main(args.argc, args.argv, args.envp));
}
extern"C"void __hwasan_init_static();
// This __libc_init() is only used for static executables, and is called from crtbegin.c. // // The 'structors' parameter contains pointers to various initializer // arrays that must be run before the program's 'main' routine is launched.
__attribute__((no_sanitize("hwaddress", "memtag"))) __noreturn void __libc_init( void* raw_args, void*, int (*main)(int, char**, char**),
structors_array_t const* const structors) { // We _really_ don't want the compiler to call memset() here, // but it's done so before for riscv64 (http://b/365618934), // so we have to force it to behave.
bionic_tcb temp_tcb __attribute__((uninitialized));
__builtin_memset_inline(&temp_tcb, 0, sizeof(temp_tcb));
KernelArgumentBlock args(raw_args); #if __has_feature(hwaddress_sanitizer) // Install main thread TLS early. It will be initialized later in __libc_init_main_thread. For now // all we need is access to TLS_SLOT_SANITIZER and read auxval for the page size.
__set_tls(&temp_tcb.tls_slot(0));
__libc_shared_globals()->auxv = args.auxv; // Initialize HWASan enough to run instrumented code. This sets up TLS_SLOT_SANITIZER, among other // things.
__hwasan_init_static(); // We are ready to run HWASan-instrumented code, proceed with libc initialization... #endif
// This function is called in the dynamic linker before ifunc resolvers have run, so this file is // compiled with -ffreestanding to avoid implicit string.h function calls. (It shouldn't strictly // be necessary, though.)
__LIBC_HIDDEN__ libc_shared_globals* __libc_shared_globals() {
BIONIC_USED_BEFORE_LINKER_RELOCATES static libc_shared_globals globals; return &globals;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-06-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.