aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_darwin_amd64.s
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2018-04-10 22:56:14 +0000
committerKeith Randall <khr@golang.org>2018-04-11 00:04:30 +0000
commitb3a854c733257c5249c3435ffcee194f8439676a (patch)
tree9a37a0d31c49b1bebb4874bee31577c121adb889 /src/runtime/sys_darwin_amd64.s
parent3d501df441b1d1d3e9fb2308140d8bb9b948ad65 (diff)
downloadgo-b3a854c733257c5249c3435ffcee194f8439676a.tar.gz
go-b3a854c733257c5249c3435ffcee194f8439676a.zip
runtime: use fixed TLS offsets on darwin/amd64 and darwin/386
Fixes #23617 Note that this CL does not affect darwin/arm and darwin/arm64, still TBD what, if anything, needs to be done for those. This is a fix of CL 105975 which was reverted in CL 106155. Needed to use movl instead of movq for 386. Change-Id: I0db7f8087173869e60cc22c6c3124fa0a0739b46 Reviewed-on: https://go-review.googlesource.com/106156 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/sys_darwin_amd64.s')
-rw-r--r--src/runtime/sys_darwin_amd64.s9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/runtime/sys_darwin_amd64.s b/src/runtime/sys_darwin_amd64.s
index ab57843dfa..7a4f8ba39a 100644
--- a/src/runtime/sys_darwin_amd64.s
+++ b/src/runtime/sys_darwin_amd64.s
@@ -569,11 +569,10 @@ TEXT runtimeĀ·mach_semaphore_signal_all(SB),NOSPLIT,$0
// set tls base to DI
TEXT runtimeĀ·settls(SB),NOSPLIT,$32
/*
- * Same as in sys_darwin_386.s:/ugliness, different constant.
- * See cgo/gcc_darwin_amd64.c for the derivation
- * of the constant.
- */
- SUBQ $0x8a0, DI
+ * Same as in sys_darwin_386.s, but a different constant.
+ * Constant must match the one in cmd/link/internal/ld/sym.go.
+ */
+ SUBQ $0x30, DI
MOVL $(0x3000000+3), AX // thread_fast_set_cthread_self - machdep call #3
SYSCALL