From 1cf62bea67d1a2f8ee347bf8004650228ac39964 Mon Sep 17 00:00:00 2001 From: joyboyaster Date: Wed, 12 Feb 2025 11:17:00 +0800 Subject: [PATCH] runtime: add linkname back on --- src/runtime/symtab.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go index c3bd5103205cf6..cd60efe4bcb3bc 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 runtime.lastmoduledatap var lastmoduledatap *moduledata // linker symbol var modulesSlice *[]*moduledata // see activeModules