From c70ff9f9be0c7360a37519ec68ac4dd41e8d0a3c Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sat, 31 Aug 2019 03:01:15 +0000 Subject: compiler, runtime: support and use single argument go:linkname The gc compiler has started permitting go:linkname comments with a single argument to mean that a function should be externally visible outside the package. Implement this in the Go frontend. Change the libgo runtime package to use it, rather than repeating the name just to export a function. Remove a couple of unnecessary go:linkname comments on declarations. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192197 From-SVN: r275239 --- libgo/go/runtime/slice.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'libgo/go/runtime/slice.go') diff --git a/libgo/go/runtime/slice.go b/libgo/go/runtime/slice.go index 9137951..4b15f82 100644 --- a/libgo/go/runtime/slice.go +++ b/libgo/go/runtime/slice.go @@ -10,14 +10,13 @@ import ( "unsafe" ) -// For gccgo, use go:linkname to rename compiler-called functions to -// themselves, so that the compiler will export them. +// For gccgo, use go:linkname to export compiler-called functions. // -//go:linkname makeslice runtime.makeslice -//go:linkname makeslice64 runtime.makeslice64 -//go:linkname growslice runtime.growslice -//go:linkname slicecopy runtime.slicecopy -//go:linkname slicestringcopy runtime.slicestringcopy +//go:linkname makeslice +//go:linkname makeslice64 +//go:linkname growslice +//go:linkname slicecopy +//go:linkname slicestringcopy type slice struct { array unsafe.Pointer -- cgit v1.1