kernel: Clean up and fix some mistakes. (#2907)

This commit is contained in:
squidbus 2025-05-11 14:22:17 -07:00 committed by GitHub
parent ff1339b0b6
commit 3a090e988c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 28 additions and 42 deletions

View file

@ -127,7 +127,7 @@ void Linker::Execute(const std::vector<std::string> args) {
}
}
params.entry_addr = module->GetEntryAddress();
RunMainEntry(&params);
ExecuteGuest(RunMainEntry, &params);
});
}
@ -366,7 +366,8 @@ void* Linker::TlsGetAddr(u64 module_index, u64 offset) {
if (!addr) {
// Module was just loaded by above code. Allocate TLS block for it.
const u32 init_image_size = module->tls.init_image_size;
u8* dest = reinterpret_cast<u8*>(heap_api->heap_malloc(module->tls.image_size));
u8* dest = reinterpret_cast<u8*>(
Core::ExecuteGuest(heap_api->heap_malloc, module->tls.image_size));
const u8* src = reinterpret_cast<const u8*>(module->tls.image_virtual_addr);
std::memcpy(dest, src, init_image_size);
std::memset(dest + init_image_size, 0, module->tls.image_size - init_image_size);