objcopy

Copy and transform object files, executables, and binary formats.

What it does

objcopy copies object files and can modify their contents, sections, and formats. It is commonly used in low-level development, firmware work, and binary manipulation.

Quick Start

# Copy object file
objcopy input.o output.o

# Convert to raw binary
objcopy -O binary input.elf output.bin

Examples

# Strip symbols
objcopy --strip-all program

# Remove a section
objcopy --remove-section .comment program

# Extract only one section
objcopy -j .text -O binary program text.bin

Notes