diff --git a/tools/defcheck.py b/tools/defcheck.py index e6d79a50d7..58ba946e49 100755 --- a/tools/defcheck.py +++ b/tools/defcheck.py @@ -29,7 +29,7 @@ Needs the tool "nm", "objdump" or "dumpbin" to work """ -import os, sys, subprocess, shutil +import os, sys, subprocess, shutil, glob from os import getenv, path @@ -72,6 +72,9 @@ for df in def_files: basename, extension = name.split (".") libname = path.join(os.getcwd(), directory, libprefix + basename + "-*" + libextension) + matches = glob.glob(libname) + if matches: + libname = matches[0] #FIXME: This leaks to ninja stdout, which should not happen #print ("platform: " + sys.platform + " - extracting symbols from " + libname) @@ -119,10 +122,13 @@ for df in def_files: found = False nmsymbols = "" for s in objnm: - if s == " Ordinal RVA Name": + if "Ordinal Hint Name" in s or " Ordinal RVA Name" in s: found = True elif found: - nmsymbols += s + s = s.strip() + if not s: + break + nmsymbols += " 0 0 " + s.split()[-1] # Keep the [2::3] logic happy # else: skip this line else: # Windows MSVC