From b511dbe488cc7faffe6300812c10af7d7293d9a0 Mon Sep 17 00:00:00 2001 From: midipix Date: Fri, 16 Sep 2016 23:01:35 -0400 Subject: __emutls_get_address(): unify cases, fix dsoidx-based pointer arithmetic. --- arch/nt32/src/crt_tls.c | 6 +----- arch/nt64/src/crt_tls.c | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/arch/nt32/src/crt_tls.c b/arch/nt32/src/crt_tls.c index 15183d3..a3375d8 100644 --- a/arch/nt32/src/crt_tls.c +++ b/arch/nt32/src/crt_tls.c @@ -18,10 +18,6 @@ void * __emutls_get_address (struct __emutls_object * obj) { int dsoidx = obj->align & 0xFFFF0000; struct __tlca * tlca = (struct __tlca *)__psx_tlca(); - - if (dsoidx) - return (*tlca->pthread_dtls)[dsoidx >> 16] + obj->offset; - else - return tlca->pthread_tls + obj->offset; + return tlca->pthread_dtls[dsoidx >> 16] + obj->offset; } diff --git a/arch/nt64/src/crt_tls.c b/arch/nt64/src/crt_tls.c index 15183d3..a3375d8 100644 --- a/arch/nt64/src/crt_tls.c +++ b/arch/nt64/src/crt_tls.c @@ -18,10 +18,6 @@ void * __emutls_get_address (struct __emutls_object * obj) { int dsoidx = obj->align & 0xFFFF0000; struct __tlca * tlca = (struct __tlca *)__psx_tlca(); - - if (dsoidx) - return (*tlca->pthread_dtls)[dsoidx >> 16] + obj->offset; - else - return tlca->pthread_tls + obj->offset; + return tlca->pthread_dtls[dsoidx >> 16] + obj->offset; } -- cgit v1.2.3