GNU Binutils
Purpose
Guide agents through the binutils toolset for binary manipulation: static libraries, stripping, address-to-source mapping, and symbol demangling.
Triggers
- "How do I create a static library?"
- "How do I strip a binary but keep a debug file?"
- "I have an address from a crash — how do I find the source line?"
- "How do I demangle a C++ symbol name?"
- "How do I extract/replace sections in a binary?"
Workflow
1. ar — static library management
For LTO archives: use gcc-ar/gcc-ranlib or llvm-ar instead of plain ar.
2. strip — remove debug info
3. objcopy — binary section manipulation
4. addr2line — address to source
Requires the binary to have debug info (compiled with -g). For stripped binaries, use the unstripped version or a .debug file.
5. c++filt — demangle C++ symbols
Alternative: nm -C prog (demangle directly in nm).
6. strings — extract printable strings
7. readelf and objdump quick reference
(Full coverage in skills/binaries/elf-inspection)
8. Cross-binutils
For cross-compilation, use the target-prefixed versions:
For a complete command cheatsheet covering all tools (ar, strip, objcopy, addr2line, strings, c++filt), see references/cheatsheet.md [blocked].
Related skills
- Use
skills/binaries/elf-inspectionforreadelf,nm,ldd,objdumpinspection - Use
skills/binaries/linkers-ltofor linker flags and LTO - Use
skills/debuggers/core-dumpsfor debug file management withobjcopy --add-gnu-debuglink


