LinuxCommandLibrary

strip

Remove symbols from object files

TLDR

Replace the input file with its stripped version

$ strip [path/to/file]
copy

Strip symbols from a file, saving the output to a specific file
$ strip [path/to/input_file] -o [path/to/output_file]
copy

Strip debug symbols only
$ strip [[-d|--strip-debug]] [path/to/file.o]
copy

SYNOPSIS

strip [options] objfile ...

PARAMETERS

-s, --strip-all
    Remove all symbols

-g, --strip-debug
    Remove debugging symbols only

-K SYMBOL
    Keep SYMBOL

-N SYMBOL
    Remove SYMBOL

-o FILE
    Output to FILE

--strip-unneeded
    Remove unneeded symbols

DESCRIPTION

strip removes symbols and sections from object files. This reduces file size and makes reverse engineering harder. strip is commonly used when preparing binaries for distribution.

CAVEATS

Irreversible. Keep unstripped copy for debugging. Shared libraries may need some symbols.

SEE ALSO

objcopy(1), nm(1)

Copied to clipboard