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/syscall/syscall_linux_386.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/syscall/syscall_linux_386.go') diff --git a/src/syscall/syscall_linux_386.go b/src/syscall/syscall_linux_386.go index a90565a001..ba916dfcb8 100644 --- a/src/syscall/syscall_linux_386.go +++ b/src/syscall/syscall_linux_386.go @@ -74,6 +74,10 @@ func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int6 // Underlying system call writes to newoffset via pointer. // Implemented in assembly to avoid allocation. +// +// Accessed via assembly in x/sys/unix. +// +//go:linkname seek func seek(fd int, offset int64, whence int) (newoffset int64, err Errno) func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { @@ -121,7 +125,12 @@ const ( _SENDMMSG = 20 ) +// socketcall and rawsocketcall are accessed via assembly in x/sys/unix. +// +//go:linkname socketcall func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err Errno) + +//go:linkname rawsocketcall func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err Errno) func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { -- cgit v1.3-5-g9baa