Ian Lance Taylor would like Cherry Mui and Keith Randall to review this change.
cmd/link: set the size of runtime.gcmask.* on AIX
Without this AIX does not set aside space for the gcmask variables.
This parallels the handling of runtime.gcbits.*, for which the call
to xcoffUpdateOuterSize happens in the loop over sym.ReadOnly in
allocateDataSections.
Tested on an AIX system on the GCC compile farm.
Fixes #78540
diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go
index 773efb4..9424277 100644
--- a/src/cmd/link/internal/ld/data.go
+++ b/src/cmd/link/internal/ld/data.go
@@ -2049,6 +2049,9 @@
ldr.SetSymValue(gcmaskSym, int64(sect.Length))
ldr.SetSymSect(gcmaskSym, sect)
state.assignToSection(sect, sym.SGCMASK, sym.SNOPTRBSS)
+ if ctxt.HeadType == objabi.Haix {
+ xcoffUpdateOuterSize(ctxt, int64(sect.Length)-ldr.SymValue(gcmaskSym), sym.SGCMASK)
+ }
// Code coverage counters are assigned to the .noptrbss section.
// We assign them in a separate pass so that they stay aggregated
diff --git a/src/cmd/link/internal/ld/xcoff.go b/src/cmd/link/internal/ld/xcoff.go
index 38a72d9..d45074c 100644
--- a/src/cmd/link/internal/ld/xcoff.go
+++ b/src/cmd/link/internal/ld/xcoff.go
@@ -605,6 +605,8 @@
fsize = Rnd(fsize, int64(symalign(ldr, fft)))
tsize := ldr.SymSize(fft)
outerSymSize["runtime.pclntab"] = size - (fsize + tsize)
+ case sym.SGCMASK:
+ outerSymSize["runtime.gcmask.*"] = size
}
}
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |