]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/link: stop setting ReadOnly attribute in late stage
authorCherry Zhang <cherryyz@google.com>
Sat, 25 Apr 2020 00:22:39 +0000 (20:22 -0400)
committerCherry Zhang <cherryyz@google.com>
Mon, 27 Apr 2020 15:34:51 +0000 (15:34 +0000)
commit2a874562bf7e1831bca5bb2c89dd1a9d0beac6d2
tree8e55c3e4729d30bf4e41af10b73b9220793071f4
parent51ac260e5a92c75fc8fbdaa0e13958b26361b1a5
[dev.link] cmd/link: stop setting ReadOnly attribute in late stage

The ReadOnly attribute was used to do copy on write when applying
relocations to symbols with read-only backing stores. Now that we
always apply relocations in the output buffer (mmap or heap), it
is always writeable. No need to tamper with the ReadOnly
attribute anymore.

Wasm is an exception, where we don't copy symbol contents to the
output buffer first. Do copy-on-write there.

This is in preparation of converting reloc to using the loader.

Change-Id: I15e53b7c162b9124e6689dfd8eb45cbe2ffd7153
Reviewed-on: https://go-review.googlesource.com/c/go/+/229991
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/outbuf.go