def init_parse_lib():
global parselib
- try:
- parselib = cdll.LoadLibrary("./libparserelf_x86.so")
- except:
- parselib = cdll.LoadLibrary("./libparserelf.so")
+ parse_lib_list = [
+ "./libparserelf.so",
+ "./elf_parsing/prebuild/libparserelf_x86.so",
+ "./elf_parsing/prebuild/libparserelf_x86_64.so",
+ ]
+
+ for lib in parse_lib_list:
+ try:
+ __debug("LOAD %s" % lib)
+ parselib = cdll.LoadLibrary(lib)
+ return 0
+ except:
+ __debug("Cannot load %s" % lib)
+ continue
+ return -1
+
def check_elf(filename):
return parselib.fast_check_elf(filename)
da_lib = sys.argv[2]
da_inst_dir = sys.argv[3]
-init_parse_lib()
+if init_parse_lib() != 0:
+ exit(1)
+
data = parse_apis(func_list_file)
probe_lib = parse_probe_lib(da_lib)
# TODO Enable it. Warning disabled iterate_over_libs