Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/clang/llvm-objcopy/llvm-strip.1
- This file was added.
.\" Man page generated from reStructuredText. | |||||
. | |||||
. | |||||
.nr rst2man-indent-level 0 | |||||
. | |||||
.de1 rstReportMargin | |||||
\\$1 \\n[an-margin] | |||||
level \\n[rst2man-indent-level] | |||||
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] | |||||
- | |||||
\\n[rst2man-indent0] | |||||
\\n[rst2man-indent1] | |||||
\\n[rst2man-indent2] | |||||
.. | |||||
.de1 INDENT | |||||
.\" .rstReportMargin pre: | |||||
. RS \\$1 | |||||
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] | |||||
. nr rst2man-indent-level +1 | |||||
.\" .rstReportMargin post: | |||||
.. | |||||
.de UNINDENT | |||||
. RE | |||||
.\" indent \\n[an-margin] | |||||
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] | |||||
.nr rst2man-indent-level -1 | |||||
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] | |||||
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u | |||||
.. | |||||
.TH "LLVM-STRIP" "1" "2021-09-22" "12" "LLVM" | |||||
.SH NAME | |||||
llvm-strip \- object stripping tool | |||||
.SH SYNOPSIS | |||||
.sp | |||||
\fBllvm\-strip\fP [\fIoptions\fP] \fIinputs...\fP | |||||
.SH DESCRIPTION | |||||
.sp | |||||
\fBllvm\-strip\fP is a tool to strip sections and symbols from object files. | |||||
If no other stripping or remove options are specified, \fI\%\-\-strip\-all\fP | |||||
will be enabled. | |||||
.sp | |||||
By default, the input files are modified in\-place. If "\-" is specified for the | |||||
input file, the input is read from the program\(aqs standard input stream. | |||||
.sp | |||||
If the input is an archive, any requested operations will be applied to each | |||||
archive member individually. | |||||
.sp | |||||
The tool is still in active development, but in most scenarios it works as a | |||||
drop\-in replacement for GNU\(aqs \fBstrip\fP\&. | |||||
.SH GENERIC AND CROSS-PLATFORM OPTIONS | |||||
.sp | |||||
The following options are either agnostic of the file format, or apply to | |||||
multiple file formats. | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-disable\-deterministic\-archives, \-U | |||||
Use real values for UIDs, GIDs and timestamps when updating archive member | |||||
headers. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-discard\-all, \-x | |||||
Remove most local symbols from the output. Different file formats may limit | |||||
this to a subset of the local symbols. For example, file and section symbols in | |||||
ELF objects will not be discarded. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-enable\-deterministic\-archives, \-D | |||||
Enable deterministic mode when stripping archives, i.e. use 0 for archive member | |||||
header UIDs, GIDs and timestamp fields. On by default. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-help, \-h | |||||
Print a summary of command line options. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-no\-strip\-all | |||||
Disable \fI\%\-\-strip\-all\fP\&. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-o <file> | |||||
Write output to <file>. Multiple input files cannot be used in combination | |||||
with \-o. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-regex | |||||
If specified, symbol and section names specified by other switches are treated | |||||
as extended POSIX regular expression patterns. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-remove\-section <section>, \-R | |||||
Remove the specified section from the output. Can be specified multiple times | |||||
to remove multiple sections simultaneously. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-strip\-all\-gnu | |||||
Remove all symbols, debug sections and relocations from the output. This option | |||||
is equivalent to GNU \fBstrip\fP\(aqs \fB\-\-strip\-all\fP switch. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-strip\-all, \-S | |||||
For ELF objects, remove from the output all symbols and non\-alloc sections not | |||||
within segments, except for .gnu.warning, .ARM.attribute sections and the | |||||
section name table. | |||||
.sp | |||||
For COFF objects, remove all symbols, debug sections, and relocations from the | |||||
output. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-strip\-debug, \-g | |||||
Remove all debug sections from the output. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-strip\-symbol <symbol>, \-N | |||||
Remove all symbols named \fB<symbol>\fP from the output. Can be specified | |||||
multiple times to remove multiple symbols. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-strip\-unneeded | |||||
Remove from the output all local or undefined symbols that are not required by | |||||
relocations. Also remove all debug sections. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-version, \-V | |||||
Display the version of the \fBllvm\-strip\fP executable. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-wildcard, \-w | |||||
Allow wildcard syntax for symbol\-related flags. On by default for | |||||
section\-related flags. Incompatible with \-\-regex. | |||||
.sp | |||||
Wildcard syntax allows the following special symbols: | |||||
.TS | |||||
center; | |||||
|l|l|l|. | |||||
_ | |||||
T{ | |||||
Character | |||||
T} T{ | |||||
Meaning | |||||
T} T{ | |||||
Equivalent | |||||
T} | |||||
_ | |||||
T{ | |||||
\fB*\fP | |||||
T} T{ | |||||
Any number of characters | |||||
T} T{ | |||||
\fB\&.*\fP | |||||
T} | |||||
_ | |||||
T{ | |||||
\fB?\fP | |||||
T} T{ | |||||
Any single character | |||||
T} T{ | |||||
\fB\&.\fP | |||||
T} | |||||
_ | |||||
T{ | |||||
\fB\e\fP | |||||
T} T{ | |||||
Escape the next character | |||||
T} T{ | |||||
\fB\e\fP | |||||
T} | |||||
_ | |||||
T{ | |||||
\fB[a\-z]\fP | |||||
T} T{ | |||||
Character class | |||||
T} T{ | |||||
\fB[a\-z]\fP | |||||
T} | |||||
_ | |||||
T{ | |||||
\fB[!a\-z]\fP, \fB[^a\-z]\fP | |||||
T} T{ | |||||
Negated character class | |||||
T} T{ | |||||
\fB[^a\-z]\fP | |||||
T} | |||||
_ | |||||
.TE | |||||
.sp | |||||
Additionally, starting a wildcard with \(aq!\(aq will prevent a match, even if | |||||
another flag matches. For example \fB\-w \-N \(aq*\(aq \-N \(aq!x\(aq\fP will strip all symbols | |||||
except for \fBx\fP\&. | |||||
.sp | |||||
The order of wildcards does not matter. For example, \fB\-w \-N \(aq*\(aq \-N \(aq!x\(aq\fP is | |||||
the same as \fB\-w \-N \(aq!x\(aq \-N \(aq*\(aq\fP\&. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B @<FILE> | |||||
Read command\-line options and commands from response file \fI<FILE>\fP\&. | |||||
.UNINDENT | |||||
.SH COFF-SPECIFIC OPTIONS | |||||
.sp | |||||
The following options are implemented only for COFF objects. If used with other | |||||
objects, \fBllvm\-strip\fP will either emit an error or silently ignore | |||||
them. | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-only\-keep\-debug | |||||
Remove the contents of non\-debug sections from the output, but keep the section | |||||
headers. | |||||
.UNINDENT | |||||
.SH ELF-SPECIFIC OPTIONS | |||||
.sp | |||||
The following options are implemented only for ELF objects. If used with other | |||||
objects, \fBllvm\-strip\fP will either emit an error or silently ignore | |||||
them. | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-allow\-broken\-links | |||||
Allow \fBllvm\-strip\fP to remove sections even if it would leave invalid | |||||
section references. Any invalid sh_link fields will be set to zero. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-discard\-locals, \-X | |||||
Remove local symbols starting with ".L" from the output. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-keep\-file\-symbols | |||||
Keep symbols of type \fISTT_FILE\fP, even if they would otherwise be stripped. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-keep\-section <section> | |||||
When removing sections from the output, do not remove sections named | |||||
\fB<section>\fP\&. Can be specified multiple times to keep multiple sections. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-keep\-symbol <symbol>, \-K | |||||
When removing symbols from the output, do not remove symbols named | |||||
\fB<symbol>\fP\&. Can be specified multiple times to keep multiple symbols. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-preserve\-dates, \-p | |||||
Preserve access and modification timestamps in the output. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-\-strip\-sections | |||||
Remove from the output all section headers and all section data not within | |||||
segments. Note that many tools will not be able to use an object without | |||||
section headers. | |||||
.UNINDENT | |||||
.INDENT 0.0 | |||||
.TP | |||||
.B \-T | |||||
Remove Swift symbols. | |||||
.UNINDENT | |||||
.SH EXIT STATUS | |||||
.sp | |||||
\fBllvm\-strip\fP exits with a non\-zero exit code if there is an error. | |||||
Otherwise, it exits with code 0. | |||||
.SH BUGS | |||||
.sp | |||||
To report bugs, please visit <\fI\%https://bugs.llvm.org/\fP>. | |||||
.SH SEE ALSO | |||||
.sp | |||||
\fBllvm\-objcopy(1)\fP | |||||
.SH AUTHOR | |||||
Maintained by the LLVM Team (https://llvm.org/). | |||||
.SH COPYRIGHT | |||||
2003-2021, LLVM Project | |||||
.\" Generated by docutils manpage writer. | |||||
. |