From caa169ee4804ba0dbe1c430e8e9a4d2940f5145b Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Wed, 25 Feb 2026 12:26:54 -0500 Subject: all: add export linknames for assembly symbols accessed from other package For Go symbols accessed from other package via linkname or assembly, we have an export linkname from the definition side. We currently don't always have the linkname directive for assembly functions, for which external accesses are allowed. We may want to tighten up the restriction. So add export linknames for the ones that are needed. Change-Id: If664634c81580edd49086d916024f23f86871092 Reviewed-on: https://go-review.googlesource.com/c/go/+/749981 LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Pratt --- src/sync/atomic/doc.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/sync') diff --git a/src/sync/atomic/doc.go b/src/sync/atomic/doc.go index 4e93404757..4382a13ed6 100644 --- a/src/sync/atomic/doc.go +++ b/src/sync/atomic/doc.go @@ -80,6 +80,7 @@ func SwapUint32(addr *uint32, new uint32) (old uint32) // Consider using the more ergonomic and less error-prone [Uintptr.Swap] instead. // //go:noescape +//go:linknamestd SwapUintptr func SwapUintptr(addr *uintptr, new uintptr) (old uintptr) // SwapPointer atomically stores new into *addr and returns the previous *addr value. @@ -102,6 +103,7 @@ func CompareAndSwapUint32(addr *uint32, old, new uint32) (swapped bool) // Consider using the more ergonomic and less error-prone [Uintptr.CompareAndSwap] instead. // //go:noescape +//go:linknamestd CompareAndSwapUintptr func CompareAndSwapUintptr(addr *uintptr, old, new uintptr) (swapped bool) // CompareAndSwapPointer executes the compare-and-swap operation for a unsafe.Pointer value. @@ -208,6 +210,7 @@ func StoreUint32(addr *uint32, val uint32) // Consider using the more ergonomic and less error-prone [Uintptr.Store] instead. // //go:noescape +//go:linknamestd StoreUintptr func StoreUintptr(addr *uintptr, val uintptr) // StorePointer atomically stores val into *addr. -- cgit v1.3-5-g9baa