]> Cypherpunks repositories - gostls13.git/commit
runtime: fix TLS handling for netbsd
authorJoel Sing <jsing@google.com>
Tue, 15 May 2012 01:26:05 +0000 (11:26 +1000)
committerJoel Sing <jsing@google.com>
Tue, 15 May 2012 01:26:05 +0000 (11:26 +1000)
commitb42ebb6fbfc564e7a89e67ac1b9575b49b580bbb
tree4f8415fc161b96bb4ee657b555844fc71ecd2f1f
parente393a8292ead03c78b570cf1f30ca1d54caf5445
runtime: fix TLS handling for netbsd

Set the TLS base using the _lwp_setprivate() syscall, instead of via
sysarch(). NetBSD tracks the pointer passed to _lwp_setprivate() and
restores this value when restoring mcontext. If sysarch() is used
directly, restoring an mcontext trashes the FS/GS value, resulting
in a segfault when we next try to access the TLS.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6206062
src/pkg/runtime/sys_netbsd_386.s
src/pkg/runtime/sys_netbsd_amd64.s