tools: Support GNU objdump (from MSYS2) on defcheck.py
This commit is contained in:
parent
a03ccc91da
commit
6ec98fac00
1 changed files with 9 additions and 3 deletions
|
|
@ -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
|
from os import getenv, path
|
||||||
|
|
||||||
|
|
@ -72,6 +72,9 @@ for df in def_files:
|
||||||
basename, extension = name.split (".")
|
basename, extension = name.split (".")
|
||||||
|
|
||||||
libname = path.join(os.getcwd(), directory, libprefix + basename + "-*" + libextension)
|
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
|
#FIXME: This leaks to ninja stdout, which should not happen
|
||||||
#print ("platform: " + sys.platform + " - extracting symbols from " + libname)
|
#print ("platform: " + sys.platform + " - extracting symbols from " + libname)
|
||||||
|
|
||||||
|
|
@ -119,10 +122,13 @@ for df in def_files:
|
||||||
found = False
|
found = False
|
||||||
nmsymbols = ""
|
nmsymbols = ""
|
||||||
for s in objnm:
|
for s in objnm:
|
||||||
if s == " Ordinal RVA Name":
|
if "Ordinal Hint Name" in s or " Ordinal RVA Name" in s:
|
||||||
found = True
|
found = True
|
||||||
elif found:
|
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: skip this line
|
||||||
|
|
||||||
else: # Windows MSVC
|
else: # Windows MSVC
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue