2001-03-07 Andreas Jaeger <aj@suse.de>
[binutils-gdb.git] / binutils / strip.1
1 .\" Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 1998, 2000 Free Software Foundation
2 .\" See section COPYING for conditions for redistribution
3 .TH strip 1 "5 November 1991" "Free Software Foundation" "GNU Development Tools"
4 .de BP
5 .sp
6 .ti \-.2i
7 \(**
8 ..
9
10 .SH NAME
11 strip \- Discard symbols from object files.
12
13 .SH SYNOPSIS
14 .hy 0
15 .na
16 .TP
17 .B strip
18 .RB "[\|" \-F\ \fIbfdname\fR\ |\ \fB\-\-target=\fIbfdname\fP "\|]"
19 .RB "[\|" \-I\ \fIbfdname\fR\ |\ \fB\-\-input\-target=\fIbfdname\fP "\|]"
20 .RB "[\|" \-O\ \fIbfdname\fR\ |\ \fB\-\-output\-target=\fIbfdname\fP "\|]"
21 .RB "[\|" \-R\ \fIsectionname\fR\ |\ \fB\-\-remove\-section=\fIsectionname\fP "\|]"
22 .RB "[\|" \-s\fR\ |\ \fB\-\-strip\-all "\|]"
23 .RB "[\|" \-S\fR\ |\ \fB\-g\fR\ |\ \fB\-\-strip\-debug "\|]"
24 .RB "[\|" \-\-strip\-unneeded\fR "\|]"
25 .RB "[\|" \-x\fR\ |\ \fB\-\-discard\-all "\|]"
26 .RB "[\|" \-X\fR\ |\ \fB\-\-discard\-locals "\|]"
27 .RB "[\|" \-K\ \fIsymbolname\fR\ |\ \fB\-\-keep\-symbol=\fIsymbolname\fR "\|]"
28 .RB "[\|" \-N\ \fIsymbolname\fR\ |\ \fB\-\-strip\-symbol=\fIsymbolname\fR "\|]"
29 .RB "[\|" \-o\ \fIfile\fR "\|]"
30 .RB "[\|" \-p\fR\ |\ \fB\-\-preserve\-dates "\|]"
31 .RB "[\|" \-v\fR\ |\ \fB\-\-verbose "\|]"
32 .RB "[\|" \-V\fR\ |\ \fB\-\-version "\|]"
33 .RB "[\|" \-V\fR\ |\ \fB\-\-help "\|]"
34 .I objfile\c
35 \&.\|.\|.
36
37 .SH DESCRIPTION
38 GNU
39 .B strip
40 discards all symbols from the object files
41 .IR objfile .
42 The list of object files may include archives.
43 At least one object file must be given.
44
45 .P
46 .B strip
47 modifies the files named in its argument,
48 rather than writing modified copies under different names.
49
50 .SH OPTIONS
51 .TP
52 .B "\-F \fIbfdname"
53 .TP
54 .B "\-\-target=\fIbfdname"
55 Treat the original \fIobjfile\fP as a file with the object
56 code format \fIbfdname\fP, and rewrite it in the same format.
57
58 .TP
59 .B \-\-help
60 Show a summary of the options to
61 .B strip
62 and exit.
63
64 .TP
65 .B "\-I \fIbfdname
66 .TP
67 .B "\-\-input\-target=\fIbfdname"
68 Treat the original \fIobjfile\fP as a file with the object
69 code format \fIbfdname\fP.
70
71 .TP
72 .B "\-O \fIbfdname\fP"
73 .TP
74 .B "\-\-output\-target=\fIbfdname"
75 Replace \fIobjfile\fP with a file in the output format \fIbfdname\fP.
76
77 .TP
78 .B "\-R \fIsectionname\fP"
79 .TP
80 .B "\-\-remove\-section=\fIsectionname"
81 Remove the named section from the file. This option may be given more
82 than once. Note that using this option inappropriately may make the
83 object file unusable.
84
85 .TP
86 .B \-s
87 .TP
88 .B \-\-strip\-all
89 Remove all symbols.
90
91 .TP
92 .B \-S
93 .TP
94 .B \-g
95 .TP
96 .B \-\-strip\-debug
97 Remove debugging symbols only.
98
99 .TP
100 .B \-\-strip\-unneeded
101 Strip all symbols that are not needed for relocation processing.
102
103 .TP
104 .B \-N \fIsymbolname\fR
105 .TP
106 .B \-\-strip\-symbol=\fIsymbolname
107 Remove symbol \fIsymbolname\fP from the source file. This option
108 may be given more than once, and may be combined with other strip
109 options.
110
111 .TP
112 .B \-o \fIfile\fR
113 Put the stripped output in \fIfile\fR, rather than replacing the
114 existing file. When this argument is used, only one \fIobjfile\fR
115 argument may be specified.
116
117 .TP
118 .B \-p
119 .TP
120 .B \-\-preserve-dates
121 Preserve the access and modification dates of the file.
122
123 .TP
124 .B \-x
125 .TP
126 .B \-\-discard\-all
127 Remove non-global symbols.
128
129 .TP
130 .B \-X
131 .TP
132 .B \-\-discard\-locals
133 Remove compiler-generated local symbols.
134 (These usually start with ``L'' or ``.''.)
135
136 .TP
137 .B \-K \fIsymbolname\fR, \fB\-\-keep\-symbol=\fIsymbolname
138 Copy only symbol \fIsymbolname\fP from the source file. This option
139 may be given more than once.
140
141 .TP
142 .B \-N \fIsymbolname\fR, \fB\-\-strip\-symbol=\fIsymbolname
143 Do not copy symbol \fIsymbolname\fP from the source file. This option
144 may be given more than once, and may be combined with strip options
145 other than \fB\-K\fR.
146
147 .TP
148 .B \-v
149 .TP
150 .B \-\-verbose
151 Verbose output: list all object files modified. In the case of
152 archives,
153 .B "strip \-v"
154 lists all members of the archive.
155
156 .TP
157 .B \-V
158 .TP
159 .B \-\-version
160 Show the version number for \fBstrip\fP and exit.
161
162 .SH "SEE ALSO"
163 .RB "`\|" binutils "\|'"
164 entry in
165 .BR info ;
166 .IR "The GNU Binary Utilities" ,
167 Roland H. Pesch (October 1991).
168
169 .SH COPYING
170 Copyright (c) 1991, 2000 Free Software Foundation, Inc.
171 .PP
172 This document is distributed under the terms of the GNU Free
173 Documentation License, version 1.1. That license is described in the
174 sources for this manual page, but it is not displayed here in order to
175 make this manual more consise. Copies of this license can also be
176 obtained from: http://www.gnu.org/copyleft/.
177
178 \" .SH GNU Free Documentation License
179 \" Version 1.1, March 2000
180
181 \" Copyright (C) 2000 Free Software Foundation, Inc.
182 \" 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
183
184 \" Everyone is permitted to copy and distribute verbatim
185 \" copies of this license document, but changing it is
186 \" not allowed.
187 \" .PP
188 \" 0. PREAMBLE
189 \" .PP
190 \" The purpose of this License is to make a manual, textbook, or other
191 \" written document "free" in the sense of freedom: to assure everyone
192 \" the effective freedom to copy and redistribute it, with or without
193 \" modifying it, either commercially or noncommercially. Secondarily,
194 \" this License preserves for the author and publisher a way to get
195 \" credit for their work, while not being considered responsible for
196 \" modifications made by others.
197 \" .PP
198 \" This License is a kind of "copyleft", which means that derivative
199 \" works of the document must themselves be free in the same sense. It
200 \" complements the GNU General Public License, which is a copyleft
201 \" license designed for free software.
202 \" .PP
203 \" We have designed this License in order to use it for manuals for free
204 \" software, because free software needs free documentation: a free
205 \" program should come with manuals providing the same freedoms that the
206 \" software does. But this License is not limited to software manuals;
207 \" it can be used for any textual work, regardless of subject matter or
208 \" whether it is published as a printed book. We recommend this License
209 \" principally for works whose purpose is instruction or reference.
210 \" .PP
211 \" 1. APPLICABILITY AND DEFINITIONS
212 \" .PP
213 \" This License applies to any manual or other work that contains a
214 \" notice placed by the copyright holder saying it can be distributed
215 \" under the terms of this License. The "Document", below, refers to any
216 \" such manual or work. Any member of the public is a licensee, and is
217 \" addressed as "you".
218 \" .PP
219 \" A "Modified Version" of the Document means any work containing the
220 \" Document or a portion of it, either copied verbatim, or with
221 \" modifications and/or translated into another language.
222 \" .PP
223 \" A "Secondary Section" is a named appendix or a front-matter section of
224 \" the Document that deals exclusively with the relationship of the
225 \" publishers or authors of the Document to the Document's overall subject
226 \" (or to related matters) and contains nothing that could fall directly
227 \" within that overall subject. (For example, if the Document is in part a
228 \" textbook of mathematics, a Secondary Section may not explain any
229 \" mathematics.) The relationship could be a matter of historical
230 \" connection with the subject or with related matters, or of legal,
231 \" commercial, philosophical, ethical or political position regarding
232 \" them.
233 \" .PP
234 \" The "Invariant Sections" are certain Secondary Sections whose titles
235 \" are designated, as being those of Invariant Sections, in the notice
236 \" that says that the Document is released under this License.
237 \" .PP
238 \" The "Cover Texts" are certain short passages of text that are listed,
239 \" as Front-Cover Texts or Back-Cover Texts, in the notice that says that
240 \" the Document is released under this License.
241 \" .PP
242 \" A "Transparent" copy of the Document means a machine-readable copy,
243 \" represented in a format whose specification is available to the
244 \" general public, whose contents can be viewed and edited directly and
245 \" straightforwardly with generic text editors or (for images composed of
246 \" pixels) generic paint programs or (for drawings) some widely available
247 \" drawing editor, and that is suitable for input to text formatters or
248 \" for automatic translation to a variety of formats suitable for input
249 \" to text formatters. A copy made in an otherwise Transparent file
250 \" format whose markup has been designed to thwart or discourage
251 \" subsequent modification by readers is not Transparent. A copy that is
252 \" not "Transparent" is called "Opaque".
253 \" .PP
254 \" Examples of suitable formats for Transparent copies include plain
255 \" ASCII without markup, Texinfo input format, LaTeX input format, SGML
256 \" or XML using a publicly available DTD, and standard-conforming simple
257 \" HTML designed for human modification. Opaque formats include
258 \" PostScript, PDF, proprietary formats that can be read and edited only
259 \" by proprietary word processors, SGML or XML for which the DTD and/or
260 \" processing tools are not generally available, and the
261 \" machine-generated HTML produced by some word processors for output
262 \" purposes only.
263 \" .PP
264 \" The "Title Page" means, for a printed book, the title page itself,
265 \" plus such following pages as are needed to hold, legibly, the material
266 \" this License requires to appear in the title page. For works in
267 \" formats which do not have any title page as such, "Title Page" means
268 \" the text near the most prominent appearance of the work's title,
269 \" preceding the beginning of the body of the text.
270 \" .PP
271 \" 2. VERBATIM COPYING
272 \" .PP
273 \" You may copy and distribute the Document in any medium, either
274 \" commercially or noncommercially, provided that this License, the
275 \" copyright notices, and the license notice saying this License applies
276 \" to the Document are reproduced in all copies, and that you add no other
277 \" conditions whatsoever to those of this License. You may not use
278 \" technical measures to obstruct or control the reading or further
279 \" copying of the copies you make or distribute. However, you may accept
280 \" compensation in exchange for copies. If you distribute a large enough
281 \" number of copies you must also follow the conditions in section 3.
282 \" .PP
283 \" You may also lend copies, under the same conditions stated above, and
284 \" you may publicly display copies.
285 \" .PP
286 \" 3. COPYING IN QUANTITY
287 \" .PP
288 \" If you publish printed copies of the Document numbering more than 100,
289 \" and the Document's license notice requires Cover Texts, you must enclose
290 \" the copies in covers that carry, clearly and legibly, all these Cover
291 \" Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
292 \" the back cover. Both covers must also clearly and legibly identify
293 \" you as the publisher of these copies. The front cover must present
294 \" the full title with all words of the title equally prominent and
295 \" visible. You may add other material on the covers in addition.
296 \" Copying with changes limited to the covers, as long as they preserve
297 \" the title of the Document and satisfy these conditions, can be treated
298 \" as verbatim copying in other respects.
299 \" .PP
300 \" If the required texts for either cover are too voluminous to fit
301 \" legibly, you should put the first ones listed (as many as fit
302 \" reasonably) on the actual cover, and continue the rest onto adjacent
303 \" pages.
304 \" .PP
305 \" If you publish or distribute Opaque copies of the Document numbering
306 \" more than 100, you must either include a machine-readable Transparent
307 \" copy along with each Opaque copy, or state in or with each Opaque copy
308 \" a publicly-accessible computer-network location containing a complete
309 \" Transparent copy of the Document, free of added material, which the
310 \" general network-using public has access to download anonymously at no
311 \" charge using public-standard network protocols. If you use the latter
312 \" option, you must take reasonably prudent steps, when you begin
313 \" distribution of Opaque copies in quantity, to ensure that this
314 \" Transparent copy will remain thus accessible at the stated location
315 \" until at least one year after the last time you distribute an Opaque
316 \" copy (directly or through your agents or retailers) of that edition to
317 \" the public.
318 \" .PP
319 \" It is requested, but not required, that you contact the authors of the
320 \" Document well before redistributing any large number of copies, to give
321 \" them a chance to provide you with an updated version of the Document.
322 \" .PP
323 \" 4. MODIFICATIONS
324 \" .PP
325 \" You may copy and distribute a Modified Version of the Document under
326 \" the conditions of sections 2 and 3 above, provided that you release
327 \" the Modified Version under precisely this License, with the Modified
328 \" Version filling the role of the Document, thus licensing distribution
329 \" and modification of the Modified Version to whoever possesses a copy
330 \" of it. In addition, you must do these things in the Modified Version:
331 \" .PP
332 \" A. Use in the Title Page (and on the covers, if any) a title distinct
333 \" from that of the Document, and from those of previous versions
334 \" (which should, if there were any, be listed in the History section
335 \" of the Document). You may use the same title as a previous version
336 \" if the original publisher of that version gives permission.
337 \" .PP
338 \" B. List on the Title Page, as authors, one or more persons or entities
339 \" responsible for authorship of the modifications in the Modified
340 \" Version, together with at least five of the principal authors of the
341 \" Document (all of its principal authors, if it has less than five).
342 \" .PP
343 \" C. State on the Title page the name of the publisher of the
344 \" Modified Version, as the publisher.
345 \" .PP
346 \" D. Preserve all the copyright notices of the Document.
347 \" .PP
348 \" E. Add an appropriate copyright notice for your modifications
349 \" adjacent to the other copyright notices.
350 \" .PP
351 \" F. Include, immediately after the copyright notices, a license notice
352 \" giving the public permission to use the Modified Version under the
353 \" terms of this License, in the form shown in the Addendum below.
354 \" Preserve in that license notice the full lists of Invariant Sections
355 \" and required Cover Texts given in the Document's license notice.
356 \" .PP
357 \" H. Include an unaltered copy of this License.
358 \" .PP
359 \" I. Preserve the section entitled "History", and its title, and add to
360 \" it an item stating at least the title, year, new authors, and
361 \" publisher of the Modified Version as given on the Title Page. If
362 \" there is no section entitled "History" in the Document, create one
363 \" stating the title, year, authors, and publisher of the Document as
364 \" given on its Title Page, then add an item describing the Modified
365 \" Version as stated in the previous sentence.
366 \" .PP
367 \" J. Preserve the network location, if any, given in the Document for
368 \" public access to a Transparent copy of the Document, and likewise
369 \" the network locations given in the Document for previous versions
370 \" it was based on. These may be placed in the "History" section.
371 \" You may omit a network location for a work that was published at
372 \" least four years before the Document itself, or if the original
373 \" publisher of the version it refers to gives permission.
374 \" .PP
375 \" K. In any section entitled "Acknowledgements" or "Dedications",
376 \" preserve the section's title, and preserve in the section all the
377 \" substance and tone of each of the contributor acknowledgements
378 \" and/or dedications given therein.
379 \" .PP
380 \" L. Preserve all the Invariant Sections of the Document,
381 \" unaltered in their text and in their titles. Section numbers
382 \" or the equivalent are not considered part of the section titles.
383 \" .PP
384 \" M. Delete any section entitled "Endorsements". Such a section
385 \" may not be included in the Modified Version.
386 \" .PP
387 \" N. Do not retitle any existing section as "Endorsements"
388 \" or to conflict in title with any Invariant Section.
389 \" .PP
390 \" If the Modified Version includes new front-matter sections or
391 \" appendices that qualify as Secondary Sections and contain no material
392 \" copied from the Document, you may at your option designate some or all
393 \" of these sections as invariant. To do this, add their titles to the
394 \" list of Invariant Sections in the Modified Version's license notice.
395 \" These titles must be distinct from any other section titles.
396 \" .PP
397 \" You may add a section entitled "Endorsements", provided it contains
398 \" nothing but endorsements of your Modified Version by various
399 \" parties--for example, statements of peer review or that the text has
400 \" been approved by an organization as the authoritative definition of a
401 \" standard.
402 \" .PP
403 \" You may add a passage of up to five words as a Front-Cover Text, and a
404 \" passage of up to 25 words as a Back-Cover Text, to the end of the list
405 \" of Cover Texts in the Modified Version. Only one passage of
406 \" Front-Cover Text and one of Back-Cover Text may be added by (or
407 \" through arrangements made by) any one entity. If the Document already
408 \" includes a cover text for the same cover, previously added by you or
409 \" by arrangement made by the same entity you are acting on behalf of,
410 \" you may not add another; but you may replace the old one, on explicit
411 \" permission from the previous publisher that added the old one.
412 \" .PP
413 \" The author(s) and publisher(s) of the Document do not by this License
414 \" give permission to use their names for publicity for or to assert or
415 \" imply endorsement of any Modified Version.
416 \" .PP
417
418 \" 5. COMBINING DOCUMENTS
419 \" .PP
420 \" You may combine the Document with other documents released under this
421 \" License, under the terms defined in section 4 above for modified
422 \" versions, provided that you include in the combination all of the
423 \" Invariant Sections of all of the original documents, unmodified, and
424 \" list them all as Invariant Sections of your combined work in its
425 \" license notice.
426 \" .PP
427 \" The combined work need only contain one copy of this License, and
428 \" multiple identical Invariant Sections may be replaced with a single
429 \" copy. If there are multiple Invariant Sections with the same name but
430 \" different contents, make the title of each such section unique by
431 \" adding at the end of it, in parentheses, the name of the original
432 \" author or publisher of that section if known, or else a unique number.
433 \" Make the same adjustment to the section titles in the list of
434 \" Invariant Sections in the license notice of the combined work.
435 \" .PP
436 \" In the combination, you must combine any sections entitled "History"
437 \" in the various original documents, forming one section entitled
438 \" "History"; likewise combine any sections entitled "Acknowledgements",
439 \" and any sections entitled "Dedications". You must delete all sections
440 \" entitled "Endorsements."
441 \" .PP
442
443 \" 6. COLLECTIONS OF DOCUMENTS
444 \" .PP
445 \" You may make a collection consisting of the Document and other documents
446 \" released under this License, and replace the individual copies of this
447 \" License in the various documents with a single copy that is included in
448 \" the collection, provided that you follow the rules of this License for
449 \" verbatim copying of each of the documents in all other respects.
450 \" .PP
451 \" You may extract a single document from such a collection, and distribute
452 \" it individually under this License, provided you insert a copy of this
453 \" License into the extracted document, and follow this License in all
454 \" other respects regarding verbatim copying of that document.
455 \" .PP
456
457 \" 7. AGGREGATION WITH INDEPENDENT WORKS
458 \" .PP
459 \" A compilation of the Document or its derivatives with other separate
460 \" and independent documents or works, in or on a volume of a storage or
461 \" distribution medium, does not as a whole count as a Modified Version
462 \" of the Document, provided no compilation copyright is claimed for the
463 \" compilation. Such a compilation is called an "aggregate", and this
464 \" License does not apply to the other self-contained works thus compiled
465 \" with the Document, on account of their being thus compiled, if they
466 \" are not themselves derivative works of the Document.
467 \" .PP
468 \" If the Cover Text requirement of section 3 is applicable to these
469 \" copies of the Document, then if the Document is less than one quarter
470 \" of the entire aggregate, the Document's Cover Texts may be placed on
471 \" covers that surround only the Document within the aggregate.
472 \" Otherwise they must appear on covers around the whole aggregate.
473 \" .PP
474
475 \" 8. TRANSLATION
476 \" .PP
477 \" Translation is considered a kind of modification, so you may
478 \" distribute translations of the Document under the terms of section 4.
479 \" Replacing Invariant Sections with translations requires special
480 \" permission from their copyright holders, but you may include
481 \" translations of some or all Invariant Sections in addition to the
482 \" original versions of these Invariant Sections. You may include a
483 \" translation of this License provided that you also include the
484 \" original English version of this License. In case of a disagreement
485 \" between the translation and the original English version of this
486 \" License, the original English version will prevail.
487 \" .PP
488
489 \" 9. TERMINATION
490 \" .PP
491 \" You may not copy, modify, sublicense, or distribute the Document except
492 \" as expressly provided for under this License. Any other attempt to
493 \" copy, modify, sublicense or distribute the Document is void, and will
494 \" automatically terminate your rights under this License. However,
495 \" parties who have received copies, or rights, from you under this
496 \" License will not have their licenses terminated so long as such
497 \" parties remain in full compliance.
498 \" .PP
499
500 \" 10. FUTURE REVISIONS OF THIS LICENSE
501 \" .PP
502 \" The Free Software Foundation may publish new, revised versions
503 \" of the GNU Free Documentation License from time to time. Such new
504 \" versions will be similar in spirit to the present version, but may
505 \" differ in detail to address new problems or concerns. See
506 \" http://www.gnu.org/copyleft/.
507 \" .PP
508 \" Each version of the License is given a distinguishing version number.
509 \" If the Document specifies that a particular numbered version of this
510 \" License "or any later version" applies to it, you have the option of
511 \" following the terms and conditions either of that specified version or
512 \" of any later version that has been published (not as a draft) by the
513 \" Free Software Foundation. If the Document does not specify a version
514 \" number of this License, you may choose any version ever published (not
515 \" as a draft) by the Free Software Foundation.
516 \" .PP
517
518 \" ADDENDUM: How to use this License for your documents
519 \" .PP
520 \" To use this License in a document you have written, include a copy of
521 \" the License in the document and put the following copyright and
522 \" license notices just after the title page:
523 \" .PP
524 \" Copyright (c) YEAR YOUR NAME.
525 \" Permission is granted to copy, distribute and/or
526 \" modify this document under the terms of the GNU
527 \" Free Documentation License, Version 1.1 or any later
528 \" version published by the Free Software Foundation;
529 \" with the Invariant Sections being LIST THEIR TITLES,
530 \" with the Front-Cover Texts being LIST, and with the
531 \" Back-Cover Texts being LIST. A copy of the license
532 \" is included in the section entitled "GNU Free
533 \" Documentation License".
534 \" .PP
535 \" If you have no Invariant Sections, write "with no Invariant Sections"
536 \" instead of saying which ones are invariant. If you have no
537 \" Front-Cover Texts, write "no Front-Cover Texts" instead of
538 \" "Front-Cover Texts being LIST"; likewise for Back-Cover Texts.
539 \" .PP
540 \" If your document contains nontrivial examples of program code, we
541 \" recommend releasing these examples in parallel under your choice of
542 \" free software license, such as the GNU General Public License,
543 \" to permit their use in free software.