diff options
| author | Ian Lance Taylor <iant@golang.org> | 2026-03-29 21:05:35 -0700 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2026-03-31 11:01:05 -0700 |
| commit | 9387929d09490ae30a8da75c64d9c64e2c16936d (patch) | |
| tree | 78b0a19354e994c31116454a0e2b770a02127744 /src/runtime | |
| parent | f665ff8bc1ab2576d173cb69c3b2e87916dc74fd (diff) | |
| download | go-9387929d09490ae30a8da75c64d9c64e2c16936d.tar.xz | |
cmd/link, runtime: record size of itabs
We were depending on runtime.etypes immediately following the itabs.
However, on AIX, runtime.etypes, as a zero-sized symbol, can float
when using external linking. It won't necessarily stay right at the
end of the itabs. Rather than worry about this, just record the size
of the itab data.
In practice it almost always works on AIX, but it fails the runtime
test TestSchedPauseMetrics/runtime/debug.WriteHeapDump,
which fails when iterating over all the itabs.
Tested on AIX. This should fix AIX on the build dashboard.
Change-Id: Id3a113b75b93fa8440c047e92f764ab81423df48
Reviewed-on: https://go-review.googlesource.com/c/go/+/760203
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/iface.go | 3 | ||||
| -rw-r--r-- | src/runtime/symtab.go | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/runtime/iface.go b/src/runtime/iface.go index 5e58db6108..009f104327 100644 --- a/src/runtime/iface.go +++ b/src/runtime/iface.go @@ -269,7 +269,8 @@ func itabsinit() { // This is an optimization to let us skip creating itabs we already have. func addModuleItabs(md *moduledata) { p := md.types + md.itaboffset - for p < md.etypes { + end := p + md.itabsize + for p < end { itab := (*itab)(unsafe.Pointer(p)) itabAdd(itab) p += uintptr(itab.Size()) diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go index f5e69c26ec..aa84a6f94e 100644 --- a/src/runtime/symtab.go +++ b/src/runtime/symtab.go @@ -420,7 +420,7 @@ type moduledata struct { covctrs, ecovctrs uintptr end, gcdata, gcbss uintptr types, typedesclen, etypes uintptr - itaboffset uintptr + itaboffset, itabsize uintptr rodata uintptr gofunc uintptr // go.func.* epclntab uintptr |
