Skip to content

Commit

Permalink
cmd/go: recognize DLL magic from llvm binaries
Browse files Browse the repository at this point in the history
When using LLD with c-shared, the magic in the output DLL is slightly
different than for EXEs.

Change-Id: Icc5f34f7bb61f11a9d75494236b7797cc1988b40
Reviewed-on: https://go-review.googlesource.com/c/go/+/291638
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>
  • Loading branch information
zx2c4 committed Feb 23, 2021
1 parent bf5fa2d commit f1562c7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/cmd/go/internal/work/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -1841,6 +1841,7 @@ var objectMagic = [][]byte{
{0xCE, 0xFA, 0xED, 0xFE}, // Mach-O little-endian 32-bit
{0xCF, 0xFA, 0xED, 0xFE}, // Mach-O little-endian 64-bit
{0x4d, 0x5a, 0x90, 0x00, 0x03, 0x00}, // PE (Windows) as generated by 6l/8l and gcc
{0x4d, 0x5a, 0x78, 0x00, 0x01, 0x00}, // PE (Windows) as generated by llvm for dll
{0x00, 0x00, 0x01, 0xEB}, // Plan 9 i386
{0x00, 0x00, 0x8a, 0x97}, // Plan 9 amd64
{0x00, 0x00, 0x06, 0x47}, // Plan 9 arm
Expand Down

0 comments on commit f1562c7

Please sign in to comment.