1 .\" Copyright (c) 2011 Joseph Koshy. All rights reserved.
3 .\" Redistribution and use in source and binary forms, with or without
4 .\" modification, are permitted provided that the following conditions
6 .\" 1. Redistributions of source code must retain the above copyright
7 .\" notice, this list of conditions and the following disclaimer.
8 .\" 2. Redistributions in binary form must reproduce the above copyright
9 .\" notice, this list of conditions and the following disclaimer in the
10 .\" documentation and/or other materials provided with the distribution.
12 .\" THIS SOFTWARE IS PROVIDED BY JOSEPH KOSHY ``AS IS'' AND
13 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15 .\" ARE DISCLAIMED. IN NO EVENT SHALL JOSEPH KOSHY BE LIABLE
16 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 .\" $Id: strip.1 3642 2018-10-14 14:24:28Z jkoshy $
31 .Nd discard information from ELF objects
34 .Op Fl d | Fl g | Fl S | Fl -strip-debug
36 .Op Fl -only-keep-debug
37 .Op Fl o Ar outputfile | Fl -output-file= Ns Ar outputfile
38 .Op Fl p | Fl -preserve-dates
39 .Op Fl s | Fl -strip-all
40 .Op Fl -strip-unneeded
41 .Op Fl w | Fl -wildcard
42 .Op Fl x | Fl -discard-all
43 .Op Fl I Ar format | Fl -input-target= Ns Ar format
44 .Op Fl K Ar symbol | Fl -keep-symbol= Ns Ar symbol
45 .Op Fl N Ar symbol | Fl -strip-symbol= Ns Ar symbol
46 .Op Fl O Ar format | Fl -output-target= Ns Ar format
47 .Op Fl R Ar sectionname | Fl -remove-section= Ns Ar sectionname
48 .Op Fl V | Fl -version
49 .Op Fl X | Fl -discard-locals
54 utility is used to discard information from the ELF objects
55 specified by the arguments
58 If an explicit output file name is not specified using the
62 utility will modify its input arguments in-place.
66 utility supports the following options:
67 .Bl -tag -width indent
68 .It Fl d | Fl g | Fl S | Fl -strip-debug
69 Remove debugging symbols only.
71 Print a help message and exit.
72 .It Fl -only-keep-debug
73 Remove all content except that which would be used for debugging.
74 .It Fl o Ar outputfile | Fl -output-file= Ns Ar outputfile
75 Write the stripped object to file
77 instead of modifying the input in-place.
78 Only a single input object should be specified if this option is used.
79 .It Fl p | Fl -preserve-dates
80 Preserve the object's access and modification times.
81 .It Fl s | Fl -strip-all
83 .It Fl -strip-unneeded
84 Remove all symbols not needed for further relocation processing.
85 .It Fl w | Fl -wildcard
86 Use shell-style patterns to name symbols.
87 The following meta-characters are recognized in patterns:
88 .Bl -tag -width "...." -compact
90 If this is the first character of the pattern, invert the sense of the
93 Matches any string of characters in a symbol name.
95 Matches zero or one character in a symbol name.
97 Mark the start of a character class.
99 Remove the special meaning of the next character in the pattern.
101 Mark the end of a character class.
103 .It Fl x | Fl -discard-all
104 Discard all non-global symbols.
105 .It Fl I Ar format | Fl -input-target= Ns Ar format
106 These options are accepted, but are ignored.
107 .It Fl K Ar symbol | Fl -keep-symbol= Ns Ar symbol
110 even if it would otherwise be stripped.
111 This option may be specified multiple times.
112 .It Fl N Ar symbol | Fl -strip-symbol= Ns Ar symbol
115 even if it would otherwise have been kept.
116 This option may be specified multiple times.
117 .It Fl O Ar format | Fl -output-target= Ns Ar format
118 Set the output file format to
120 For the full list of supported formats, please see the documentation
122 .Xr elftc_bfd_find_target 3 .
123 .It Fl R Ar sectionname | Fl -remove-section= Ns Ar sectionname
124 Remove the section named by the argument
126 This option may be specified multiple times.
127 .It Fl V | Fl -version
128 Print a version identifier and exit.
129 .It Fl X | Fl -discard-locals
130 Remove compiler-generated local symbols.
140 .Xr elftc_bfd_find_target 3 ,