1STRIP(1)                     GNU Development Tools                    STRIP(1)
2
3
4

NAME

6       strip - Discard symbols from object files.
7

SYNOPSIS

9       strip [-F bfdname ⎪--target=bfdname]
10             [-I bfdname ⎪--input-target=bfdname]
11             [-O bfdname ⎪--output-target=bfdname]
12             [-s--strip-all]
13             [-S-g-d--strip-debug]
14             [-K symbolname ⎪--keep-symbol=symbolname]
15             [-N symbolname ⎪--strip-symbol=symbolname]
16             [-w--wildcard]
17             [-x--discard-all] [-X --discard-locals]
18             [-R sectionname ⎪--remove-section=sectionname]
19             [-o file] [-p--preserve-dates]
20             [--keep-file-symbols]
21             [--only-keep-debug]
22             [-v --verbose] [-V--version]
23             [--help] [--info]
24             objfile...
25

DESCRIPTION

27       GNU  strip discards all symbols from object files objfile.  The list of
28       object files may include archives.  At least one object  file  must  be
29       given.
30
31       strip  modifies  the  files  named in its argument, rather than writing
32       modified copies under different names.
33

OPTIONS

35       -F bfdname
36       --target=bfdname
37           Treat the original objfile as a file with the  object  code  format
38           bfdname, and rewrite it in the same format.
39
40       --help
41           Show a summary of the options to strip and exit.
42
43       --info
44           Display  a list showing all architectures and object formats avail‐
45           able.
46
47       -I bfdname
48       --input-target=bfdname
49           Treat the original objfile as a file with the  object  code  format
50           bfdname.
51
52       -O bfdname
53       --output-target=bfdname
54           Replace objfile with a file in the output format bfdname.
55
56       -R sectionname
57       --remove-section=sectionname
58           Remove  any  section  named sectionname from the output file.  This
59           option may be given more than once.  Note that  using  this  option
60           inappropriately may make the output file unusable.
61
62       -s
63       --strip-all
64           Remove all symbols.
65
66       -g
67       -S
68       -d
69       --strip-debug
70           Remove debugging symbols only.
71
72       --strip-unneeded
73           Remove all symbols that are not needed for relocation processing.
74
75       -K symbolname
76       --keep-symbol=symbolname
77           When  stripping  symbols,  keep  symbol symbolname even if it would
78           normally be stripped.  This option may be given more than once.
79
80       -N symbolname
81       --strip-symbol=symbolname
82           Remove symbol symbolname from the source file. This option  may  be
83           given  more than once, and may be combined with strip options other
84           than -K.
85
86       -o file
87           Put the stripped output in file, rather than replacing the existing
88           file.  When this argument is used, only one objfile argument may be
89           specified.
90
91       -p
92       --preserve-dates
93           Preserve the access and modification dates of the file.
94
95       -w
96       --wildcard
97           Permit regular expressions in symbolnames  used  in  other  command
98           line  options.   The question mark (?), asterisk (*), backslash (\)
99           and square brackets ([]) operators can be used anywhere in the sym‐
100           bol  name.  If the first character of the symbol name is the excla‐
101           mation point (!) then the sense of the switch is reversed for  that
102           symbol.  For example:
103
104                     -w -K !foo -K fo*
105
106           would  cause strip to only keep symbols that start with the letters
107           "fo", but to discard the symbol "foo".
108
109       -x
110       --discard-all
111           Remove non-global symbols.
112
113       -X
114       --discard-locals
115           Remove compiler-generated local symbols.  (These usually start with
116           L or ..)
117
118       --keep-file-symbols
119           When    stripping   a   file,   perhaps   with   --strip-debug   or
120           --strip-unneeded, retain any symbols specifying source file  names,
121           which would otherwise get stripped.
122
123       --only-keep-debug
124           Strip  a  file,  removing  any  sections  that would be stripped by
125           --strip-debug and leaving the debugging sections.
126
127           The intention is that this option will be used in conjunction  with
128           --add-gnu-debuglink  to  create  a  two  part  executable.   One  a
129           stripped binary which will occupy less space in RAM and in  a  dis‐
130           tribution and the second a debugging information file which is only
131           needed if debugging abilities are required.  The  suggested  proce‐
132           dure to create these files is as follows:
133
134           1.<Link the executable as normal.  Assuming that is is called>
135               "foo" then...
136
137           1.<Run "objcopy --only-keep-debug foo foo.dbg" to>
138               create a file containing the debugging info.
139
140           1.<Run "objcopy --strip-debug foo" to create a>
141               stripped executable.
142
143           1.<Run "objcopy --add-gnu-debuglink=foo.dbg foo">
144               to  add  a  link  to  the debugging info into the stripped exe‐
145               cutable.
146
147           Note - the choice of ".dbg" as an extension for the debug info file
148           is  arbitrary.  Also the "--only-keep-debug" step is optional.  You
149           could instead do this:
150
151           1.<Link the executable as normal.>
152           1.<Copy "foo" to  "foo.full">
153           1.<Run "strip --strip-debug foo">
154           1.<Run "objcopy --add-gnu-debuglink=foo.full foo">
155
156           ie the file pointed to by the --add-gnu-debuglink can be  the  full
157           executable.   It  does  not  have  to  be  a  file  created  by the
158           --only-keep-debug switch.
159
160           Note - this switch is only intended for use on fully linked  files.
161           It  does  not make sense to use it on object files where the debug‐
162           ging information may be incomplete.  Besides the gnu_debuglink fea‐
163           ture  currently only supports the presence of one filename contain‐
164           ing debugging information, not multiple  filenames  on  a  one-per-
165           object-file basis.
166
167       -V
168       --version
169           Show the version number for strip.
170
171       -v
172       --verbose
173           Verbose output: list all object files modified.  In the case of ar‐
174           chives, strip -v lists all members of the archive.
175
176       @file
177           Read command-line options from file.  The options read are inserted
178           in  place of the original @file option.  If file does not exist, or
179           cannot be read, then the option will be treated literally, and  not
180           removed.
181
182           Options  in file are separated by whitespace.  A whitespace charac‐
183           ter may be included in an option by surrounding the  entire  option
184           in  either  single  or  double  quotes.  Any character (including a
185           backslash) may  be  included  by  prefixing  the  character  to  be
186           included  with a backslash.  The file may itself contain additional
187           @file options; any such options will be processed recursively.
188

SEE ALSO

190       the Info entries for binutils.
191
193       Copyright (c) 1991, 1992, 1993, 1994, 1995,  1996,  1997,  1998,  1999,
194       2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
195
196       Permission  is  granted to copy, distribute and/or modify this document
197       under the terms of the GNU Free Documentation License, Version  1.1  or
198       any  later  version  published by the Free Software Foundation; with no
199       Invariant Sections, with no Front-Cover Texts, and with  no  Back-Cover
200       Texts.   A copy of the license is included in the section entitled "GNU
201       Free Documentation License".
202
203
204
205binutils-2.17.50.0.12-4           2007-04-14                          STRIP(1)
Impressum