runtime: add some linknames back for github.com/bytedance/sonic

Add some linknames back, therefore sonic (github.com/bytedance/sonic) can work correctly.

Fixes #71672

Change-Id: Iae86c837d8a714855106a26766aa08b128e17e58
GitHub-Last-Rev: 4de0a48717
GitHub-Pull-Request: golang/go#71673
Reviewed-on: https://go-review.googlesource.com/c/go/+/648537
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
段仪 2025-02-18 18:01:45 +00:00 committed by Gopher Robot
parent fcdf444924
commit 279da96532
2 changed files with 32 additions and 1 deletions

View file

@ -312,6 +312,16 @@ func asmcgocall(fn, arg unsafe.Pointer) int32
func morestack()
// morestack_noctxt should be an internal detail,
// but widely used packages access it using linkname.
// Notable members of the hall of shame include:
// - github.com/bytedance/sonic
//
// Do not remove or change the type signature.
// See go.dev/issues/67401.
// See go.dev/issues/71672.
//
//go:linkname morestack_noctxt
func morestack_noctxt()
func rt0_go()

View file

@ -480,7 +480,18 @@ var pinnedTypemaps []map[typeOff]*_type
// the relocated one.
var aixStaticDataBase uintptr // linker symbol
var firstmoduledata moduledata // linker symbol
var firstmoduledata moduledata // linker symbol
// lastmoduledatap should be an internal detail,
// but widely used packages access it using linkname.
// Notable members of the hall of shame include:
// - github.com/bytedance/sonic
//
// Do not remove or change the type signature.
// See go.dev/issues/67401.
// See go.dev/issues/71672.
//
//go:linkname lastmoduledatap
var lastmoduledatap *moduledata // linker symbol
var modulesSlice *[]*moduledata // see activeModules
@ -591,6 +602,16 @@ func moduledataverify() {
const debugPcln = false
// moduledataverify1 should be an internal detail,
// but widely used packages access it using linkname.
// Notable members of the hall of shame include:
// - github.com/bytedance/sonic
//
// Do not remove or change the type signature.
// See go.dev/issues/67401.
// See go.dev/issues/71672.
//
//go:linkname moduledataverify1
func moduledataverify1(datap *moduledata) {
// Check that the pclntab's format is valid.
hdr := datap.pcHeader