aboutsummaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2018-04-10 18:40:01 +0000
committerKeith Randall <khr@golang.org>2018-04-10 18:40:19 +0000
commit8bb8eaff626796908938e7f0da102dc51a265237 (patch)
treeea63bba009b5be87e04d3ccc607a635980ddfd1b /src/cmd
parentc4a3a9c70992958284cedb06fc24b93b2184dc03 (diff)
downloadgo-8bb8eaff626796908938e7f0da102dc51a265237.tar.xz
Revert "runtime: use fixed TLS offsets on darwin/amd64 and darwin/386"
This reverts commit 76e92d1c9e2943de7093af14d58663fa2993e608. Reason for revert: Seems to have broken the darwin/386 builder, the toolchain is barfing on the new inline assembly. Change-Id: Ic83fa3c85148946529c5fd47d1e1669898031ace Reviewed-on: https://go-review.googlesource.com/106155 Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/link/internal/ld/sym.go20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/cmd/link/internal/ld/sym.go b/src/cmd/link/internal/ld/sym.go
index 7bc57eff8d..6f019de8cc 100644
--- a/src/cmd/link/internal/ld/sym.go
+++ b/src/cmd/link/internal/ld/sym.go
@@ -113,30 +113,24 @@ func (ctxt *Link) computeTLSOffset() {
/*
* OS X system constants - offset from 0(GS) to our TLS.
+ * Explained in src/runtime/cgo/gcc_darwin_*.c.
*/
case objabi.Hdarwin:
switch ctxt.Arch.Family {
default:
log.Fatalf("unknown thread-local storage offset for darwin/%s", ctxt.Arch.Name)
- /*
- * For x86, Apple has reserved a slot in the TLS for Go. See issue 23617.
- * That slot is at offset 0x30 on amd64, and 0x18 on 386.
- * The slot will hold the G pointer.
- * These constants should match those in runtime/sys_darwin_{386,amd64}.s
- * and runtime/cgo/gcc_darwin_{386,amd64}.c.
- */
- case sys.I386:
- ctxt.Tlsoffset = 0x18
-
- case sys.AMD64:
- ctxt.Tlsoffset = 0x30
-
case sys.ARM:
ctxt.Tlsoffset = 0 // dummy value, not needed
+ case sys.AMD64:
+ ctxt.Tlsoffset = 0x8a0
+
case sys.ARM64:
ctxt.Tlsoffset = 0 // dummy value, not needed
+
+ case sys.I386:
+ ctxt.Tlsoffset = 0x468
}
}