]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: adjust symkind comparisons in XCOFF code
authorIan Lance Taylor <iant@golang.org>
Thu, 29 Jan 2026 07:28:09 +0000 (23:28 -0800)
committerGopher Robot <gobot@golang.org>
Thu, 29 Jan 2026 21:15:54 +0000 (13:15 -0800)
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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>

src/cmd/link/internal/ld/xcoff.go

index c07aac1612e41afa63e10c24b5e44a1b0d223e91..8edd4ccad880759295139f17e5e79d48509b49df 100644 (file)
@@ -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.