diff options
| author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-02-04 00:11:12 +0100 |
|---|---|---|
| committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-02-26 18:15:09 +0000 |
| commit | f41460145ef6b75303e5f766a676274f456387d3 (patch) | |
| tree | ca9d00a7e5fd387bf0b0a895cf21a04a41d01b11 /src/cmd/link/testdata | |
| parent | a655208c9ecd2fee4de6deff35a863b1c28a091c (diff) | |
| download | go-f41460145ef6b75303e5f766a676274f456387d3.tar.xz | |
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>
Diffstat (limited to 'src/cmd/link/testdata')
| -rw-r--r-- | src/cmd/link/testdata/pe-binutils/main.go (renamed from src/cmd/link/testdata/testPErsrc/main.go) | 7 | ||||
| -rw-r--r-- | src/cmd/link/testdata/pe-binutils/rsrc_386.syso | bin | 0 -> 228 bytes | |||
| -rw-r--r-- | src/cmd/link/testdata/pe-binutils/rsrc_amd64.syso (renamed from src/cmd/link/testdata/testPErsrc/rsrc.syso) | bin | 228 -> 228 bytes | |||
| -rw-r--r-- | src/cmd/link/testdata/pe-llvm/main.go (renamed from src/cmd/link/testdata/testPErsrc-complex/main.go) | 4 | ||||
| -rw-r--r-- | src/cmd/link/testdata/pe-llvm/rsrc_386.syso | bin | 0 -> 352 bytes | |||
| -rw-r--r-- | src/cmd/link/testdata/pe-llvm/rsrc_amd64.syso (renamed from src/cmd/link/testdata/testPErsrc-complex/rsrc.syso) | bin | 352 -> 352 bytes | |||
| -rw-r--r-- | src/cmd/link/testdata/pe-llvm/rsrc_arm.syso | bin | 0 -> 352 bytes | |||
| -rw-r--r-- | src/cmd/link/testdata/pe-llvm/rsrc_arm64.syso | bin | 0 -> 352 bytes |
8 files changed, 5 insertions, 6 deletions
diff --git a/src/cmd/link/testdata/testPErsrc/main.go b/src/cmd/link/testdata/pe-binutils/main.go index 5eb66fb9cc..14ea6f9e0f 100644 --- a/src/cmd/link/testdata/testPErsrc/main.go +++ b/src/cmd/link/testdata/pe-binutils/main.go @@ -4,10 +4,9 @@ // Test that a PE rsrc section is handled correctly (issue 39658). // -// rsrc.syso is created with: -// windres -i a.rc -o rsrc.syso -O coff -// on windows-amd64-2016 builder, where a.rc is a text file with -// the following content: +// rsrc.syso is created using binutils with: +// {x86_64,i686}-w64-mingw32-windres -i a.rc -o rsrc_$GOARCH.syso -O coff +// where a.rc is a text file with the following content: // // resname RCDATA { // "Hello Gophers!\0", diff --git a/src/cmd/link/testdata/pe-binutils/rsrc_386.syso b/src/cmd/link/testdata/pe-binutils/rsrc_386.syso Binary files differnew file mode 100644 index 0000000000..b4abc58abe --- /dev/null +++ b/src/cmd/link/testdata/pe-binutils/rsrc_386.syso diff --git a/src/cmd/link/testdata/testPErsrc/rsrc.syso b/src/cmd/link/testdata/pe-binutils/rsrc_amd64.syso Binary files differindex 0d9699da04..0d9699da04 100644 --- a/src/cmd/link/testdata/testPErsrc/rsrc.syso +++ b/src/cmd/link/testdata/pe-binutils/rsrc_amd64.syso diff --git a/src/cmd/link/testdata/testPErsrc-complex/main.go b/src/cmd/link/testdata/pe-llvm/main.go index affd6eada2..099a71a3ff 100644 --- a/src/cmd/link/testdata/testPErsrc-complex/main.go +++ b/src/cmd/link/testdata/pe-llvm/main.go @@ -6,8 +6,8 @@ // have been created by llvm-rc or msvc's rc.exe, which means there's the // @feat.00 symbol as well as split .rsrc$00 and .rsrc$01 section to deal with. // -// rsrc.syso is created with: -// windres -i a.rc -o rsrc.syso -O coff +// rsrc.syso is created using llvm with: +// {i686,x86_64,armv7,arm64}-w64-mingw32-windres -i a.rc -o rsrc_$GOARCH.syso -O coff // where this windres calls into llvm-rc and llvm-cvtres. The source file, // a.rc, simply contains a reference to its own bytes: // diff --git a/src/cmd/link/testdata/pe-llvm/rsrc_386.syso b/src/cmd/link/testdata/pe-llvm/rsrc_386.syso Binary files differnew file mode 100644 index 0000000000..21126c9954 --- /dev/null +++ b/src/cmd/link/testdata/pe-llvm/rsrc_386.syso diff --git a/src/cmd/link/testdata/testPErsrc-complex/rsrc.syso b/src/cmd/link/testdata/pe-llvm/rsrc_amd64.syso Binary files differindex eff630b8a2..56f9260b0a 100644 --- a/src/cmd/link/testdata/testPErsrc-complex/rsrc.syso +++ b/src/cmd/link/testdata/pe-llvm/rsrc_amd64.syso diff --git a/src/cmd/link/testdata/pe-llvm/rsrc_arm.syso b/src/cmd/link/testdata/pe-llvm/rsrc_arm.syso Binary files differnew file mode 100644 index 0000000000..c93a1e9ba0 --- /dev/null +++ b/src/cmd/link/testdata/pe-llvm/rsrc_arm.syso diff --git a/src/cmd/link/testdata/pe-llvm/rsrc_arm64.syso b/src/cmd/link/testdata/pe-llvm/rsrc_arm64.syso Binary files differnew file mode 100644 index 0000000000..7849638ddd --- /dev/null +++ b/src/cmd/link/testdata/pe-llvm/rsrc_arm64.syso |
