Commit 93fcebaf authored by Cherry Zhang's avatar Cherry Zhang
Browse files

cmd/link: avoid writing to read-only memory in addstrdata

When the linker's -X flag is used, it will overwrite the symbol's
content (sym.P) in addstrdata. The symbol's content may be in
read-only memory, in which case overwriting it will fault. Do
copy-on-write to fix this.

Change-Id: I34d583f44c30d187042757e19a14c1ef7d3e613c
Reviewed-on: https://go-review.googlesource.com/c/go/+/173937


Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: default avatarThan McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 41d1bf0e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment