go/src/cmd/link
qmuntal f57f02fcd5 cmd/link,cmd/internal/objabi: support ADDR32NB relocations on windows
This CL updates the linker to support
IMAGE_REL_[I386|AMD64|ARM|ARM64]_ADDR32NB relocations via the new
R_PEIMAGEOFF relocation type. This relocation type references symbols
using RVAs instead of VA, so it can use 4-byte offsets to reference
symbols that would normally require 8-byte offsets.

This new relocation is still not used, but will be useful when
generating Structured Exception Handling (SEH) metadata, which
needs to reference functions only using 4-byte addresses, thus
using RVAs instead of VA is of great help.

Updates #57302

Change-Id: I28d73e97d5cb78a3bc7194dc7d2fcb4a03f9f4d0
Reviewed-on: https://go-review.googlesource.com/c/go/+/461737
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: Davis Goodin <dagood@microsoft.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-03-29 05:01:03 +00:00
..
internal cmd/link,cmd/internal/objabi: support ADDR32NB relocations on windows 2023-03-29 05:01:03 +00:00
testdata
cgo_test.go cmd/link: use only the configured C compiler in TestCGOLTO 2023-03-09 22:13:02 +00:00
doc.go cmd/link: update -T flag's documentation 2023-03-01 18:12:05 +00:00
dwarf_test.go cmd/link: skip c-archive tests if c-archive mode is not supported 2023-01-31 16:53:11 +00:00
elf_test.go all: skip tests that fail on android/arm64 2023-03-10 20:38:29 +00:00
link_test.go all: skip tests that fail on android/arm64 2023-03-10 20:38:29 +00:00
linkbig_test.go cmd/link: use testenv.Command instead of exec.Command in tests 2022-11-15 20:22:14 +00:00
main.go cmd/link: support linker for linux/loong64 2022-05-17 17:54:33 +00:00