]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: fix coverage counter issue on AIX
authorThan McIntosh <thanm@google.com>
Tue, 27 Sep 2022 16:23:26 +0000 (12:23 -0400)
committerThan McIntosh <thanm@google.com>
Tue, 27 Sep 2022 18:33:46 +0000 (18:33 +0000)
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>
src/cmd/link/internal/ld/xcoff.go

index 7b4d506a003926550b60cc8646659306453e5072..133858c76477fb9b3abe9263d75e7bdb8ec6aad6 100644 (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 {