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)
elfdeps can also inspect archives like Python wheels and extract symbols:
$ elfdeps --symbols torchaudio-2.11.0-cp312-cp312-manylinux_2_28_x86_64.whl
filename: torchaudio/lib/_torchaudio.abi3.so
requires:
- libgcc_s.so.1(GCC_3.0)(64bit)
- libc.so.6(GLIBC_2.2.5)(64bit)
- ...
provides: []
machine: EM_X86_64
is_dso: true
is_exec: true
got_debug: false
got_hash: false
got_gnuhash: true
soname: _torchaudio.abi3.so
exported_symbols:
- _ZN10torchaudio12cuda_versionEv
- _ZN10torchaudio18is_align_availableEv
- ...
imported_symbols:
- ...
- aoti_torch_abi_version
- aoti_torch_delete_library_object
- ...
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_dirtree(dirname, settings=None) -> Generator[ELFInfo, None, None]elfdeps.analyze_elffile(elffile, *, filename, is_exec, settings=None) -> ELFInfoelfdeps.analyze_file(filename, *, settings=None) -> ELFInfoelfdeps.analyze_tarfile(tfile, *, settings=None) -> Generator[ELFInfo, None, None]elfdeps.analyze_tarmember(tfile, tarinfo, *, settings=None) -> ELFInfoelfdeps.analyze_zipfile(zfile, *, settings=None) -> Generator[ELFInfo, None, None]elfdeps.analyze_zipmember(zfile, zipinfo, *, settings=None) -> ELFInfo
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file elfdeps-0.3.1.tar.gz.
File metadata
- Download URL: elfdeps-0.3.1.tar.gz
- Upload date:
- Size: 22.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70ff06a802e60fb705150eed4f81ad717245634971185b421ba70e8cbb0b9028
|
|
| MD5 |
6210dcea78a3ab069e6603f66a671fa9
|
|
| BLAKE2b-256 |
5ef895a45066d38ed35cc75a4f85eb9d4775ddcf3446888c334aec0ddc6f2f36
|
Provenance
The following attestation bundles were made for elfdeps-0.3.1.tar.gz:
Publisher:
pypi.yaml on python-wheel-build/elfdeps
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
elfdeps-0.3.1.tar.gz -
Subject digest:
70ff06a802e60fb705150eed4f81ad717245634971185b421ba70e8cbb0b9028 - Sigstore transparency entry: 1394658488
- Sigstore integration time:
-
Permalink:
python-wheel-build/elfdeps@b4e11d62fc9cf496d9f88538dc26fbeb6af9bf7c -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/python-wheel-build
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@b4e11d62fc9cf496d9f88538dc26fbeb6af9bf7c -
Trigger Event:
release
-
Statement type:
File details
Details for the file elfdeps-0.3.1-py3-none-any.whl.
File metadata
- Download URL: elfdeps-0.3.1-py3-none-any.whl
- Upload date:
- Size: 20.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
481850021acc639003e16874e68ae85101ea15d59cfd0777e02df2eaf5c8b1e8
|
|
| MD5 |
379badc5a05daf8e96fee69d19d14d0c
|
|
| BLAKE2b-256 |
d81b80afa3a7e4d1402b802f7175795d36f17e2da33bf056d8400247f550a30a
|
Provenance
The following attestation bundles were made for elfdeps-0.3.1-py3-none-any.whl:
Publisher:
pypi.yaml on python-wheel-build/elfdeps
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
elfdeps-0.3.1-py3-none-any.whl -
Subject digest:
481850021acc639003e16874e68ae85101ea15d59cfd0777e02df2eaf5c8b1e8 - Sigstore transparency entry: 1394658494
- Sigstore integration time:
-
Permalink:
python-wheel-build/elfdeps@b4e11d62fc9cf496d9f88538dc26fbeb6af9bf7c -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/python-wheel-build
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@b4e11d62fc9cf496d9f88538dc26fbeb6af9bf7c -
Trigger Event:
release
-
Statement type: