]> Cypherpunks repositories - gostls13.git/commitdiff
doc/next: document locking down linkname usages
authorCherry Mui <cherryyz@google.com>
Tue, 11 Jun 2024 15:02:38 +0000 (11:02 -0400)
committerCherry Mui <cherryyz@google.com>
Tue, 11 Jun 2024 17:18:10 +0000 (17:18 +0000)
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>
doc/next/5-toolchain.md

index b1533ad8ac975e2cc81ce9480b1cce0fb2c32f41..51a1dbfbdf3f8f340208181309dc4ec3bec00067 100644 (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