]> Cypherpunks repositories - gostls13.git/commitdiff
debug/pe: use kernel32.dll in TestImportTableInUnknownSection
authorAlex Brainman <alex.brainman@gmail.com>
Sat, 24 Nov 2018 05:54:01 +0000 (16:54 +1100)
committerAlex Brainman <alex.brainman@gmail.com>
Sat, 24 Nov 2018 23:55:07 +0000 (23:55 +0000)
TestImportTableInUnknownSection was introduced in CL 110555 to
test PE executable with import table located in section other than
".idata". We used atmfd.dll for that purpose, but it seems
atmfd.dll is not present on some systems.

Use kernel32.dll instead. kernel32.dll import table is located in
".rdata" section, so it should do the job. And every Windows
system has kernel32.dll file.

Also make TestImportTableInUnknownSection run on windows-arm,
since windows-arm should also have kernel32.dll file.

Updates #27904

Change-Id: Ie005ee10e46ae0c06e83929d581e89f86c051eea
Reviewed-on: https://go-review.googlesource.com/c/151137
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/debug/pe/file_test.go

index 4f0510200fecb9d73de7f190c3e79cca08871480..79c2241eb7dd2b1b311470c322c81a5cd6ce2315 100644 (file)
@@ -602,13 +602,10 @@ func TestImportTableInUnknownSection(t *testing.T) {
        if runtime.GOOS != "windows" {
                t.Skip("skipping Windows-only test")
        }
-       if runtime.GOARCH == "arm" {
-               // Issue 27904
-               t.Skip("skipping test on arm; no atmfd.dll available")
-       }
 
-       // first we need to find this font driver
-       path, err := exec.LookPath("atmfd.dll")
+       // kernel32.dll import table is located in ".rdata" section,
+       // so it is good enough to test issue #16103.
+       path, err := exec.LookPath("kernel32.dll")
        if err != nil {
                t.Fatalf("unable to locate required file %q in search path: %s", "atmfd.dll", err)
        }