1
0
mirror of https://github.com/golang/go synced 2024-11-13 13:11:07 -07:00

doc/next: document locking down linkname usages

For #65614.
Updates #67401.

Change-Id: Ib38c134ea7ffc69434c79600ba75185e02809d0f
Reviewed-on: https://go-review.googlesource.com/c/go/+/591898
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
Cherry Mui 2024-06-11 11:02:38 -04:00
parent 35d721b0cb
commit 816538d517

View File

@ -21,8 +21,17 @@ Hot block alignment can be disabled with `-gcflags=[<packages>=]-d=alignhot=0`
## Linker {#linker}
<!-- go.dev/issue/67401, CL 585556, CL 587220, and many more -->
TODO: Say what needs to be said in Go 1.23 release notes regarding
the locking down of future linkname uses.
The linker now disallows using a `//go:linkname` directive to refer to
internal symbols in the standard library (including the runtime) that
are not marked with `//go:linkname` on their definitions.
Similarly, the linker disallows references to such symbols from assembly
code.
For backward compatibility, existing usages of `//go:linkname` found in
a large open-source code corpus remain supported.
Any new references to standard library internal symbols will be disallowed.
A linker command line flag `-checklinkname=0` can be used to disable
this check, for debugging and experimenting purposes.
<!-- CL 473495 -->
When building a dynamically linked ELF binary (including PIE binary), the