From 43cfd785e72ccd04fe638395aa80029aae23fef6 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 13 Nov 2025 13:01:14 -0800 Subject: cmd/link, runtime, debug/gosym: move pclntab magic to internal/abi Change-Id: I2d3c41b0e61b994d7b04bd16a791fd226dc45269 Reviewed-on: https://go-review.googlesource.com/c/go/+/720302 Reviewed-by: Michael Knyszek Reviewed-by: David Chase Reviewed-by: Cherry Mui LUCI-TryBot-Result: Go LUCI --- src/runtime/symtab.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/runtime') diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go index 3a814cd203..c1643c1b39 100644 --- a/src/runtime/symtab.go +++ b/src/runtime/symtab.go @@ -374,12 +374,12 @@ func (f *_func) funcInfo() funcInfo { // pcHeader holds data used by the pclntab lookups. type pcHeader struct { - magic uint32 // 0xFFFFFFF1 - pad1, pad2 uint8 // 0,0 - minLC uint8 // min instruction size - ptrSize uint8 // size of a ptr in bytes - nfunc int // number of functions in the module - nfiles uint // number of entries in the file tab + magic abi.PCLnTabMagic // abi.Go1NNPcLnTabMagic + pad1, pad2 uint8 // 0,0 + minLC uint8 // min instruction size + ptrSize uint8 // size of a ptr in bytes + nfunc int // number of functions in the module + nfiles uint // number of entries in the file tab // The next field used to be textStart. This is no longer stored // as it requires a relocation. Code should use the moduledata text @@ -623,7 +623,7 @@ const debugPcln = false func moduledataverify1(datap *moduledata) { // Check that the pclntab's format is valid. hdr := datap.pcHeader - if hdr.magic != 0xfffffff1 || hdr.pad1 != 0 || hdr.pad2 != 0 || + if hdr.magic != abi.CurrentPCLnTabMagic || hdr.pad1 != 0 || hdr.pad2 != 0 || hdr.minLC != sys.PCQuantum || hdr.ptrSize != goarch.PtrSize { println("runtime: pcHeader: magic=", hex(hdr.magic), "pad1=", hdr.pad1, "pad2=", hdr.pad2, "minLC=", hdr.minLC, "ptrSize=", hdr.ptrSize, "pluginpath=", datap.pluginpath) -- cgit v1.3-5-g9baa