From 8255e115f325a58fd4746741f9f35c2f54d70d63 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 8 Nov 2020 11:11:27 +0100 Subject: [PATCH 04/11] cmd/link: do not mark resource section as writable Resources are immutable, and all other linkers set this section to be read-only and not read-write. Fix this oversight by rmoving the writable flag. Change-Id: Ib441bde6620be2000f1685df1ea7bfaebdbe7860 --- src/cmd/link/internal/ld/pe.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/link/internal/ld/pe.go b/src/cmd/link/internal/ld/pe.go index c9cb25dbe5..ec5b6d5f52 100644 --- a/src/cmd/link/internal/ld/pe.go +++ b/src/cmd/link/internal/ld/pe.go @@ -1482,7 +1482,7 @@ func addpersrc(ctxt *Link) { data := rsrc.P size := len(data) h := pefile.addSection(".rsrc", size, size) - h.characteristics = IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_WRITE | IMAGE_SCN_CNT_INITIALIZED_DATA + h.characteristics = IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA h.checkOffset(ctxt.Out.Offset()) // relocation -- 2.29.2