From bf5805eae436a1ddbad593ec0671c9a7e8c67a9a Mon Sep 17 00:00:00 2001 From: Than McIntosh Date: Tue, 27 Sep 2022 12:23:26 -0400 Subject: [PATCH] cmd/link: fix coverage counter issue on AIX Update the linker's XCOFF writer to handle coverage counter sections properly; they need to be treated as bss, not data. Fixes a problem with the aix-ppc64 builder introduced in CL 401235), e.g. "runtime.covctrs: A symbol with type XTY_SD must be in a .text or .data section". Updates #51430. Change-Id: I3fc385a37e2549c46cc7cc3b4718af989a36752a Reviewed-on: https://go-review.googlesource.com/c/go/+/435335 Reviewed-by: Cherry Mui Run-TryBot: Than McIntosh Reviewed-by: David Chase --- src/cmd/link/internal/ld/xcoff.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/link/internal/ld/xcoff.go b/src/cmd/link/internal/ld/xcoff.go index 7b4d506a00..133858c764 100644 --- a/src/cmd/link/internal/ld/xcoff.go +++ b/src/cmd/link/internal/ld/xcoff.go @@ -1118,7 +1118,7 @@ func (f *xcoffFile) asmaixsym(ctxt *Link) { putaixsym(ctxt, s, TLSSym) } - case st == sym.SBSS, st == sym.SNOPTRBSS, st == sym.SLIBFUZZER_8BIT_COUNTER: + case st == sym.SBSS, st == sym.SNOPTRBSS, st == sym.SLIBFUZZER_8BIT_COUNTER, st == sym.SCOVERAGE_COUNTER: if ldr.AttrReachable(s) { data := ldr.Data(s) if len(data) > 0 {