From: Ian Lance Taylor Date: Thu, 29 Jan 2026 07:28:09 +0000 (-0800) Subject: cmd/link: adjust symkind comparisons in XCOFF code X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5593ea463498dce06a1b52dce2918912a9db6c4e;p=gostls13.git cmd/link: adjust symkind comparisons in XCOFF code This XCOFF symkind comparison broke when STYPE moved in CL 723580. These comparisons are unmaintainable, but at least the new code is no worse than the old code. Change-Id: I1be9de6afdf1814aaadcd2105e6247a4b66b46fe Reviewed-on: https://go-review.googlesource.com/c/go/+/740200 LUCI-TryBot-Result: Go LUCI Reviewed-by: Cherry Mui Reviewed-by: Dmitri Shuralyov Auto-Submit: Ian Lance Taylor --- diff --git a/src/cmd/link/internal/ld/xcoff.go b/src/cmd/link/internal/ld/xcoff.go index c07aac1612..8edd4ccad8 100644 --- a/src/cmd/link/internal/ld/xcoff.go +++ b/src/cmd/link/internal/ld/xcoff.go @@ -952,7 +952,7 @@ func putaixsym(ctxt *Link, x loader.Sym, t SymbolType) { Xscnlenhi: uint32(size >> 32), } - if ty := ldr.SymType(x); ty >= sym.STYPE && ty <= sym.SPCLNTAB { + if ty := ldr.SymType(x); ty >= sym.SSTRING && ty <= sym.STYPELINK { if ctxt.IsExternal() && strings.HasPrefix(ldr.SymSect(x).Name, ".data.rel.ro") { // During external linking, read-only datas with relocation // must be in .data.