A terminal user interface (TUI) application for analyzing object files.
Built with Rust and Ratatui.
- Overview Tab: Displays file information, architecture details, file size statistics, and dynamic linking information
- Sections Tab: Lists all ELF sections with sizes, types, flags, and offsets; sortable by name, size, type, or offset
- Symbols Tab: Lists all symbols with sizes, types, bindings, and addresses; sortable by name, size, type, or binding
- Statistics Tab: Comprehensive size breakdowns with visual charts showing section and symbol distributions
- Suggestions Tab: Actionable optimization suggestions with estimated size savings and risk levels
- ELF Metadata: Architecture, endianness, ELF class (32/64-bit), entry point, program/section headers
- Section Analysis:
- Section types:
.text,.data,.bss,.rodata,.rela.*,.debug_*, etc. - File size vs memory size
- Section flags (readable, writable, executable, allocatable)
- Grouping by type/category
- Identification of strippable sections
- Section types:
- Symbol Analysis:
- Symbol types: function, object, file, section
- Symbol bindings: local, global, weak
- Symbol visibility
- Size calculations
- Exported vs local symbols
- Statistics:
- Total file size
- Code size vs data size
- Debug info size
- Strippable size
- Size breakdowns by section category
- Size breakdowns by symbol type
- Optimization Suggestions:
- Strip debug symbols
- Remove unused sections
- Strip local symbols
- Link-time optimization recommendations
- Compression opportunities
- Each suggestion includes:
- Description
- Estimated size savings
- Command/flag to apply
- Risk level (low/medium/high)
- Rust (latest stable version recommended)
- Cargo
cargo build --releaseThe binary will be located at target/release/soap.
./target/release/soap <path-to-object-file>Or using cargo:
cargo run --release -- <path-to-object-file>Example:
cargo run --release -- /usr/lib/libc.so.6qorEsc: Quit the applicationhor←: Previous tablor→: Next tab
↑ork: Scroll up↓orj: Scroll downPage Up: Scroll up one pagePage Down: Scroll down one pageHome: Jump to topEnd: Jump to bottom
s: Cycle through sort modes (Name → Size → Type → Offset/Binding)r: Toggle sort direction (ascending/descending)
Enter: View detailed hex dump of selected section (especially useful for.textsection)Esc: Exit detail view and return to section list- In detail view:
↑/k: Scroll hex dump up↓/j: Scroll hex dump downPage Up/Page Down: Scroll by page
/: Toggle search mode (filter by name substring)f: Open filter menu to filter by section type, symbol type/binding, and size range- In filter menu:
↑/↓navigate,Spacetoggle type/binding,+/-adjust min/max size (when on size row),Tabswitch Section/Symbol filters,Enterapply,xclear,Esccancel
e(Suggestions tab): Export optimization suggestions to a shell script (soap_suggestions_<basename>.sh)E: Export current file data (sections, symbols, stats) to JSON (soap_export_<basename>.json)
c: Switch between File A and File B
Shows general information about object files:
- Architecture (x86_64, ARM, etc.)
- ELF class (32-bit/64-bit)
- Endianness
- Entry point address
- Program and section header counts
- Total file size
- Code size, data size, debug size
- Strippable size
- Section and symbol counts
- Dynamic linking information (SONAME, needed libraries)
Displays all ELF sections with:
- Section name
- Section type (Text, Data, Debug, etc.)
- File size and memory size
- Section flags (R=readable, W=writable, X=executable, A=allocatable)
- File offset and virtual address
- Sortable by name, size, type, or offset
- Detail View: Press
Enteron any section to view a detailed hex dump showing:- Section header information
- Hex dump with offsets (16 bytes per line)
- ASCII representation of the data
- Particularly useful for inspecting
.textsection code
Displays all symbols with:
- Symbol name
- Symbol type (Function, Object, File, Section)
- Symbol binding (Local, Global, Weak)
- Symbol size
- Virtual address
- Sortable by name, size, type, or binding
Comprehensive analysis including:
- Section Breakdown: Size distribution by section type with visual bars
- Symbol Breakdown: Size distribution by symbol type with counts and percentages
- Visual charts showing relative sizes
Optimization recommendations:
- Strip debug symbols: Remove
.debug_*sections - Strip local symbols: Remove local symbols to reduce size
- Remove comment section: Strip
.commentsection - Link-time optimization: Recompile with LTO flags
- Remove relocation sections: If not needed for dynamic linking
- Each suggestion shows:
- Title and description
- Estimated size savings
- Command to apply
- Risk level (color-coded: green=low, yellow=medium, red=high)
- Formats: ELF (shared objects, executables), static libraries (
.a), WebAssembly, Mach-O, PE/COFF - ELF: Dynamic section (NEEDED, SONAME, RPATH, RUNPATH), symbol binding/visibility
- Export: CSV/JSON (CLI and TUI), export suggestions to shell script
- Filtering: By section/symbol type, binding, name search, min/max size
- Comparison: Load two files, switch with
c, Comparison tab shows size diff and sections/symbols only in A or B
soap uses the object crate for parsing ELF files. It extracts:
- ELF header information
- Program headers (segments)
- Section headers
- Symbol tables (
.symtaband.dynsym) - Dynamic linking information
Recognized section types:
- Text: Executable code (
.text) - Data: Initialized data (
.data) - BSS: Uninitialized data (
.bss) - Rodata: Read-only data (
.rodata) - Relocation: Relocation tables (
.rela.*,.rel.*) - Debug: Debug information (
.debug_*) - Dynamic: Dynamic linking information (
.dynamic) - StringTable: String tables (
.strtab,.dynstr) - SymbolTable: Symbol tables (
.symtab,.dynsym) - Note: Note sections (
.note.*)
Symbols are classified by:
- Type: Function, Object, File, Section
- Binding: Local, Global, Weak
- Visibility: Default, Hidden, Protected, Internal
soap /usr/lib/libc.so.6soap target/release/libmylib.soExport without starting the TUI:
soap --export csv [--output base] <file> # Writes base_sections.csv and base_symbols.csv (or stdout)
soap --export json [--output path] <file> # Writes full JSON (sections, symbols, stats)
soap --export-suggestions [output.sh] <file> # Writes shell script with optimization commands- Some advanced ELF features may not be fully parsed
- WebAssembly: section sizes for type/import/export are not shown; code and data sizes are computed
- Thin archives (
.awith external member references) are skipped
This project is licensed under the BSD 3-Clause License. See the LICENSE file for details.
See CONTRIBUTING.md for guidelines on contributing to this project.