pythonversionshared-librarieselfobjdump

get shared library soname in a Python program


I'm writing a Python wrapper for a shared Linux library using ctypes. Is there some way to extract the library's soname programmatically (e.g., possibly via some library for accessing its ELF data)? (I know that I can obtain this information from the output of the objdump command, but I was curious whether it can be done without having to execute a system command.)


Solution

  • Figured it out; solution (using pyelftools) posted here.