mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/link: disallow linkname of runtime.addmoduledata
Although a comment on addmoduledata warns that it should not be called from Go code, the linker still allow it to be accessed via go:linkname. Using linkname on this function will cause a linker crash when building with buildmode=plugin. Fixes #75180 Change-Id: Ib72c367a8afaef712ca5e29b1d0a4fc98ed8f40f Reviewed-on: https://go-review.googlesource.com/c/go/+/699655 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
89d41d254a
commit
9f6936b8da
3 changed files with 20 additions and 0 deletions
|
|
@ -2440,6 +2440,7 @@ var blockedLinknames = map[string][]string{
|
|||
// Others
|
||||
"net.newWindowsFile": {"net"}, // pushed from os
|
||||
"testing/synctest.testingSynctestTest": {"testing/synctest"}, // pushed from testing
|
||||
"runtime.addmoduledata": {}, // disallow all package
|
||||
}
|
||||
|
||||
// check if a linkname reference to symbol s from pkg is allowed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue