1
0
mirror of https://github.com/golang/go synced 2024-11-17 06:54:48 -07:00

debug/pe: use correct pe64 test in ImportedSymbols

64-bit PE is set by the optional header magic number,
not by the machine field.

Fixes #54250

Change-Id: I4d01bc08553780d5470e63f0b17bbd968323e5d1
Reviewed-on: https://go-review.googlesource.com/c/go/+/421394
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
This commit is contained in:
Ian Lance Taylor 2022-08-04 12:05:15 -07:00 committed by Gopher Robot
parent a34a97d88d
commit d6ccb4ead9

View File

@ -322,7 +322,7 @@ func (f *File) ImportedSymbols() ([]string, error) {
return nil, nil
}
pe64 := f.Machine == IMAGE_FILE_MACHINE_AMD64 || f.Machine == IMAGE_FILE_MACHINE_ARM64
_, pe64 := f.OptionalHeader.(*OptionalHeader64)
// grab the number of data directory entries
var dd_length uint32