Skip to main content

Python implementation of RPM elfdeps

Project description

ELF deps

Python implementation of RPM elfdeps. The elfdeps tool can extract dependencies and provides from an ELF binary.

Example

$ elfdeps --requires /usr/bin/python3.12
libc.so.6(GLIBC_2.34)(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libpython3.12.so.1.0()(64bit)
libc.so.6()(64bit)
rtld(GNU_HASH)

$ elfdeps --provides /usr/lib64/libpython3.12.so
libpython3.12.so.1.0()(64bit)
$ elfdeps --provides /lib64/libc.so.6
libc.so.6(GLIBC_2.2.5)(64bit)
libc.so.6(GLIBC_2.2.6)(64bit)
libc.so.6(GLIBC_2.3)(64bit)
...
libc.so.6(GLIBC_2.36)(64bit)
libc.so.6(GLIBC_2.38)(64bit)
libc.so.6(GLIBC_ABI_DT_RELR)(64bit)
libc.so.6(GLIBC_PRIVATE)(64bit)
libc.so.6()(64bit)

RPM

In Fedora-based distributions, RPM packages provide and require virtual packages with ELF sonames and versions. The package manager can install virtual provides.

The python3 base package depends on libpython3.12.so.1.0()(64bit) and libc.so.6(GLIBC_2.34)(64bit):

$ rpm -qR python3
libc.so.6()(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libc.so.6(GLIBC_2.34)(64bit)
libpython3.12.so.1.0()(64bit)
...
rtld(GNU_HASH)

The python3-libs package virtually provides libpython3.12.so.1.0()(64bit):

$ rpm -qP python3-libs
bundled(libb2) = 0.98.1
libpython3.12.so.1.0()(64bit)
libpython3.so()(64bit)
python-libs = 3.12.3-2.fc39
python3-libs = 3.12.3-2.fc39
python3-libs(x86-64) = 3.12.3-2.fc39
python3.12-libs = 3.12.3-2.fc39
$ sudo dnf install 'libc.so.6(GLIBC_2.34)(64bit)' 'libpython3.12.so.1.0()(64bit)'
Package glibc-2.38-18.fc39.x86_64 is already installed.
Package python3-libs-3.12.3-2.fc39.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

Public API

  • dataclass elfdeps.ELFAnalyzeSettings
  • exception elfdeps.ELFError
  • dataclass elfdeps.ELFInfo
  • dataclass elfdeps.SOInfo
  • elfdeps.analyze_elffile(elffile, *, filename, is_exec, settings=None) -> ELFInfo
  • elfdeps.analyze_file(filename, *, settings=None) -> ELFInfo
  • elfdeps.analyze_tarmember(tfile, tarinfo, *, settings=None) -> ELFInfo
  • elfdeps.analyze_zipmember(zfile, zipinfo, *, settings=None) -> ELFInfo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

elfdeps-0.1.2.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

elfdeps-0.1.2-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file elfdeps-0.1.2.tar.gz.

File metadata

  • Download URL: elfdeps-0.1.2.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for elfdeps-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8e5335ed891834dae6aa12da2750fb8ca2f9e9c9ca2d2c154d1292a0e30be849
MD5 a05dd6df41745ab77c12d82b2a52dc07
BLAKE2b-256 82432f6314b1bda5d280a0c03e132748bfcb61dc0218cd223f590c3252bbc383

See more details on using hashes here.

File details

Details for the file elfdeps-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: elfdeps-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for elfdeps-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8f32886488358ec2a36a1d63f138713a29045ba556c76d22beb2c14146b171a5
MD5 ae4de34beeb61944479150927d3190b7
BLAKE2b-256 2eedf86c89e101d5301dc05ee1543d120b5f8b7f3e11c520673ebd5cac76619e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page