aboutsummaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2025-11-13 13:01:14 -0800
committerIan Lance Taylor <iant@golang.org>2025-11-26 20:06:46 -0800
commit43cfd785e72ccd04fe638395aa80029aae23fef6 (patch)
tree967647d8ec8190d977368b8a80be1faf0d92bb0f /src/internal
parent312b2034a4e16583fac00070e698c3d464eca1c8 (diff)
downloadgo-43cfd785e72ccd04fe638395aa80029aae23fef6.tar.xz
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 <mknyszek@google.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/abi/symtab.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/internal/abi/symtab.go b/src/internal/abi/symtab.go
index 86d6700388..10033e7277 100644
--- a/src/internal/abi/symtab.go
+++ b/src/internal/abi/symtab.go
@@ -4,6 +4,36 @@
package abi
+// PCLnTabMagic is the version at the start of the PC/line table.
+// This is the start of the .pclntab section, and is also runtime.pcHeader.
+// The magic numbers are chosen such that reading the value with
+// a different endianness does not result in the same value.
+// That lets us the magic number to determine the endianness.
+type PCLnTabMagic uint32
+
+const (
+ // Initial PCLnTabMagic value used in Go 1.2 through Go 1.15.
+ Go12PCLnTabMagic PCLnTabMagic = 0xfffffffb
+ // PCLnTabMagic value used in Go 1.16 through Go 1.17.
+ // Several fields added to header (CL 241598).
+ Go116PCLnTabMagic PCLnTabMagic = 0xfffffffa
+ // PCLnTabMagic value used in Go 1.18 through Go 1.19.
+ // Entry PC of func data changed from address to offset (CL 351463).
+ Go118PCLnTabMagic PCLnTabMagic = 0xfffffff0
+ // PCLnTabMagic value used in Go 1.20 and later.
+ // A ":" was added to generated symbol names (#37762).
+ Go120PCLnTabMagic PCLnTabMagic = 0xfffffff1
+
+ // CurrentPCLnTabMagic is the value emitted by the current toolchain.
+ // This is written by the linker to the pcHeader and read by the
+ // runtime and debug/gosym (and external tools like Delve).
+ //
+ // Change this value when updating the pclntab version.
+ // Changing this exported value is OK because is an
+ // internal package.
+ CurrentPCLnTabMagic = Go120PCLnTabMagic
+)
+
// A FuncFlag records bits about a function, passed to the runtime.
type FuncFlag uint8