diff options
| author | Elias Naur <mail@eliasnaur.com> | 2019-03-28 13:11:53 +0100 |
|---|---|---|
| committer | Elias Naur <mail@eliasnaur.com> | 2019-03-29 17:16:32 +0000 |
| commit | 1d10b17589ce651caeb0841b2312065ee44f800d (patch) | |
| tree | 5ac85df676c80f4a0fdf4aa507ef4ecab9d90e5c /src/runtime/sys_linux_386.s | |
| parent | 2cc347382f4df3fb40d8d81ec9331f0748b1c394 (diff) | |
| download | go-1d10b17589ce651caeb0841b2312065ee44f800d.tar.xz | |
cmd/link/ld,cmd/internal/obj,runtime: make the Android TLS offset dynamic
We're going to need a different TLS offset for Android Q, so the static
offsets used for 386 and amd64 are no longer viable on Android.
Introduce runtime·tls_g and use that for indexing into TLS storage. As
an added benefit, we can then merge the TLS setup code for all android
GOARCHs.
While we're at it, remove a bunch of android special cases no longer
needed.
Updates #29674
Updates #29249 (perhaps fixes it)
Change-Id: I77c7385aec7de8f1f6a4da7c9c79999157e39572
Reviewed-on: https://go-review.googlesource.com/c/go/+/169817
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime/sys_linux_386.s')
| -rw-r--r-- | src/runtime/sys_linux_386.s | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/runtime/sys_linux_386.s b/src/runtime/sys_linux_386.s index 40b55a67eb..8c791b3004 100644 --- a/src/runtime/sys_linux_386.s +++ b/src/runtime/sys_linux_386.s @@ -575,12 +575,8 @@ TEXT runtime·setldt(SB),NOSPLIT,$32 MOVL address+4(FP), DX // 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, DX + // Android stores the TLS offset in runtime·tls_g. + SUBL runtime·tls_g(SB), DX MOVL DX, 0(DX) #else /* |
