diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2023-03-12 21:43:20 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2023-03-12 21:43:20 +0100 |
| commit | a08f3c4c9eca36ef2415d8428434ca4af41aa84e (patch) | |
| tree | 19a473f8220c366379ad7d887a4b2488e6035d22 /src/wrapped/wrappedldlinux.c | |
| parent | c0f98bb0ec8b996d7fe35b1b311ec421587a94fd (diff) | |
| download | box64-a08f3c4c9eca36ef2415d8428434ca4af41aa84e.tar.gz box64-a08f3c4c9eca36ef2415d8428434ca4af41aa84e.zip | |
Tried to optimize TLS fetching
Diffstat (limited to 'src/wrapped/wrappedldlinux.c')
| -rwxr-xr-x | src/wrapped/wrappedldlinux.c | 5 |
1 files changed, 3 insertions, 2 deletions
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 |