aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/race.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2018-11-01 12:25:41 -0400
committerAustin Clements <austin@google.com>2018-11-12 20:27:18 +0000
commitaf1bfe0aa39091a4103bd29d8659f6267aad9df0 (patch)
tree57774ef97c6f5fdf742bd942f2b487cd84b049db /src/runtime/race.go
parent6096b85b1326c22ec07c2aed2d78f3bef513ea69 (diff)
downloadgo-af1bfe0aa39091a4103bd29d8659f6267aad9df0.tar.gz
go-af1bfe0aa39091a4103bd29d8659f6267aad9df0.zip
runtime: correct ABI information for all functions
There are three cases where we don't currently have the visibility to get the ABIs of runtime symbols right, which this CL fixes: 1. For Go functions referenced from non-Go code in other packages. This is runtime.morestackc (which is referenced from function prologues) and a few syscall symbols. For these we need to generate ABI0 wrappers, so this CL adds dummy calls in the assembly code to force wrapper generation. There are many other cross-package references to runtime and runtime/internal/atomic, but these are handled specially by cmd/go. 2. For calls generated by the compiler to runtime Go functions, there are a few symbols that aren't declared in builtins.go because we've never needed their type information before. Now we at least need their ABI information, so these are added to builtins.go. 3. For calls generated by the compiler to runtime assembly functions, the compiler is going to assume the internal ABI is available, so we add Go stubs to the runtime to trigger wrapper generation. For these we're probably going to want to provide internal ABI definitions directly in the assembly for performance, but for now the ABIs are the same so it doesn't matter. For #27539. Change-Id: I9c224e7408d2ef4dd9b0e4c9d7e962ddfe111245 Reviewed-on: https://go-review.googlesource.com/c/146822 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/runtime/race.go')
-rw-r--r--src/runtime/race.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/race.go b/src/runtime/race.go
index 4420c5df2b..08d53a10d2 100644
--- a/src/runtime/race.go
+++ b/src/runtime/race.go
@@ -294,6 +294,10 @@ var racearenaend uintptr
func racefuncenter(uintptr)
func racefuncenterfp()
func racefuncexit()
+func raceread(uintptr)
+func racewrite(uintptr)
+func racereadrange(addr, size uintptr)
+func racewriterange(addr, size uintptr)
func racereadrangepc1(uintptr, uintptr, uintptr)
func racewriterangepc1(uintptr, uintptr, uintptr)
func racecallbackthunk(uintptr)