]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: make the second argument to go:linkname optional
authorAustin Clements <austin@google.com>
Fri, 31 May 2019 19:45:06 +0000 (15:45 -0400)
committerAustin Clements <austin@google.com>
Thu, 6 Jun 2019 19:44:10 +0000 (19:44 +0000)
commitdde7c770ef44d45b8a9f98bf0f46556f18df2f6e
tree6eb6394de6c492340ead1a1cb230afdda24a84b8
parentb402bd4499a59c6f1fac4dc2684390b5d4d1c2eb
cmd/compile: make the second argument to go:linkname optional

The //go:linkname directive can be used to make a symbol accessible to
another package (when it wouldn't normally be). Sometimes you want to
do this without actually changing the symbol's object file symbol
name; for example, in gccgo this makes unexported symbols non-static,
and in gc this provides ABI0 wrappers for Go symbols so they can be
called from assembly in other packages. Currently, this results in
stutter like

   //go:linkname entersyscall runtime.entersyscall

This CL makes the second argument to go:linkname optional for the case
where the intent is simply to expose the symbol rather than to rename
it in the object file.

Updates #31230.

Change-Id: Id06d9c4b2ec3d8e27f9b8a0d65212ab8048d734f
Reviewed-on: https://go-review.googlesource.com/c/go/+/179861
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/doc.go
src/cmd/compile/internal/gc/noder.go