From: 段仪 Date: Sun, 16 Feb 2025 15:54:37 +0000 (+0000) Subject: [release-branch.go1.24] runtime: add some linknames back for `github.com/bytedance... X-Git-Tag: go1.24.1~20 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=cd0e528d3d97ad88d52107eb908c66e9fcda0396;p=gostls13.git [release-branch.go1.24] runtime: add some linknames back for `github.com/bytedance/sonic` Add some linknames back, therefore sonic (github.com/bytedance/sonic) can work correctly. For #71672 Fixes #71705 Change-Id: Iae86c837d8a714855106a26766aa08b128e17e58 GitHub-Last-Rev: 4de0a4871766f9e7763394fdcdcaa9d683e97987 GitHub-Pull-Request: golang/go#71673 Reviewed-on: https://go-review.googlesource.com/c/go/+/650375 Auto-Submit: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Pratt --- diff --git a/src/runtime/stubs.go b/src/runtime/stubs.go index 55153a2038..ecf97666d7 100644 --- a/src/runtime/stubs.go +++ b/src/runtime/stubs.go @@ -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() diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go index c3bd510320..8c6ef2b4fc 100644 --- a/src/runtime/symtab.go +++ b/src/runtime/symtab.go @@ -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