Binsize tool
Tool for analyzing the sizes of symbols in binaries.
It can be used to find out which symbols are taking up the most space in a binary.
It requires bloaty and nm tools to be installed.
It analyzes the .elf file and optionally also the .map file from the binary creation process.
Tool basic usage
Installable by pip install binsize - see PyPI.
Installing this package creates binsize command, which has a lot of subcommands seeable by binsize --help. For example
$ binsize get firmware.elf -d
$ binsize compare firmware.elf other_firmware.elf
$ binsize tree firmware.elf
--help can be used even on the subcommands, for example binsize get --help - to see all available options.
Result will be usually printed into terminal, unless specifying --output option which some commands support.
Setting root directory
To resolve all the files properly, the project's root directory needs to be set correctly.
There are couple of possibilities how to do it.
In the end, all of them are changing the root value in settings.json, from where everything else gets the value. It needs to be an absolute path.
settings.json will be created in a user's home directory, based on platformdirs library (~/.config/binsize/settings.json on linux).
Manually
Just modifying the root in the settings.json file.
Via environmental variable
BINSIZE_ROOT_DIR env variable is checked and when not empty, it will set the root directory.
e.g. BINSIZE_ROOT_DIR=/home/user/project binsize tree /path/to/file.elf
Via CLI argument
binsize accepts -r / --root-dir argument, which can be used to set the root directory.
It has lower priority than the environmental variable.
e.g. binsize -r /home/user/project tree /path/to/file.elf
Via exposed function
binsize exposes set_root_dir function, which can be called from any python script.
e.g. binsize.set_root_dir("/home/user/project")
TODO: document all the CLI commands, exportable symbols, basic functioning, ways to extend it, etc.
Metadata
Release files for binsize 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| binsize-0.1.4.tar.gz | 27.9 kB | Without provenance | Details for binsize-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| binsize-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for binsize-0.1.4-py3-none-any.whl |
Total release size: 67.9 kB
Release files / binsize-0.1.4.tar.gz
| Download URL | binsize-0.1.4.tar.gz |
|---|---|
| Size | 27.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
45053e9d2900b5cc78729842fe13ef3738b05705c4a1fe802798649587ab1510
|
|
BLAKE2b-256 checksum How to use checksums |
81fb04e43abeb35a226f240ef70b76355076cbfaff8338c837359e2772f1c55a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.11.8 Linux/6.8.0-49-generic
|
Release files / binsize-0.1.4-py3-none-any.whl
| Download URL | binsize-0.1.4-py3-none-any.whl |
|---|---|
| Size | 40.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f0069790fe7ff45d2699561f6af7a837af081b5a474d5f6f4371a50359f96118
|
|
BLAKE2b-256 checksum How to use checksums |
905ebb77d12046e125cd52b1d85b0d8fdfd750c67942efad0381a3c7ac65f119
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.11.8 Linux/6.8.0-49-generic
|
Security for binsize 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.