File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 99
1010import argparse
1111import os
12+ import platform
1213import shutil
1314import subprocess
1415import sys
1920parser .add_argument ("objfile" , help = "Object file to extract symbol values from" )
2021parser .add_argument ("output" )
2122parser .add_argument ("prefix" , nargs = "?" , default = "FDATA" , help = "Custom FDATA prefix" )
22- parser .add_argument ("--nmtool" , default = "nm" , help = "Path to nm tool" )
23+ parser .add_argument (
24+ "--nmtool" ,
25+ default = "llvm-nm" if platform .system () == "Windows" else "nm" ,
26+ help = "Path to nm tool" ,
27+ )
2328parser .add_argument ("--no-lbr" , action = "store_true" )
2429parser .add_argument ("--no-redefine" , action = "store_true" )
2530
8691 exit ("ERROR: unexpected input:\n %s" % line )
8792
8893# Read nm output: <symbol value> <symbol type> <symbol name>
89- is_llvm_nm = os .path .basename (os .path .realpath (shutil .which (args .nmtool ))) == "llvm-nm"
94+ # Ignore .exe on Windows host.
95+ is_llvm_nm = os .path .basename (os .path .realpath (shutil .which (args .nmtool ))).startswith (
96+ "llvm-nm"
97+ )
9098nm_output = subprocess .run (
9199 [
92100 args .nmtool ,
You can’t perform that action at this time.
0 commit comments