cmd/link: block new standard library linknames

In Go 1.24 we added a number of new linknames for standard library
internal uses. Add them to the linker's blocklist to keep them
internal.

Change-Id: Ibb7fa095506c161604e978ae196a7cf248475b2e
Reviewed-on: https://go-review.googlesource.com/c/go/+/635676
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
This commit is contained in:
Cherry Mui 2024-12-12 13:03:49 -05:00
parent 9118060040
commit fb764cdad0

View file

@ -2338,6 +2338,45 @@ var blockedLinknames = map[string][]string{
"runtime.newcoro": {"iter"}, "runtime.newcoro": {"iter"},
// fips info // fips info
"go:fipsinfo": {"crypto/internal/fips140/check"}, "go:fipsinfo": {"crypto/internal/fips140/check"},
// New internal linknames in Go 1.24
// Pushed from runtime
"crypto/internal/fips140.fatal": {"crypto/internal/fips140"},
"crypto/internal/fips140.getIndicator": {"crypto/internal/fips140"},
"crypto/internal/fips140.setIndicator": {"crypto/internal/fips140"},
"crypto/internal/sysrand.fatal": {"crypto/internal/sysrand"},
"crypto/rand.fatal": {"crypto/rand"},
"internal/runtime/maps.errNilAssign": {"internal/runtime/maps"},
"internal/runtime/maps.fatal": {"internal/runtime/maps"},
"internal/runtime/maps.mapKeyError": {"internal/runtime/maps"},
"internal/runtime/maps.newarray": {"internal/runtime/maps"},
"internal/runtime/maps.newobject": {"internal/runtime/maps"},
"internal/runtime/maps.typedmemclr": {"internal/runtime/maps"},
"internal/runtime/maps.typedmemmove": {"internal/runtime/maps"},
"internal/sync.fatal": {"internal/sync"},
"internal/sync.runtime_canSpin": {"internal/sync"},
"internal/sync.runtime_doSpin": {"internal/sync"},
"internal/sync.runtime_nanotime": {"internal/sync"},
"internal/sync.runtime_Semrelease": {"internal/sync"},
"internal/sync.runtime_SemacquireMutex": {"internal/sync"},
"internal/sync.throw": {"internal/sync"},
"internal/synctest.Run": {"internal/synctest"},
"internal/synctest.Wait": {"internal/synctest"},
"internal/synctest.acquire": {"internal/synctest"},
"internal/synctest.release": {"internal/synctest"},
"internal/synctest.inBubble": {"internal/synctest"},
"runtime.getStaticuint64s": {"reflect"},
"sync.runtime_SemacquireWaitGroup": {"sync"},
"time.runtimeNow": {"time"},
"time.runtimeNano": {"time"},
// Pushed to runtime from internal/runtime/maps
// (other map functions are already linknamed in Go 1.23)
"runtime.mapaccess1": {"runtime"},
"runtime.mapaccess1_fast32": {"runtime"},
"runtime.mapaccess1_fast64": {"runtime"},
"runtime.mapaccess1_faststr": {"runtime"},
"runtime.mapdelete_fast32": {"runtime"},
"runtime.mapdelete_fast64": {"runtime"},
"runtime.mapdelete_faststr": {"runtime"},
} }
// check if a linkname reference to symbol s from pkg is allowed // check if a linkname reference to symbol s from pkg is allowed