]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/link,cmd/internal/objabi: support ADDR32NB relocations on windows
authorqmuntal <quimmuntal@gmail.com>
Thu, 12 Jan 2023 10:19:12 +0000 (11:19 +0100)
committerQuim Muntal <quimmuntal@gmail.com>
Wed, 29 Mar 2023 05:01:03 +0000 (05:01 +0000)
commitf57f02fcd519a86683c47a444e0e24a086fea8e0
treeeacb59fc0f7c9ae5546f073b2e2903639cc15359
parent541ef422e24c8010f95151f241224fa16cdce210
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>
src/cmd/internal/objabi/reloctype.go
src/cmd/internal/objabi/reloctype_string.go
src/cmd/link/internal/amd64/asm.go
src/cmd/link/internal/arm/asm.go
src/cmd/link/internal/arm64/asm.go
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/pe.go
src/cmd/link/internal/loader/loader_test.go
src/cmd/link/internal/loader/symbolbuilder.go
src/cmd/link/internal/x86/asm.go