From 5609b3af497c44d980aad2bc7d6332dedd7974e7 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 9 Aug 2018 19:11:53 +0200 Subject: lib/clippy: add libelf wrapper This adds _clippy.ELFFile, which provides a fast wrapper around libelf. The API is similar to / a subset of pyelfutils, which unfortunately is painfully slow (to the tune of minutes instead of seconds.) The idea is that xrefs can be read out of ELF files by reading out the "xref_array" section or "FRRouting/XREF" note. Signed-off-by: David Lamparter --- lib/command_py.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/command_py.c') diff --git a/lib/command_py.c b/lib/command_py.c index 4ec116df33..7f19008fbf 100644 --- a/lib/command_py.c +++ b/lib/command_py.c @@ -345,5 +345,7 @@ PyMODINIT_FUNC command_py_init(void) PyModule_AddObject(pymod, "GraphNode", (PyObject *)&typeobj_graph_node); Py_INCREF(&typeobj_graph); PyModule_AddObject(pymod, "Graph", (PyObject *)&typeobj_graph); + if (!elf_py_init(pymod)) + initret(NULL); initret(pymod); } -- cgit v1.2.3