strip(1)
NAME
strip − strip symbol and line number information from an object file
SYNOPSIS
strip [-l] [-x] [-r] [-V] filename ...
DESCRIPTION
strip removes the symbol table and line number information from object files, including archives. Thereafter, no symbolic debugging access is available for that file; thus, this command is normally run only on production modules that have been debugged and tested. The effect is identical to using the -s option of ld.
Options
The amount of information stripped from the symbol table can be controlled by using any of the following options:
-l Strip line number information only; do not strip any symbol table information.
-x Do not strip static or external symbol information.
-r Reset the relocation indexes into the symbol table.
-V Print the version of the strip command executing on the standard error output.
If there are any relocation entries in the object file and any symbol table information is to be stripped, strip complains and terminates without stripping filename unless the -r option is used.
If strip is executed on an archive file (see ar(4)), the archive symbol table is removed. The archive symbol table must be restored by executing ar with its s operator (see ar(1)) before the archive can be link-edited by ld command (se ld(1)). strip instructs the user with appropriate warning messages when this situation arises.
The purpose of this command is to reduce file storage overhead consumed by the object file.
EXTERNAL INFLUENCES
International Code Set Support
Single- and multi-byte character code sets are supported.
DIAGNOSTICS
strip: name: cannot open name cannot be read.
strip: name: bad magic name is not an appropriate object file.
strip: name: relocation entries present; cannot strip
name contains relocation entries and the -r option was not specified. Symbol table information cannot be stripped.
EXAMPLES
Strip symbol table and debug information from the shared library libfoo.sl in the current directory to reduce it’s size. Symbol information required to use the library is preserved:
strip ./libfoo.sl
DEPENDENCIES
Series 300/400
If name is a relocatable file, strip removes the local symbols from it. If name is an archive file, strip removes the local symbols from any a.out -format files it finds in the archive. Certain libraries (such as those residing in /lib) have no need for local symbols. By deleting them, the size of the archive is decreased and link editing performance is increased.
The -l, -x, -r, and -V options are not supported.
strip removes debug information from any a.out file it finds while stripping an archive file (see ar(1)).
strip does not warn the user that stripping an archive file removes the archive symbol table.
Currently, strip does not complain about stripping relocatable files. It strips such files by removing debugging information only.
Series 700/800
The -l and -x options are synonymous because the symbol table contains only static and external symbols. Either option strips only symbolic debugging information and unloadable data. The -r option allows strip to be run on relocatable files, in which case the effect is also to strip only symbolic debugging information and unloadable data.
FILES
Series 300/400
/tmp/s* temporary files
Series 700/800
/usr/tmp/strp?????? temporary files
SEE ALSO
ar(1), as(1), cc(1), ld(1), a.out(4), ar(4).
STANDARDS CONFORMANCE
strip: SVID2, XPG2, XPG3, POSIX.2
Hewlett-Packard Company — HP-UX Release 9.0: August 1992