]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/link: recognize ARM64 PE files and relocations
authorJason A. Donenfeld <Jason@zx2c4.com>
Wed, 3 Feb 2021 23:11:12 +0000 (00:11 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 26 Feb 2021 18:15:09 +0000 (18:15 +0000)
commitf41460145ef6b75303e5f766a676274f456387d3
treeca9d00a7e5fd387bf0b0a895cf21a04a41d01b11
parenta655208c9ecd2fee4de6deff35a863b1c28a091c
cmd/link: recognize ARM64 PE files and relocations

For now, this only add a single relocation type, which is sufficient for
Windows resources. Later we'll see if we need more for cgo.

In order to ensure these code paths are actually tested, this expands
the rsrc tests to include all the architectures of PE objects that we
need to be recognizing, and splits things more clearly between binutils
and llvm objects, which have a slightly different layout, so that we
test both.

This CL is part of a stack adding windows/arm64
support (#36439), intended to land in the Go 1.17 cycle.

Change-Id: Ia1ee840265e9d12c0b12dd1c5d0810f8b300e557
Reviewed-on: https://go-review.googlesource.com/c/go/+/289429
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/loadpe/ldpe.go
src/cmd/link/link_test.go
src/cmd/link/testdata/pe-binutils/main.go [moved from src/cmd/link/testdata/testPErsrc/main.go with 65% similarity]
src/cmd/link/testdata/pe-binutils/rsrc_386.syso [new file with mode: 0644]
src/cmd/link/testdata/pe-binutils/rsrc_amd64.syso [moved from src/cmd/link/testdata/testPErsrc/rsrc.syso with 100% similarity]
src/cmd/link/testdata/pe-llvm/main.go [moved from src/cmd/link/testdata/testPErsrc-complex/main.go with 92% similarity]
src/cmd/link/testdata/pe-llvm/rsrc_386.syso [new file with mode: 0644]
src/cmd/link/testdata/pe-llvm/rsrc_amd64.syso [moved from src/cmd/link/testdata/testPErsrc-complex/rsrc.syso with 81% similarity]
src/cmd/link/testdata/pe-llvm/rsrc_arm.syso [new file with mode: 0644]
src/cmd/link/testdata/pe-llvm/rsrc_arm64.syso [new file with mode: 0644]