]> Cypherpunks repositories - gostls13.git/commit
cmd/link: recognize arm header of PE objects
authorJason A. Donenfeld <Jason@zx2c4.com>
Sun, 8 Nov 2020 01:48:09 +0000 (02:48 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Mon, 14 Dec 2020 22:34:47 +0000 (22:34 +0000)
commit033390d9adb0e7a96d0558bb1702e270ef986c90
tree2b05ee5b1cff9dfc1665146dbe56b2fa98ac269b
parent48906a6d57fdc3c6fd2b6b9fe4c0e31dc225a058
cmd/link: recognize arm header of PE objects

The linker recognizes headers for 386 and amd64 PE objects, but not arm
objects. This is easily overlooked, since its the same as the 386 header
value, except the two nibbles of the first word are swapped. This commit
simply adds the check for this. Without it, .syso objects are rejected,
which means Windows binaries can't have resources built into them. At
the same time, we add comments to better indicate which condition
applies to which arch.

Change-Id: I210411d978504c1a9540e23abc5a180e24f159ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/268237
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Trust: Alex Brainman <alex.brainman@gmail.com>
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
src/cmd/link/internal/ld/lib.go