parse_elf: add x86_64 environment support 61/99361/1 accepted/tizen/3.0/common/20161124.182045 accepted/tizen/3.0/ivi/20161124.082423 accepted/tizen/3.0/mobile/20161124.082329 accepted/tizen/3.0/tv/20161124.082350 accepted/tizen/3.0/wearable/20161124.082414 accepted/tizen/ivi/20161123.233639 accepted/tizen/mobile/20161123.233553 accepted/tizen/tv/20161123.233607 accepted/tizen/wearable/20161123.233625 submit/tizen/20161123.142358 submit/tizen_3.0/20161123.142346
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Tue, 22 Nov 2016 12:32:40 +0000 (15:32 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Tue, 22 Nov 2016 12:45:17 +0000 (15:45 +0300)
Change-Id: Ie153edaa89288c0f08dae80f89f45785b0f70368
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
elf_parsing/prebuild/libparserelf_x86.so [moved from libparserelf_x86.so with 100% similarity]
elf_parsing/prebuild/libparserelf_x86_64.so [new file with mode: 0755]
scripts/gen_headers.py

diff --git a/elf_parsing/prebuild/libparserelf_x86_64.so b/elf_parsing/prebuild/libparserelf_x86_64.so
new file mode 100755 (executable)
index 0000000..2c97352
Binary files /dev/null and b/elf_parsing/prebuild/libparserelf_x86_64.so differ
index 1a927b2..40931e4 100755 (executable)
@@ -24,10 +24,22 @@ parselib = 0
 
 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)
@@ -507,7 +519,9 @@ func_list_file = sys.argv[1]
 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