]> Cypherpunks repositories - gostls13.git/commit
cmd/link: use >4GB base address for 64-bit PE binaries
authorqmuntal <quimmuntal@gmail.com>
Fri, 9 May 2025 15:42:48 +0000 (17:42 +0200)
committerQuim Muntal <quimmuntal@gmail.com>
Mon, 12 May 2025 18:05:28 +0000 (11:05 -0700)
commit176a2154aa185c6ab15d88f32d9c28dd3b5e5dd8
tree58c85ddd852e9ae604934cc37494d448ea73578f
parente513cd4e409f1d42df02a42b43eceb87473b229a
cmd/link: use >4GB base address for 64-bit PE binaries

Windows prefers 64-bit binaries to be loaded at an address above 4GB.

Having a preferred base address below this boundary triggers a
compatibility mode in Address Space Layout Randomization (ASLR) on
recent versions of Windows that reduces the number of locations to which
ASLR may relocate the binary.

The Go internal linker was using a smaller base address due to an issue
with how dynamic cgo symbols were relocated, which has been fixed in
this CL.

Fixes #73561.

Cq-Include-Trybots: luci.golang.try:gotip-windows-amd64-longtest
Change-Id: Ia8cb35d57d921d9be706a8975fa085af7996f124
Reviewed-on: https://go-review.googlesource.com/c/go/+/671515
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/pe.go
test/nilptr.go