strip(1) SDK R4.11 strip(1)
NAME
strip - strip non-executable information from an object file
SYNOPSIS
strip [-l] [-x] [-b] [-r] [-c] [-V] filename ...
DESCRIPTION
The strip command strips the symbol table, string table, and line
number information from object files, including archives. [See
a.out(4)].
After stripping, no symbolic debugging is possible for that file,
although a core file produced by a stripped executable can be
symbolically debugged if an unstripped copy of the executable is also
available. [See dbx(1) or mxdb(1)]. Normally this command is run
only on production modules that have already been debugged and
tested.
If strip is executed on a common archive file (see ar(4)) the archive
symbol table will be removed. The archive symbol table must be
restored by executing ar(1) with the -ts option before the archive
can be link-edited by ld(1). Strip generates appropriate warning
messages when this situation arises.
Strip takes these options:
-V Print, on the standard error output, the version of strip
being executed.
-l Strip only line number information.
-x Do not strip the symbol table from an ELF object file; do not
strip static or external symbol information from a COFF object
file.
These options are meaningful only in a COFF environment:
-b Same as the -x option, but also do not strip scoping
information (e.g., beginning and end of block delimiters).
-r Do not strip static or external symbol information or
relocation information.
-c Strip only compiler-generated symbols.
If there are any relocation entries in a COFF object file and any
symbol table information is to be stripped, except by -c, strip
complains and terminates without stripping filename unless the -r
flag is used. If -c is used and there are relocation entries in the
COFF object file for compiler generated symbols, strip complains and
terminates without stripping.
This command reduces the file storage overhead taken by the object
file.
FILES
TMPDIR/strp* temporary files
TMPDIR usually /usr/tmp, but can be redefined by setting
the environment variable TMPDIR [see tempnam() in
tmpnam(3S)].
DIAGNOSTICS
strip: name: cannot be read
if name cannot be opened or is too short to be an object
file.
strip: name: bad magic
if name is not an appropriate object file.
strip: name: relocation entries present; cannot strip
if name contains relocation entries and the -r flag is not
used, the symbol table information cannot be stripped.
SEE ALSO
ar(1), as(1), cc(1), size(1), a.out(4), ar(4).
NOTES
The symbol table section will not be removed if it is contained
within a segment, or the file is either a relocatable or dynamic
shared object.
The line number and debugging sections will not be removed if they
are contained within a segment, or their associated relocation
section is contained within a segment.
An invalid option to the strip command is ignored, with no warning
given.
Licensed material--property of copyright holder(s)