Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jedrzejboczar/elf-size-analyze
Script for analyzing ELF memory usage
https://github.com/jedrzejboczar/elf-size-analyze
Last synced: 8 days ago
JSON representation
Script for analyzing ELF memory usage
- Host: GitHub
- URL: https://github.com/jedrzejboczar/elf-size-analyze
- Owner: jedrzejboczar
- License: apache-2.0
- Created: 2018-09-28T18:51:25.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-23T08:12:42.000Z (7 months ago)
- Last Synced: 2024-11-09T22:37:27.587Z (11 days ago)
- Language: Python
- Size: 115 KB
- Stars: 125
- Watchers: 3
- Forks: 23
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Elf size report
This script is based on [size_report](https://github.com/zephyrproject-rtos/zephyr/blob/master/scripts/footprint/size_report) from Zephyr Project scripts. It has been almost fully rewritten but the idea is the same. It uses binutils programs (readelf, nm, c++filt) to extract information about symbols and sections from an ELF file and filters them. Information is presented in a tree based on paths to files where the symbols have been defined.
![Example output](https://raw.githubusercontent.com/jedrzejboczar/elf-size-analyze/master/example.jpg)
## Requirements
* Python 3
* binutils: readelf, nm, c++filt (optional)## Installation
For normal usage it's best to install from [PyPI](https://pypi.org/project/elf-size-analyze/):
```
pip install elf-size-analyze
```For development it's recommended to install from sources in virtual environment in editable mode:
```
python -m venv venv
source ./venv/bin/activate
git clone https://github.com/jedrzejboczar/elf-size-analyze.git
pip install -e ./elf-size-analyze
```## Usage
Select the ELF file to be analyzed. To be able to extract path information about symbols from the ELF file, the program should be compiled with debug information (`gcc -g`).
If installed using `pip` then the package provides an entry point and you can just use the `elf-size-analyze` command.
Otherwise use `python -m elf_size_analyze` from the source directory.Example usage:
```
elf-size-analyze -t arm-none-eabi- -w 120 -HaF build/myapp
```For more options see help:
```
elf-size-analyze -h
```For HTML output:
```
elf-size-analyze -t arm-none-eabi- -w 120 -HaF build/myapp -W > /tmp/index.html
firefox /tmp/index.html # or other browser / xdg-open
```