From f1562c761014111ce359b14016718ddabd24c2f2 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 15 Feb 2021 20:20:15 +0100 Subject: [PATCH] cmd/go: recognize DLL magic from llvm binaries 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 Run-TryBot: Jason A. Donenfeld TryBot-Result: Go Bot Reviewed-by: Than McIntosh --- src/cmd/go/internal/work/exec.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go index 422e83c224f..d957fa1fcdc 100644 --- a/src/cmd/go/internal/work/exec.go +++ b/src/cmd/go/internal/work/exec.go @@ -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