aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/link/internal/ld/xcoff.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2025-12-01 16:25:56 -0800
committerGopher Robot <gobot@golang.org>2025-12-08 14:37:09 -0800
commit276cc4d3dbbf413be008113e6c88ffb3df2de4d6 (patch)
tree1ac431a28459e64b3766ff6e2326c2a11d27f3d2 /src/cmd/link/internal/ld/xcoff.go
parentf2d96272cb1b695dfddcd5b80dfed2ad2ee6db59 (diff)
downloadgo-276cc4d3dbbf413be008113e6c88ffb3df2de4d6.tar.xz
cmd/link: fix AIX builds after recent linker changes
This updates XCOFF-specific code for the recent addition of funcdata to pclntab. Because XCOFF puts separate symbols into separate csects, each with their own alignment, it's important to tell the external linker the expected alignment of each part of pclntab. Otherwise the offsets within pclntab may change as the external linker aligns symbols. This CL sets the correct alignment for each pclntab child symbol, and sets pclntab's alignment to the max of that of its children. Tested on the GCC compile farm. Fixes #76486 Change-Id: I77d8a90c4b4b79d80ca11ede8d9a2aa9cc89f53f Reviewed-on: https://go-review.googlesource.com/c/go/+/725603 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: David Chase <drchase@google.com>
Diffstat (limited to 'src/cmd/link/internal/ld/xcoff.go')
-rw-r--r--src/cmd/link/internal/ld/xcoff.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/cmd/link/internal/ld/xcoff.go b/src/cmd/link/internal/ld/xcoff.go
index 77ae1236c9..5f01eb2507 100644
--- a/src/cmd/link/internal/ld/xcoff.go
+++ b/src/cmd/link/internal/ld/xcoff.go
@@ -603,14 +603,20 @@ func xcoffUpdateOuterSize(ctxt *Link, size int64, stype sym.SymKind) {
outerSymSize["go:string.*"] = size
case sym.SGOFUNC:
if !ctxt.DynlinkingGo() {
- outerSymSize["go:func.*"] = size
+ outerSymSize["go:funcdesc"] = size
}
case sym.SGOFUNCRELRO:
- outerSymSize["go:funcrel.*"] = size
+ outerSymSize["go:funcdescrel"] = size
case sym.SGCBITS:
outerSymSize["runtime.gcbits.*"] = size
case sym.SPCLNTAB:
- outerSymSize["runtime.pclntab"] = size
+ // go:func.* size must be removed from pclntab,
+ // as it's a real symbol. Same for runtime.findfunctab.
+ fsize := ldr.SymSize(ldr.Lookup("go:func.*", 0))
+ fft := ldr.Lookup("runtime.findfunctab", 0)
+ fsize = Rnd(fsize, int64(symalign(ldr, fft)))
+ tsize := ldr.SymSize(fft)
+ outerSymSize["runtime.pclntab"] = size - (fsize + tsize)
}
}