Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
runtime: use %gs:0x30 for TLS on macOS #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.
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.