From 1830cdcb4dbeb6938551ef9ef78dcebfa6261030 Mon Sep 17 00:00:00 2001 From: Costa Shulyupin Date: Sun, 16 Sep 2018 16:37:00 +0300 Subject: [PATCH] +import_symbols --- srcxray.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/srcxray.py b/srcxray.py index f6e0c38..dc6eb72 100755 --- a/srcxray.py +++ b/srcxray.py @@ -885,6 +885,22 @@ def add_rank(g): return g +def import_symbols(): + sym = my_graph('symbols') + for l in popen('(shopt -s globstar; nm -D -C -A **/*.so.*)'): + q = l.split(maxsplit=2) + m = re.match(r'.*lib(.+).so.*:.*', q[0]) + if not m: + log(q[0]) + continue + if q[1] == 'U': + sym.add_edge(m.group(1), q[2]) + elif q[1] == 'T': + sym.add_edge(q[2], m.group(1)) + print(m.group(1), q[1], q[2]) + return sym + + me = os.path.basename(sys.argv[0])