From a08f3c4c9eca36ef2415d8428434ca4af41aa84e Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sun, 12 Mar 2023 21:43:20 +0100 Subject: Tried to optimize TLS fetching --- src/wrapped/wrappedldlinux.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/wrapped/wrappedldlinux.c') diff --git a/src/wrapped/wrappedldlinux.c b/src/wrapped/wrappedldlinux.c index d88c10c2..b5dc0da6 100755 --- a/src/wrapped/wrappedldlinux.c +++ b/src/wrapped/wrappedldlinux.c @@ -14,6 +14,7 @@ #include "emu/x64emu_private.h" #include "elfloader.h" #include "box64context.h" +#include "x64tls.h" typedef struct my_tls_s { unsigned long int i; @@ -23,8 +24,8 @@ typedef struct my_tls_s { EXPORT void* my___tls_get_addr(void* p) { my_tls_t *t = (my_tls_t*)p; - void* ret = (void*)((char*)GetTLSPointer(my_context, my_context->elfs[t->i])+t->o); - return ret; + tlsdatasize_t* ptr = getTLSData(my_context); + return ptr->data+GetTLSBase(my_context->elfs[t->i])+t->o; } // don't try to load the actual ld-linux (because name is variable), just use box64 itself, as it's linked to ld-linux -- cgit 1.4.1