A command-line tool for inspecting ELF binaries — symbol tables, section sizes, undefined/weak symbols, and shared library dependencies. Supports both ELF32 and ELF64, little- and big-endian, across x86, x86-64, ARM, AArch64, and RISC-V.
Zero external dependencies. Pure C++17 with hand-rolled ELF parsing.
- Symbol table extraction (
.symtaband.dynsym) - Section inventory sorted by size
- Undefined symbol detection (unresolved external references)
- Weak symbol listing
- Shared library dependency chains (
DT_NEEDEDentries) - JSON output mode for pipeline integration
- Handles stripped binaries gracefully
mkdir build && cd build
cmake ..
make -j$(nproc)elf-analyzer [options] <elf-binary>
Options:
-s, --symbols Show full symbol table (default)
-S, --sections Show section sizes
-u, --undefined Show undefined symbols only
-w, --weak Show weak symbols only
-d, --deps Show shared library dependencies
-a, --all Show everything
-j, --json Output as JSON
-h, --help Show this help
# Quick overview — undefined symbols and deps
./elf-analyzer -u -d /usr/bin/ls
# Full section breakdown
./elf-analyzer -S /usr/bin/python3
# JSON output for scripting
./elf-analyzer -a -j ./my_program | jq '.undefined_symbols'
# Inspect a shared library
./elf-analyzer -a /usr/lib/x86_64-linux-gnu/libc.so.6File: /usr/bin/ls
Type: DYN (shared object) Arch: x86-64 Class: ELF64 Endian: LE
Entry: 0x67d0
── Shared Library Dependencies (4) ──
libselinux.so.1
libc.so.6
libpcre2-8.so.0
── Undefined Symbols (12) ──
[FUNC] opendir
[FUNC] __printf_chk
[FUNC] getxattr
...
Analyzes a 50 MB binary in under 200 ms on commodity hardware. Memory usage is O(file size) — the file is loaded once into a single buffer.
- No
libelforlibbfd— ELF structs are defined inline from the spec - Endian-aware read helpers handle both LE and BE without UB
- Separate 32-bit and 64-bit parse paths share the same reporter layer
- JSON output is hand-serialized (no external JSON library needed)