Analyze a compiled firmware ELF file to find which functions take up the most space.
Explore a sample report from the Raspberry Pi RP2350 bootrom included in the repo.
Generate an interactive HTML tree showing inlined code size breakdowns for your project.
| wren6991/codesizer | develp10/rustinterviewquiestions | fukikomarga/exodus-fake-balance | |
|---|---|---|---|
| Stars | 48 | 48 | 48 |
| Language | Python | Python | Python |
| Setup difficulty | moderate | moderate | moderate |
| Complexity | 2/5 | 2/5 | 2/5 |
| Audience | developer | developer | general |
Figures from each repo's GitHub metadata at analysis time.
Requires compiler toolchain binaries like objdump and addr2line for your target hardware, plus an ELF file to analyze.
CodeSizer is a Python tool that helps developers figure out why a compiled program file is unusually large. It focuses on a specific niche: embedded firmware, where software runs on small, resource-constrained devices. In this context, every byte matters, so understanding what takes up space in the final compiled binary is important. The problem CodeSizer solves comes from how modern compilers optimize code. Compilers frequently inline small functions, meaning they paste the body of one function directly into another to avoid the overhead of a function call. After this optimization, a single function in the compiled file may actually contain the code of dozens of other functions that were folded into it. Standard profiling tools attribute the size to the outer function, hiding the true source of the bulk. CodeSizer uses two existing tools, objdump and addr2line, to trace back through these inline expansions at every instruction address. This lets it correctly assign code size to the right place in the call tree. The result of running CodeSizer is a static HTML report file. The report presents the size data as a tree view, so you can see which functions and their inlined sub-calls consume the most space. A small bit of JavaScript in the report lets you expand and collapse sections of the tree to explore the data in your web browser. To use the tool, you run it from a terminal and provide an input ELF file, which is a common format for compiled firmware, and a name for the output HTML file. You also need to tell it where to find the matching compiler tools for your specific hardware, using a prefix flag. For example, you can point it at tools for ARM or RISC-V processors depending on your project. The repository includes a sample report generated from the Raspberry Pi RP2350 bootrom, so you can view a real example before trying it on your own files.
A Python tool that analyzes compiled firmware files and shows what functions take up the most space, even when the compiler has merged small functions together. It outputs an interactive HTML report.
Mainly Python. The stack also includes Python, objdump, addr2line.
The explanation does not mention a license, so the usage terms for this repository are unknown.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Don't trust strangers blindly. Verify against the repo.