Commit 45f39fb4 authored by Michael Hudson-Doyle's avatar Michael Hudson-Doyle

cmd/link: pass -Wl,-z,relro to host linker in -buildmode=PIE

Fixes #15485

Change-Id: I8e9314be91db89873130b232b589a284822e6643
Reviewed-on: https://go-review.googlesource.com/22687
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent 5325fbc7
......@@ -1091,6 +1091,9 @@ func hostlink() {
argv = append(argv, "-Wl,-pagezero_size,4000000")
}
case BuildmodePIE:
if UseRelro() {
argv = append(argv, "-Wl,-z,relro")
}
argv = append(argv, "-pie")
case BuildmodeCShared:
if HEADTYPE == obj.Hdarwin {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment