• Austin Clements's avatar
    cmd/compile: make the second argument to go:linkname optional · dde7c770
    Austin Clements authored
    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: default avatarDavid Chase <drchase@google.com>
    dde7c770
doc.go 8.67 KB