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