]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/link/internal/ld: revise recipe for ASLR enable on windows
authorThan McIntosh <thanm@google.com>
Tue, 8 Feb 2022 17:41:26 +0000 (12:41 -0500)
committerThan McIntosh <thanm@google.com>
Thu, 31 Mar 2022 19:40:29 +0000 (19:40 +0000)
commitcc3a3519af5b8b4cf26bf27133675776fdfcaeb9
tree3bda2131723d6fe2faad0e6e767376d3fcbd1006
parentf7670b9f9471d0d40666c28faaaa67851eb8ec2e
cmd/link/internal/ld: revise recipe for ASLR enable on windows

When doing external linking on windows, the existing Go linker code
assumed that the external linker defaulted to "--no-dynamicbase" (if
no explicit option was given). This assumption doesn't hold for LLD,
which turns on "--dynamicbase" by default for 64-bit apps. Change the
linker to detect whether a more modern toolchain is in use and to
explicitly pass "--dynamicbase" either way , so as to take the
external linker default out of the equation. This also applies to the
"--high-entropy-va" option as well.

Updates #35006.

Change-Id: I3e12cf6d331c9d003e3d2bd566d45de5710588b9
Reviewed-on: https://go-review.googlesource.com/c/go/+/384156
Reviewed-by: Cherry Mui <cherryyz@google.com>
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/link/internal/ld/lib.go