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 2069 2011-10-26 15:53:48Z jkoshy $
26 .Dd September 17, 2011
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 ELF objects.
58 utility supports the following options:
59 .Bl -tag -width indent
60 .It Fl d | Fl g | Fl S | Fl -strip-debug
61 Remove debugging symbols only.
63 Print a help message and exit.
64 .It Fl -only-keep-debug
65 Remove all content except that which would be used for debugging.
66 .It Fl o Ar outputfile | Fl -output-file= Ns Ar outputfile
67 Write the stripped object to file
69 The default behaviour is to modify objects in place.
70 .It Fl p | Fl -preserve-dates
71 Preserve the object's access and modification times.
72 .It Fl s | Fl -strip-all
74 .It Fl -strip-unneeded
75 Remove all symbols not needed for further relocation processing.
76 .It Fl w | Fl -wildcard
77 Use shell-style patterns to name symbols.
78 The following meta-characters are recognized in patterns:
79 .Bl -tag -width "...." -compact
81 If this is the first character of the pattern, invert the sense of the
84 Matches any string of characters in a symbol name.
86 Matches zero or one character in a symbol name.
88 Mark the start of a character class.
90 Remove the special meaning of the next character in the pattern.
92 Mark the end of a character class.
94 .It Fl x | Fl -discard-all
95 Discard all non-global symbols.
96 .It Fl I Ar format | Fl -input-target= Ns Ar format
97 These options are accepted, but are ignored.
98 .It Fl K Ar symbol | Fl -keep-symbol= Ns Ar symbol
101 even if it would otherwise be stripped.
102 This option may be specified multiple times.
103 .It Fl N Ar symbol | Fl -strip-symbol= Ns Ar symbol
106 even if it would otherwise have been kept.
107 This option may be specified multiple times.
108 .It Fl O Ar format | Fl -output-target= Ns Ar format
109 Set the output file format to
111 For the full list of supported formats, please see the documentation
113 .Xr elftc_bfd_find_target 3 .
114 .It Fl R Ar sectionname | Fl -remove-section= Ns Ar sectionname
115 Remove the section named by the argument
117 This option may be specified multiple times.
118 .It Fl V | Fl -version
119 Print a version identifier and exit.
120 .It Fl X | Fl -discard-locals
121 Remove compiler-generated local symbols.
131 .Xr elftc_bfd_find_target 3 ,