Skip to content

Commit 4de0a48

Browse files
committed
chore: add more neccessary linkname
1 parent 1cf62be commit 4de0a48

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/runtime/stubs.go

Lines changed: 10 additions & 0 deletions
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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ var firstmoduledata moduledata // linker symbol
491491
// See go.dev/issues/67401.
492492
// See go.dev/issues/71672.
493493
//
494-
//go:linkname lastmoduledatap runtime.lastmoduledatap
494+
//go:linkname lastmoduledatap
495495
var lastmoduledatap *moduledata // linker symbol
496496

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

603603
const debugPcln = false
604604

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
605615
func moduledataverify1(datap *moduledata) {
606616
// Check that the pclntab's format is valid.
607617
hdr := datap.pcHeader

0 commit comments

Comments
 (0)