From 7af0839e11378b153feaa9570aeb2cdcdc06b75f Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Thu, 12 Nov 2015 12:55:57 +1300 Subject: cmd/go, runtime: always use position-independent code to invoke vsyscall helper on linux/386 golang.org/cl/16346 changed the runtime on linux/386 to invoke the vsyscall helper via a PIC sequence (CALL 0x10(GS)) when dynamically linking. But it's actually quite easy to make that code sequence work all the time, so do that, and remove the ugly machinery that passed the buildmode from the go tool to the assembly. This means enlarging m.tls so that we can safely access 0x10(GS) (GS is set to &m.tls + 4, so 0x10(GS) accesses m_tls[5]). Change-Id: I1345c34029b149cb5f25320bf19a3cdd73a056fa Reviewed-on: https://go-review.googlesource.com/16796 Reviewed-by: Ian Lance Taylor --- src/runtime/runtime2.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/runtime/runtime2.go') diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index 1dbd3d2094..eb7b30a344 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -274,7 +274,7 @@ type m struct { procid uint64 // for debuggers, but offset not hard-coded gsignal *g // signal-handling g sigmask [4]uintptr // storage for saved signal mask - tls [4]uintptr // thread-local storage (for x86 extern register) + tls [6]uintptr // thread-local storage (for x86 extern register) mstartfn func() curg *g // current running goroutine caughtsig guintptr // goroutine running during fatal signal -- cgit v1.3-5-g9baa