aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2017-12-02 00:46:00 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2017-12-02 00:46:00 +0000
commit79c9f76563e0c0943c9dc44bd1b892175c3239b9 (patch)
treed493104ca59804fbe820b492ad9b9be9ec0ea2d1 /libgo
parent9638589faff5b5ec33afba0b5a4560a3f0b5aaa6 (diff)
downloadgcc-79c9f76563e0c0943c9dc44bd1b892175c3239b9.zip
gcc-79c9f76563e0c0943c9dc44bd1b892175c3239b9.tar.gz
gcc-79c9f76563e0c0943c9dc44bd1b892175c3239b9.tar.bz2
runtime: export cgoCheck functions
The functions cgoCheckPointer and cgoCheckResult are called by code generated by cgo. That means that we need to export them using go:linkname, as otherwise they are local symbols. The cgo code currently uses weak references to only call the symbols if they are defined, which is why it has been working--the cgo code has not been doing any checks. Reviewed-on: https://go-review.googlesource.com/80295 From-SVN: r255347
Diffstat (limited to 'libgo')
-rw-r--r--libgo/go/runtime/cgocall.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/libgo/go/runtime/cgocall.go b/libgo/go/runtime/cgocall.go
index 2e0e591..4a416fb 100644
--- a/libgo/go/runtime/cgocall.go
+++ b/libgo/go/runtime/cgocall.go
@@ -11,6 +11,10 @@ import (
"unsafe"
)
+// Functions called by cgo-generated code.
+//go:linkname cgoCheckPointer runtime.cgoCheckPointer
+//go:linkname cgoCheckResult runtime.cgoCheckResult
+
// Pointer checking for cgo code.
// We want to detect all cases where a program that does not use