]> Cypherpunks repositories - gostls13.git/commitdiff
debug/pe: use correct pe64 test in ImportedSymbols
authorIan Lance Taylor <iant@golang.org>
Thu, 4 Aug 2022 19:05:15 +0000 (12:05 -0700)
committerGopher Robot <gobot@golang.org>
Mon, 8 Aug 2022 20:15:03 +0000 (20:15 +0000)
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>
src/debug/pe/file.go

index aa0955a1334e841200606aa549703832996e0c46..e8b1a4f5e2c09d2a5013598af5b075b2f20e9b0c 100644 (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