summaryrefslogtreecommitdiffhomepage
path: root/src/ldso/nt32
diff options
context:
space:
mode:
Diffstat (limited to 'src/ldso/nt32')
-rw-r--r--src/ldso/nt32/dynlink.c12
-rw-r--r--src/ldso/nt32/start.s19
2 files changed, 26 insertions, 5 deletions
diff --git a/src/ldso/nt32/dynlink.c b/src/ldso/nt32/dynlink.c
index c3cb23e..edfa4a8 100644
--- a/src/ldso/nt32/dynlink.c
+++ b/src/ldso/nt32/dynlink.c
@@ -50,13 +50,15 @@ void *__copy_tls(unsigned char * mem)
**/
pthread_t td;
- void ** dtv;
+ uintptr_t addr;
- dtv = (void **)mem;
- dtv[0] = 0;
+ addr = (uintptr_t)mem;
+ addr >>= 4;
+ addr <<= 4;
+ addr += 16;
- td = (void *)(dtv + 1);
- td->dtv = dtv;
+ td = (struct __pthread *)addr;
+ td->dtv = 0;
return td;
}
diff --git a/src/ldso/nt32/start.s b/src/ldso/nt32/start.s
index 32dc52f..d4815dd 100644
--- a/src/ldso/nt32/start.s
+++ b/src/ldso/nt32/start.s
@@ -1,2 +1,21 @@
# standard dynamic loader is not required
# optional dynamic loader [to be] provided by libldso/libpsxscl
+
+.section .data
+
+.globl ___init_array_start
+.globl ___init_array_end
+.globl ___fini_array_start
+.globl ___fini_array_end
+
+___init_array_start:
+ .long 0
+
+___init_array_end:
+ .long 0
+
+___fini_array_start:
+ .long 0
+
+___fini_array_end:
+ .long 0