-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runtime: use %gs:0x30 for TLS on macOS #23617
Comments
Q: 0x30 for amd64? What about 386, arm, arm64? Is there any way we can get Apple to commit this offset for Go? I understand it is currently reserved, but if they are willing to give it out to us they might also give it out to some other Foo project. Then a binary with both Go and Foo in it wouldn't work. |
Apple has committed that we can use the 0x30 offset for amd64, on the assumption that we will never link Go and Windows code together while running on Darwin. I sent an e-mail asking about the other platforms. |
Change https://golang.org/cl/105975 mentions this issue: |
Change https://golang.org/cl/106156 mentions this issue: |
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>
Any plans for this change to make it into 1.10.x? |
No. Is there a reason you want it? |
The offset of G changed in go1.11 from 0x8a0 to 0x30. See: golang/go#23617
The offset of G changed in go1.11 from 0x8a0 to 0x30. See: golang/go#23617
The offset of G changed in go1.11 from 0x8a0 to 0x30. See: golang/go#23617
The offset of G changed in go1.11 from 0x8a0 to 0x30. See: golang/go#23617
The offset of G changed in go1.11 from 0x8a0 to 0x30. See: golang/go#23617
The offset of G changed in go1.11 from 0x8a0 to 0x30. See: golang/go#23617
The offset of G changed in go1.11 from 0x8a0 to 0x30. See: golang/go#23617
The offset of G changed in go1.11 from 0x8a0 to 0x30. See: golang/go#23617
The offset of G changed in go1.11 from 0x8a0 to 0x30. See: golang/go#23617
The offset of G changed in go1.11 from 0x8a0 to 0x30. See: golang/go#23617
The offset of G changed in go1.11 from 0x8a0 to 0x30. See: golang/go#23617
The offset of G changed in go1.11 from 0x8a0 to 0x30. See: golang/go#23617
The offset of G changed in go1.11 from 0x8a0 to 0x30. See: golang/go#23617
The offset of G changed in go1.11 from 0x8a0 to 0x30. See: golang/go#23617
The offset of G changed in go1.11 from 0x8a0 to 0x30. See: golang/go#23617
The offset of G changed in go1.11 from 0x8a0 to 0x30. See: golang/go#23617
Per private email discussion with Anthony Chivetta of Apple, Go should stop guessing pthread offsets and instead hard-code 0x30 off %gs as the g register. That location is already reserved for WINE and Win64, so as long as we're not trying to run Win64 code linked into macOS binaries, all will be well.
The text was updated successfully, but these errors were encountered: