diff --git a/src/cmd/link/internal/ld/xcoff.go b/src/cmd/link/internal/ld/xcoff.go index fe35578225a..8814bad4ae8 100644 --- a/src/cmd/link/internal/ld/xcoff.go +++ b/src/cmd/link/internal/ld/xcoff.go @@ -578,13 +578,14 @@ func xcoffUpdateOuterSize(ctxt *Link, size int64, stype sym.SymKind) { // Nothing to do case sym.STYPERELRO: if ctxt.UseRelro() && (ctxt.BuildMode == BuildModeCArchive || ctxt.BuildMode == BuildModeCShared || ctxt.BuildMode == BuildModePIE) { - outerSymSize["typerel.*"] = size + // runtime.types size must be removed, as it's a real symbol. + outerSymSize["typerel.*"] = size - ctxt.Syms.ROLookup("runtime.types", 0).Size return } fallthrough case sym.STYPE: if !ctxt.DynlinkingGo() { - // runtime.types size must be removed. + // runtime.types size must be removed, as it's a real symbol. outerSymSize["type.*"] = size - ctxt.Syms.ROLookup("runtime.types", 0).Size } case sym.SGOSTRING: