[PATCH 3/4] loader: loader: Setup the TLS register on ARM64
André Hentschel
nerv at dawncrow.de
Wed Nov 15 16:32:02 CST 2017
Signed-off-by: André Hentschel <nerv at dawncrow.de>
---
loader/preloader.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/loader/preloader.c b/loader/preloader.c
index e519457..725926e 100644
--- a/loader/preloader.c
+++ b/loader/preloader.c
@@ -457,6 +457,8 @@ SYSCALL_NOERR( wld_getegid, 108 /* SYS_getegid */ );
#elif defined(__aarch64__)
+void *thread_data[256];
+
/*
* The _start function is the entry and exit point of this program
*
@@ -469,6 +471,8 @@ __ASM_GLOBAL_FUNC(_start,
"mov x0, SP\n\t"
"sub SP, SP, #144\n\t" /* allocate some space for extra aux values */
"str x0, [SP]\n\t" /* orig stack pointer */
+ "ldr x0, =thread_data\n\t"
+ "msr tpidr_el0, x0\n\t"
"mov x0, SP\n\t" /* ptr to orig stack pointer */
"bl wld_start\n\t"
"ldr x1, [SP]\n\t" /* new stack pointer */
--
2.7.4
More information about the wine-devel
mailing list