From f5f14262d0c0aae7d104ce22d05862276d16a002 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 28 Oct 2025 13:35:53 -0700 Subject: [PATCH] cmd/link: remove misleading comment The comment suggests that the text section is briefly writable. That is not the case. As the earlier part of the comment explains, part of the text section is mapped twice, once r-x and once rw-. It is never the case that there is writable executable memory. Change-Id: I56841e19a8a08f2515f29752536a5c8f180ac8c9 Reviewed-on: https://go-review.googlesource.com/c/go/+/715622 Auto-Submit: Ian Lance Taylor Reviewed-by: Cherry Mui Reviewed-by: Than McIntosh Reviewed-by: Michael Pratt LUCI-TryBot-Result: Go LUCI --- src/cmd/link/internal/ld/data.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go index b70d050c99..a8e56bdd5a 100644 --- a/src/cmd/link/internal/ld/data.go +++ b/src/cmd/link/internal/ld/data.go @@ -2852,9 +2852,6 @@ func (ctxt *Link) address() []*sym.Segment { // will be such that the last page of the text segment will be // mapped twice, once r-x and once starting out rw- and, after // relocation processing, changed to r--. - // - // Ideally the last page of the text segment would not be - // writable even for this short period. va = uint64(Rnd(int64(va), *FlagRound)) order = append(order, &Segrodata) -- 2.52.0