xref: /illumos-gate/usr/src/man/man1/strip.1 (revision 3c7284bd3243d42a710edac3a15f6019b4c849be)
te
Copyright 1989 AT&T
Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved
Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
http://www.opengroup.org/bookstore/.
The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
This notice shall appear on any product containing this material.
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
STRIP 1 "Oct 5, 2007"
NAME
strip - strip symbol table, debugging and line number information from an object file
SYNOPSIS

strip [-lVx] file...
DESCRIPTION

The strip command removes the symbol table SHT_SYMTAB and its associated string table, debugging information, and line number information from ELF object files. That is, besides the symbol table and associated string table, the following sections are removed:

.line
.debug*
.stab*

Once this stripping process has been done, limited symbolic debugging access is available for that file. Therefore, this command is normally run only on production modules that have been debugged and tested.

If strip is executed on a common archive file (see ar.h(3HEAD)) in addition to processing the members, strip removes the archive symbol table. The archive symbol table must be restored by executing the ar(1) command with the -s option before the archive can be linked by the ld(1) command. strip produces appropriate warning messages when this situation arises.

strip is used to reduce the file storage overhead taken by the object file.

OPTIONS

The amount of information stripped from the ELF object file can be controlled by using any of the following options. The following options are supported: -l

Strip line number information only.Does not strip the symbol table or debugging information.

-V

Prints, on standard error, the version number of strip.

-x

Does not strip the symbol table. Debugging and line number information might be stripped.

OPERANDS

The following operand is supported: file

A path name referring to an executable file.

ENVIRONMENT VARIABLES

See environ(5) for descriptions of the following environment variables that affect the execution of strip: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and NLSPATH.

EXIT STATUS

The following exit values are returned: 0

Successful completion.

>0

An error occurred.

FILES
/tmp/strp*

Temporary files

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
Interface Stability Standard
SEE ALSO

ar(1), as(1), ld(1), mcs(1), elf(3ELF), tmpnam(3C), a.out(4), ar.h(3HEAD), attributes(5), environ(5), standards(5)

NOTES

The symbol table section is not removed if it is contained within a segment or if the file is a relocatable object.

The line number and debugging sections are not removed if they are contained within a segment or if their associated relocation section is contained within a segment.

The strip command is used to remove a standard predefined set of sections from an ELF object file. To remove a user specified section by name, see mcs(1).