]> Cypherpunks repositories - gostls13.git/commit
cmd/link: simplify PE relocations mapping
authorqmuntal <quimmuntal@gmail.com>
Tue, 13 May 2025 09:24:30 +0000 (11:24 +0200)
committerQuim Muntal <quimmuntal@gmail.com>
Wed, 17 Sep 2025 05:23:36 +0000 (22:23 -0700)
commit594deca981f0dd4a9351569e7c3e6999838148e3
tree80868fc507686bcc5cc8c4b10c0ccb950032437a
parent9df1a289ac64451042f6f14b7229ae5cd2217352
cmd/link: simplify PE relocations mapping

The code for mapping Windows PE relocations to Go relocations was
difficult to follow and contains some duplicated code. Also, it was
mapping IMAGE_REL_AMD64_ADDR32 to R_PCREL instead of R_ADDR.

This CL commit simplifies the code and fixes the mapping. I haven't been
able to coerce mingw-w64 to generate IMAGE_REL_AMD64_ADDR32 relocations,
so I haven't been able to test this change. However, the previous
implementation was clearly wrong.

While here, remove code supporting the unsupported windows/arm support.

Updates #71671
Updates #75485

Change-Id: Id0d6f352fa7d5df9e00509fcdf09ca0cb91ca524
Reviewed-on: https://go-review.googlesource.com/c/go/+/672155
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/link/internal/loadpe/ldpe.go