]> Cypherpunks repositories - gostls13.git/commit
runtime: correct ABI information for all functions
authorAustin Clements <austin@google.com>
Thu, 1 Nov 2018 16:25:41 +0000 (12:25 -0400)
committerAustin Clements <austin@google.com>
Mon, 12 Nov 2018 20:27:18 +0000 (20:27 +0000)
commitaf1bfe0aa39091a4103bd29d8659f6267aad9df0
tree57774ef97c6f5fdf742bd942f2b487cd84b049db
parent6096b85b1326c22ec07c2aed2d78f3bef513ea69
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>
src/cmd/vet/all/whitelist/386.txt
src/runtime/asm.s
src/runtime/os_nacl.go
src/runtime/race.go
src/runtime/stubs_386.go [new file with mode: 0644]
src/syscall/asm_windows.s [new file with mode: 0644]