From 15753e9633be5f157df89423f399e9732a85ce37 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 21 Jul 2020 18:35:09 +0200 Subject: [PATCH] UserspaceEmulator: Don't hardcode the amount of thread-local data This made it impossible to add more thread-local things to LibC. :^) --- DevTools/UserspaceEmulator/Emulator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DevTools/UserspaceEmulator/Emulator.cpp b/DevTools/UserspaceEmulator/Emulator.cpp index 58549437e3..df24092a03 100644 --- a/DevTools/UserspaceEmulator/Emulator.cpp +++ b/DevTools/UserspaceEmulator/Emulator.cpp @@ -121,7 +121,7 @@ bool Emulator::load_elf() memset(tcb_region->shadow_data(), 0x01, program_header.size_in_memory()); auto tls_region = make(0, 4); - tls_region->write32(0, shadow_wrap_as_initialized(tcb_region->base() + 8)); + tls_region->write32(0, shadow_wrap_as_initialized(tcb_region->base() + program_header.size_in_memory())); memset(tls_region->shadow_data(), 0x01, 4); mmu().add_region(move(tcb_region));