Skip to content

Commit 279da96

Browse files
AsterDYgopherbot
authored andcommitted
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: 4de0a48 GitHub-Pull-Request: #71673 Reviewed-on: https://go-review.googlesource.com/c/go/+/648537 Reviewed-by: Michael Pratt <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent fcdf444 commit 279da96

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

src/runtime/stubs.go

+10
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,16 @@ func asmcgocall(fn, arg unsafe.Pointer) int32
312312

313313
func morestack()
314314

315+
// morestack_noctxt should be an internal detail,
316+
// but widely used packages access it using linkname.
317+
// Notable members of the hall of shame include:
318+
// - github.com/bytedance/sonic
319+
//
320+
// Do not remove or change the type signature.
321+
// See go.dev/issues/67401.
322+
// See go.dev/issues/71672.
323+
//
324+
//go:linkname morestack_noctxt
315325
func morestack_noctxt()
316326

317327
func rt0_go()

src/runtime/symtab.go

+22-1
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,18 @@ var pinnedTypemaps []map[typeOff]*_type
480480
// the relocated one.
481481
var aixStaticDataBase uintptr // linker symbol
482482

483-
var firstmoduledata moduledata // linker symbol
483+
var firstmoduledata moduledata // linker symbol
484+
485+
// lastmoduledatap should be an internal detail,
486+
// but widely used packages access it using linkname.
487+
// Notable members of the hall of shame include:
488+
// - github.com/bytedance/sonic
489+
//
490+
// Do not remove or change the type signature.
491+
// See go.dev/issues/67401.
492+
// See go.dev/issues/71672.
493+
//
494+
//go:linkname lastmoduledatap
484495
var lastmoduledatap *moduledata // linker symbol
485496

486497
var modulesSlice *[]*moduledata // see activeModules
@@ -591,6 +602,16 @@ func moduledataverify() {
591602

592603
const debugPcln = false
593604

605+
// moduledataverify1 should be an internal detail,
606+
// but widely used packages access it using linkname.
607+
// Notable members of the hall of shame include:
608+
// - github.com/bytedance/sonic
609+
//
610+
// Do not remove or change the type signature.
611+
// See go.dev/issues/67401.
612+
// See go.dev/issues/71672.
613+
//
614+
//go:linkname moduledataverify1
594615
func moduledataverify1(datap *moduledata) {
595616
// Check that the pclntab's format is valid.
596617
hdr := datap.pcHeader

0 commit comments

Comments
 (0)