aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_linux_386.s
diff options
context:
space:
mode:
authorHyang-Ah Hana Kim <hyangah@gmail.com>2015-11-05 16:32:27 -0500
committerHyang-Ah Hana Kim <hyangah@gmail.com>2015-11-11 21:59:24 +0000
commit05c4c6e2f48dad6876a8ffc3e72b4122245c5095 (patch)
tree91f04e9dee9897eba134b0393303d7e19ebe8be1 /src/runtime/sys_linux_386.s
parentd727312cbfd7212950b12ec078030c62c83a9064 (diff)
downloadgo-05c4c6e2f48dad6876a8ffc3e72b4122245c5095.tar.xz
cmd,runtime: TLS setup for android/386
Same ugly hack as https://go-review.googlesource.com/15991. Update golang/go#9327. Change-Id: I58284e83268a15de95eabc833c3e01bf1e3faa2e Reviewed-on: https://go-review.googlesource.com/16678 Reviewed-by: David Crawshaw <crawshaw@golang.org>
Diffstat (limited to 'src/runtime/sys_linux_386.s')
-rw-r--r--src/runtime/sys_linux_386.s10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/runtime/sys_linux_386.s b/src/runtime/sys_linux_386.s
index 9e0e87cafc..a52c4b2588 100644
--- a/src/runtime/sys_linux_386.s
+++ b/src/runtime/sys_linux_386.s
@@ -405,6 +405,15 @@ TEXT runtime·setldt(SB),NOSPLIT,$32
MOVL entry+0(FP), BX // entry
MOVL address+4(FP), CX // base address
+#ifdef GOOS_android
+ /*
+ * Same as in sys_darwin_386.s:/ugliness, different constant.
+ * address currently holds m->tls, which must be %gs:0xf8.
+ * See cgo/gcc_android_386.c for the derivation of the constant.
+ */
+ SUBL $0xf8, CX
+ MOVL CX, 0(CX)
+#else
/*
* When linking against the system libraries,
* we use its pthread_create and let it set up %gs
@@ -420,6 +429,7 @@ TEXT runtime·setldt(SB),NOSPLIT,$32
*/
ADDL $0x4, CX // address
MOVL CX, 0(CX)
+#endif
// set up user_desc
LEAL 16(SP), AX // struct user_desc