]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - gnu/usr.bin/binutils/strip/strip.1
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / gnu / usr.bin / binutils / strip / strip.1
1 .\" $FreeBSD$
2 .\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" Set up some character translations and predefined strings.  \*(-- will
20 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
21 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
22 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
23 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
24 .\" nothing in troff, for use with C<>.
25 .tr \(*W-
26 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
27 .ie n \{\
28 .    ds -- \(*W-
29 .    ds PI pi
30 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
31 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
32 .    ds L" ""
33 .    ds R" ""
34 .    ds C` ""
35 .    ds C' ""
36 'br\}
37 .el\{\
38 .    ds -- \|\(em\|
39 .    ds PI \(*p
40 .    ds L" ``
41 .    ds R" ''
42 'br\}
43 .\"
44 .\" Escape single quotes in literal strings from groff's Unicode transform.
45 .ie \n(.g .ds Aq \(aq
46 .el       .ds Aq '
47 .\"
48 .\" If the F register is turned on, we'll generate index entries on stderr for
49 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
50 .\" entries marked with X<> in POD.  Of course, you'll have to process the
51 .\" output yourself in some meaningful fashion.
52 .ie \nF \{\
53 .    de IX
54 .    tm Index:\\$1\t\\n%\t"\\$2"
55 ..
56 .    nr % 0
57 .    rr F
58 .\}
59 .el \{\
60 .    de IX
61 ..
62 .\}
63 .\"
64 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
65 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
66 .    \" fudge factors for nroff and troff
67 .if n \{\
68 .    ds #H 0
69 .    ds #V .8m
70 .    ds #F .3m
71 .    ds #[ \f1
72 .    ds #] \fP
73 .\}
74 .if t \{\
75 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
76 .    ds #V .6m
77 .    ds #F 0
78 .    ds #[ \&
79 .    ds #] \&
80 .\}
81 .    \" simple accents for nroff and troff
82 .if n \{\
83 .    ds ' \&
84 .    ds ` \&
85 .    ds ^ \&
86 .    ds , \&
87 .    ds ~ ~
88 .    ds /
89 .\}
90 .if t \{\
91 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
92 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
93 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
94 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
95 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
96 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
97 .\}
98 .    \" troff and (daisy-wheel) nroff accents
99 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
100 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
101 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
102 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
103 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
104 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
105 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
106 .ds ae a\h'-(\w'a'u*4/10)'e
107 .ds Ae A\h'-(\w'A'u*4/10)'E
108 .    \" corrections for vroff
109 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
110 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
111 .    \" for low resolution devices (crt and lpr)
112 .if \n(.H>23 .if \n(.V>19 \
113 \{\
114 .    ds : e
115 .    ds 8 ss
116 .    ds o a
117 .    ds d- d\h'-1'\(ga
118 .    ds D- D\h'-1'\(hy
119 .    ds th \o'bp'
120 .    ds Th \o'LP'
121 .    ds ae ae
122 .    ds Ae AE
123 .\}
124 .rm #[ #] #H #V #F C
125 .\" ========================================================================
126 .\"
127 .IX Title "STRIP 1"
128 .TH STRIP 1 "2010-10-30" "binutils-2.17.50" "GNU Development Tools"
129 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
130 .\" way too many mistakes in technical documents.
131 .if n .ad l
132 .nh
133 .SH "NAME"
134 strip \- Discard symbols from object files
135 .SH "SYNOPSIS"
136 .IX Header "SYNOPSIS"
137 strip [\fB\-F\fR \fIbfdname\fR |\fB\-\-target=\fR\fIbfdname\fR]
138       [\fB\-I\fR \fIbfdname\fR |\fB\-\-input\-target=\fR\fIbfdname\fR]
139       [\fB\-O\fR \fIbfdname\fR |\fB\-\-output\-target=\fR\fIbfdname\fR]
140       [\fB\-s\fR|\fB\-\-strip\-all\fR]
141       [\fB\-S\fR|\fB\-g\fR|\fB\-d\fR|\fB\-\-strip\-debug\fR]
142       [\fB\-K\fR \fIsymbolname\fR |\fB\-\-keep\-symbol=\fR\fIsymbolname\fR]
143       [\fB\-N\fR \fIsymbolname\fR |\fB\-\-strip\-symbol=\fR\fIsymbolname\fR]
144       [\fB\-w\fR|\fB\-\-wildcard\fR]
145       [\fB\-x\fR|\fB\-\-discard\-all\fR] [\fB\-X\fR |\fB\-\-discard\-locals\fR]
146       [\fB\-R\fR \fIsectionname\fR |\fB\-\-remove\-section=\fR\fIsectionname\fR]
147       [\fB\-o\fR \fIfile\fR] [\fB\-p\fR|\fB\-\-preserve\-dates\fR]
148       [\fB\-\-keep\-file\-symbols\fR]
149       [\fB\-\-only\-keep\-debug\fR]
150       [\fB\-v\fR |\fB\-\-verbose\fR] [\fB\-V\fR|\fB\-\-version\fR]
151       [\fB\-\-help\fR] [\fB\-\-info\fR]
152       \fIobjfile\fR...
153 .SH "DESCRIPTION"
154 .IX Header "DESCRIPTION"
155 \&\s-1GNU\s0 \fBstrip\fR discards all symbols from object files
156 \&\fIobjfile\fR.  The list of object files may include archives.
157 At least one object file must be given.
158 .PP
159 \&\fBstrip\fR modifies the files named in its argument,
160 rather than writing modified copies under different names.
161 .SH "OPTIONS"
162 .IX Header "OPTIONS"
163 .IP "\fB\-F\fR \fIbfdname\fR" 4
164 .IX Item "-F bfdname"
165 .PD 0
166 .IP "\fB\-\-target=\fR\fIbfdname\fR" 4
167 .IX Item "--target=bfdname"
168 .PD
169 Treat the original \fIobjfile\fR as a file with the object
170 code format \fIbfdname\fR, and rewrite it in the same format.
171 .IP "\fB\-\-help\fR" 4
172 .IX Item "--help"
173 Show a summary of the options to \fBstrip\fR and exit.
174 .IP "\fB\-\-info\fR" 4
175 .IX Item "--info"
176 Display a list showing all architectures and object formats available.
177 .IP "\fB\-I\fR \fIbfdname\fR" 4
178 .IX Item "-I bfdname"
179 .PD 0
180 .IP "\fB\-\-input\-target=\fR\fIbfdname\fR" 4
181 .IX Item "--input-target=bfdname"
182 .PD
183 Treat the original \fIobjfile\fR as a file with the object
184 code format \fIbfdname\fR.
185 .IP "\fB\-O\fR \fIbfdname\fR" 4
186 .IX Item "-O bfdname"
187 .PD 0
188 .IP "\fB\-\-output\-target=\fR\fIbfdname\fR" 4
189 .IX Item "--output-target=bfdname"
190 .PD
191 Replace \fIobjfile\fR with a file in the output format \fIbfdname\fR.
192 .IP "\fB\-R\fR \fIsectionname\fR" 4
193 .IX Item "-R sectionname"
194 .PD 0
195 .IP "\fB\-\-remove\-section=\fR\fIsectionname\fR" 4
196 .IX Item "--remove-section=sectionname"
197 .PD
198 Remove any section named \fIsectionname\fR from the output file.  This
199 option may be given more than once.  Note that using this option
200 inappropriately may make the output file unusable.
201 .IP "\fB\-s\fR" 4
202 .IX Item "-s"
203 .PD 0
204 .IP "\fB\-\-strip\-all\fR" 4
205 .IX Item "--strip-all"
206 .PD
207 Remove all symbols.
208 .IP "\fB\-g\fR" 4
209 .IX Item "-g"
210 .PD 0
211 .IP "\fB\-S\fR" 4
212 .IX Item "-S"
213 .IP "\fB\-d\fR" 4
214 .IX Item "-d"
215 .IP "\fB\-\-strip\-debug\fR" 4
216 .IX Item "--strip-debug"
217 .PD
218 Remove debugging symbols only.
219 .IP "\fB\-\-strip\-unneeded\fR" 4
220 .IX Item "--strip-unneeded"
221 Remove all symbols that are not needed for relocation processing.
222 .IP "\fB\-K\fR \fIsymbolname\fR" 4
223 .IX Item "-K symbolname"
224 .PD 0
225 .IP "\fB\-\-keep\-symbol=\fR\fIsymbolname\fR" 4
226 .IX Item "--keep-symbol=symbolname"
227 .PD
228 When stripping symbols, keep symbol \fIsymbolname\fR even if it would
229 normally be stripped.  This option may be given more than once.
230 .IP "\fB\-N\fR \fIsymbolname\fR" 4
231 .IX Item "-N symbolname"
232 .PD 0
233 .IP "\fB\-\-strip\-symbol=\fR\fIsymbolname\fR" 4
234 .IX Item "--strip-symbol=symbolname"
235 .PD
236 Remove symbol \fIsymbolname\fR from the source file. This option may be
237 given more than once, and may be combined with strip options other than
238 \&\fB\-K\fR.
239 .IP "\fB\-o\fR \fIfile\fR" 4
240 .IX Item "-o file"
241 Put the stripped output in \fIfile\fR, rather than replacing the
242 existing file.  When this argument is used, only one \fIobjfile\fR
243 argument may be specified.
244 .IP "\fB\-p\fR" 4
245 .IX Item "-p"
246 .PD 0
247 .IP "\fB\-\-preserve\-dates\fR" 4
248 .IX Item "--preserve-dates"
249 .PD
250 Preserve the access and modification dates of the file.
251 .IP "\fB\-w\fR" 4
252 .IX Item "-w"
253 .PD 0
254 .IP "\fB\-\-wildcard\fR" 4
255 .IX Item "--wildcard"
256 .PD
257 Permit regular expressions in \fIsymbolname\fRs used in other command
258 line options.  The question mark (?), asterisk (*), backslash (\e) and
259 square brackets ([]) operators can be used anywhere in the symbol
260 name.  If the first character of the symbol name is the exclamation
261 point (!) then the sense of the switch is reversed for that symbol.
262 For example:
263 .Sp
264 .Vb 1
265 \&          \-w \-K !foo \-K fo*
266 .Ve
267 .Sp
268 would cause strip to only keep symbols that start with the letters
269 \&\*(L"fo\*(R", but to discard the symbol \*(L"foo\*(R".
270 .IP "\fB\-x\fR" 4
271 .IX Item "-x"
272 .PD 0
273 .IP "\fB\-\-discard\-all\fR" 4
274 .IX Item "--discard-all"
275 .PD
276 Remove non-global symbols.
277 .IP "\fB\-X\fR" 4
278 .IX Item "-X"
279 .PD 0
280 .IP "\fB\-\-discard\-locals\fR" 4
281 .IX Item "--discard-locals"
282 .PD
283 Remove compiler-generated local symbols.
284 (These usually start with \fBL\fR or \fB.\fR.)
285 .IP "\fB\-\-keep\-file\-symbols\fR" 4
286 .IX Item "--keep-file-symbols"
287 When stripping a file, perhaps with \fB\-\-strip\-debug\fR or
288 \&\fB\-\-strip\-unneeded\fR, retain any symbols specifying source file names,
289 which would otherwise get stripped.
290 .IP "\fB\-\-only\-keep\-debug\fR" 4
291 .IX Item "--only-keep-debug"
292 Strip a file, removing contents of any sections that would not be
293 stripped by \fB\-\-strip\-debug\fR and leaving the debugging sections
294 intact.  In \s-1ELF\s0 files, this preserves all note sections in the output.
295 .Sp
296 The intention is that this option will be used in conjunction with
297 \&\fB\-\-add\-gnu\-debuglink\fR to create a two part executable.  One a
298 stripped binary which will occupy less space in \s-1RAM\s0 and in a
299 distribution and the second a debugging information file which is only
300 needed if debugging abilities are required.  The suggested procedure
301 to create these files is as follows:
302 .RS 4
303 .IP "1.<Link the executable as normal.  Assuming that it is called>" 4
304 .IX Item "1.<Link the executable as normal.  Assuming that it is called>"
305 \&\f(CW\*(C`foo\*(C'\fR then...
306 .ie n .IP "1.<Run ""objcopy \-\-only\-keep\-debug foo foo.dbg"" to>" 4
307 .el .IP "1.<Run \f(CWobjcopy \-\-only\-keep\-debug foo foo.dbg\fR to>" 4
308 .IX Item "1.<Run objcopy --only-keep-debug foo foo.dbg to>"
309 create a file containing the debugging info.
310 .ie n .IP "1.<Run ""objcopy \-\-strip\-debug foo"" to create a>" 4
311 .el .IP "1.<Run \f(CWobjcopy \-\-strip\-debug foo\fR to create a>" 4
312 .IX Item "1.<Run objcopy --strip-debug foo to create a>"
313 stripped executable.
314 .ie n .IP "1.<Run ""objcopy \-\-add\-gnu\-debuglink=foo.dbg foo"">" 4
315 .el .IP "1.<Run \f(CWobjcopy \-\-add\-gnu\-debuglink=foo.dbg foo\fR>" 4
316 .IX Item "1.<Run objcopy --add-gnu-debuglink=foo.dbg foo>"
317 to add a link to the debugging info into the stripped executable.
318 .RE
319 .RS 4
320 .Sp
321 Note \- the choice of \f(CW\*(C`.dbg\*(C'\fR as an extension for the debug info
322 file is arbitrary.  Also the \f(CW\*(C`\-\-only\-keep\-debug\*(C'\fR step is
323 optional.  You could instead do this:
324 .IP "1.<Link the executable as normal.>" 4
325 .IX Item "1.<Link the executable as normal.>"
326 .PD 0
327 .ie n .IP "1.<Copy ""foo"" to  ""foo.full"">" 4
328 .el .IP "1.<Copy \f(CWfoo\fR to  \f(CWfoo.full\fR>" 4
329 .IX Item "1.<Copy foo to  foo.full>"
330 .ie n .IP "1.<Run ""strip \-\-strip\-debug foo"">" 4
331 .el .IP "1.<Run \f(CWstrip \-\-strip\-debug foo\fR>" 4
332 .IX Item "1.<Run strip --strip-debug foo>"
333 .ie n .IP "1.<Run ""objcopy \-\-add\-gnu\-debuglink=foo.full foo"">" 4
334 .el .IP "1.<Run \f(CWobjcopy \-\-add\-gnu\-debuglink=foo.full foo\fR>" 4
335 .IX Item "1.<Run objcopy --add-gnu-debuglink=foo.full foo>"
336 .RE
337 .RS 4
338 .PD
339 .Sp
340 ie the file pointed to by the \fB\-\-add\-gnu\-debuglink\fR can be the
341 full executable.  It does not have to be a file created by the
342 \&\fB\-\-only\-keep\-debug\fR switch.
343 .Sp
344 Note \- this switch is only intended for use on fully linked files.  It
345 does not make sense to use it on object files where the debugging
346 information may be incomplete.  Besides the gnu_debuglink feature
347 currently only supports the presence of one filename containing
348 debugging information, not multiple filenames on a one-per-object-file
349 basis.
350 .RE
351 .IP "\fB\-V\fR" 4
352 .IX Item "-V"
353 .PD 0
354 .IP "\fB\-\-version\fR" 4
355 .IX Item "--version"
356 .PD
357 Show the version number for \fBstrip\fR.
358 .IP "\fB\-v\fR" 4
359 .IX Item "-v"
360 .PD 0
361 .IP "\fB\-\-verbose\fR" 4
362 .IX Item "--verbose"
363 .PD
364 Verbose output: list all object files modified.  In the case of
365 archives, \fBstrip \-v\fR lists all members of the archive.
366 .IP "\fB@\fR\fIfile\fR" 4
367 .IX Item "@file"
368 Read command-line options from \fIfile\fR.  The options read are
369 inserted in place of the original @\fIfile\fR option.  If \fIfile\fR
370 does not exist, or cannot be read, then the option will be treated
371 literally, and not removed.
372 .Sp
373 Options in \fIfile\fR are separated by whitespace.  A whitespace
374 character may be included in an option by surrounding the entire
375 option in either single or double quotes.  Any character (including a
376 backslash) may be included by prefixing the character to be included
377 with a backslash.  The \fIfile\fR may itself contain additional
378 @\fIfile\fR options; any such options will be processed recursively.
379 .SH "SEE ALSO"
380 .IX Header "SEE ALSO"
381 the Info entries for \fIbinutils\fR.
382 .SH "COPYRIGHT"
383 .IX Header "COPYRIGHT"
384 Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
385 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
386 .PP
387 Permission is granted to copy, distribute and/or modify this document
388 under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1
389 or any later version published by the Free Software Foundation;
390 with no Invariant Sections, with no Front-Cover Texts, and with no
391 Back-Cover Texts.  A copy of the license is included in the
392 section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".