For #67401.
Change-Id: I3ae93042dffd0683b7e6d6225536ae667749515b
Reviewed-on: https://go-review.googlesource.com/c/go/+/587221
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
// See go.dev/issue/67401
// and go.dev/issue/67279.
-//go:linkname add
-//go:linkname typesByString
-
// ifaceIndir reports whether t is stored indirectly in an interface value.
// It is no longer used by this package and is here entirely for the
// linkname uses.
// record why the addition is safe, which is to say why the addition
// does not cause x to advance to the very end of p's allocation
// and therefore point incorrectly at the next block in memory.
+//
+// add should be an internal detail (and is trivially copyable),
+// but widely used packages access it using linkname.
+// Notable members of the hall of shame include:
+// - github.com/vmware/govmomi
+//
+// Do not remove or change the type signature.
+// See go.dev/issue/67401.
+//
+//go:linkname add
func add(p unsafe.Pointer, x uintptr, whySafe string) unsafe.Pointer {
return unsafe.Pointer(uintptr(p) + x)
}
// the given string representation.
// It may be empty (no known types with that string) or may have
// multiple elements (multiple types with that string).
+//
+// typesByString should be an internal detail,
+// but widely used packages access it using linkname.
+// Notable members of the hall of shame include:
+// - github.com/aristanetworks/goarista
+//
+// Do not remove or change the type signature.
+// See go.dev/issue/67401.
+//
+//go:linkname typesByString
func typesByString(s string) []*abi.Type {
sections, offset := typelinks()
var ret []*abi.Type
// strhash should be an internal detail,
// but widely used packages access it using linkname.
// Notable members of the hall of shame include:
+// - github.com/aristanetworks/goarista
// - github.com/bytedance/sonic
//
// Do not remove or change the type signature.
}
}
+// nilinterhash should be an internal detail,
+// but widely used packages access it using linkname.
+// Notable members of the hall of shame include:
+// - github.com/aristanetworks/goarista
+//
+// Do not remove or change the type signature.
+// See go.dev/issue/67401.
+//
+//go:linkname nilinterhash
func nilinterhash(p unsafe.Pointer, h uintptr) uintptr {
a := (*eface)(p)
t := a._type
//go:linkname gopark
//go:linkname goready
//go:linkname goyield
-//go:linkname nilinterhash
-//go:linkname noescape
//go:linkname procPin
//go:linkname procUnpin
//go:linkname sched
)
// iscgo is set to true by the runtime/cgo package
+//
+// iscgo should be an internal detail,
+// but widely used packages access it using linkname.
+// Notable members of the hall of shame include:
+// - github.com/ebitengine/purego
+//
+// Do not remove or change the type signature.
+// See go.dev/issue/67401.
+//
+//go:linkname iscgo
var iscgo bool
// set_crosscall2 is set by the runtime/cgo package
+// set_crosscall2 should be an internal detail,
+// but widely used packages access it using linkname.
+// Notable members of the hall of shame include:
+// - github.com/ebitengine/purego
+//
+// Do not remove or change the type signature.
+// See go.dev/issue/67401.
+//
+//go:linkname set_crosscall2
var set_crosscall2 func()
// cgoHasExtraM is set on startup when an extra M is created for cgo.
// platforms. Syscalls may have untyped arguments on the stack, so
// it's not safe to grow or scan the stack.
//
+// cgocall should be an internal detail,
+// but widely used packages access it using linkname.
+// Notable members of the hall of shame include:
+// - github.com/ebitengine/purego
+//
+// Do not remove or change the type signature.
+// See go.dev/issue/67401.
+//
+//go:linkname cgocall
//go:nosplit
func cgocall(fn, arg unsafe.Pointer) int32 {
if !iscgo && GOOS != "solaris" && GOOS != "illumos" && GOOS != "windows" {
return c
}
-var _cgo_setenv unsafe.Pointer // pointer to C function
+// _cgo_setenv should be an internal detail,
+// but widely used packages access it using linkname.
+// Notable members of the hall of shame include:
+// - github.com/ebitengine/purego
+//
+// Do not remove or change the type signature.
+// See go.dev/issue/67401.
+//
+//go:linkname _cgo_setenv
+var _cgo_setenv unsafe.Pointer // pointer to C function
+
+// _cgo_unsetenv should be an internal detail,
+// but widely used packages access it using linkname.
+// Notable members of the hall of shame include:
+// - github.com/ebitengine/purego
+//
+// Do not remove or change the type signature.
+// See go.dev/issue/67401.
+//
+//go:linkname _cgo_unsetenv
var _cgo_unsetenv unsafe.Pointer // pointer to C function
// Update the C environment if cgo is loaded.
//go:linkname goarm
// used by cgo
-//go:linkname cgocall
//go:linkname _cgo_panic_internal
//go:linkname cgoAlwaysFalse
//go:linkname cgoUse
// Notable members of the hall of shame include:
// - github.com/bytedance/sonic
// - github.com/ugorji/go/codec
+// - github.com/cockroachdb/pebble
//
// Do not remove or change the type signature.
// See go.dev/issue/67401.
// - github.com/bytedance/sonic
// - github.com/goccy/json
// - github.com/modern-go/reflect2
+// - github.com/segmentio/kafka-go
//
// Do not remove or change the type signature.
// See go.dev/issue/67401.
// but widely used packages access it using linkname.
// Notable members of the hall of shame include:
// - github.com/bytedance/sonic
+// - github.com/cockroachdb/pebble
// - github.com/dgraph-io/ristretto
//
// Do not remove or change the type signature.
// Do not remove or change the type signature.
// (See go.dev/issue/57336.)
//
+// getAuxv should be an internal detail,
+// but widely used packages access it using linkname.
+// Notable members of the hall of shame include:
+// - github.com/cilium/ebpf
+//
+// Do not remove or change the type signature.
+// See go.dev/issue/67401.
+//
//go:linkname getAuxv
func getAuxv() []uintptr { return auxv }
// Notable members of the hall of shame include:
// - github.com/goccy/json
// - github.com/modern-go/reflect2
+// - github.com/vmware/govmomi
//
// Do not remove or change the type signature.
// See go.dev/issue/67401.
// Notable members of the hall of shame include:
// - github.com/bytedance/sonic
// - github.com/ugorji/go/codec
+// - github.com/ebitengine/purego
//
// Do not remove or change the type signature.
// See go.dev/issue/67401.
// compiles down to zero instructions.
// USE CAREFULLY!
//
+// noescape should be an internal detail,
+// but widely used packages access it using linkname.
+// Notable members of the hall of shame include:
+// - github.com/ebitengine/purego
+//
+// Do not remove or change the type signature.
+// See go.dev/issue/67401.
+//
+//go:linkname noescape
//go:nosplit
func noescape(p unsafe.Pointer) unsafe.Pointer {
x := uintptr(p)
// Zero means not to use faketime.
var faketime int64
-// Many external packages linkname nanotime to get a fast monotonic time.
+// Exported via linkname for use by time and internal/poll.
+//
+// Many external packages also linkname nanotime for a fast monotonic time.
// Such code should be updated to use:
//
// var start = time.Now() // at init time