1
0
mirror of https://github.com/golang/go synced 2024-11-17 14:04:48 -07:00

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 <cherryyz@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
Than McIntosh 2022-09-27 12:23:26 -04:00
parent f15b81a80f
commit bf5805eae4

View File

@ -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 {