Merge branch 'vendor/OPENSSL'
[dragonfly.git] / contrib / binutils-2.25 / binutils / doc / objcopy.1
1 .\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
6 .if t .sp .5v
7 .if n .sp
8 ..
9 .de Vb \" Begin verbatim text
10 .ft CW
11 .nf
12 .ne \\$1
13 ..
14 .de Ve \" End verbatim text
15 .ft R
16 .fi
17 ..
18 .\" Set up some character translations and predefined strings.  \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
21 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
24 .tr \(*W-
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26 .ie n \{\
27 .    ds -- \(*W-
28 .    ds PI pi
29 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
31 .    ds L" ""
32 .    ds R" ""
33 .    ds C` ""
34 .    ds C' ""
35 'br\}
36 .el\{\
37 .    ds -- \|\(em\|
38 .    ds PI \(*p
39 .    ds L" ``
40 .    ds R" ''
41 .    ds C`
42 .    ds C'
43 'br\}
44 .\"
45 .\" Escape single quotes in literal strings from groff's Unicode transform.
46 .ie \n(.g .ds Aq \(aq
47 .el       .ds Aq '
48 .\"
49 .\" If the F register is turned on, we'll generate index entries on stderr for
50 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
51 .\" entries marked with X<> in POD.  Of course, you'll have to process the
52 .\" output yourself in some meaningful fashion.
53 .\"
54 .\" Avoid warning from groff about undefined register 'F'.
55 .de IX
56 ..
57 .nr rF 0
58 .if \n(.g .if rF .nr rF 1
59 .if (\n(rF:(\n(.g==0)) \{
60 .    if \nF \{
61 .        de IX
62 .        tm Index:\\$1\t\\n%\t"\\$2"
63 ..
64 .        if !\nF==2 \{
65 .            nr % 0
66 .            nr F 2
67 .        \}
68 .    \}
69 .\}
70 .rr rF
71 .\"
72 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
73 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
74 .    \" fudge factors for nroff and troff
75 .if n \{\
76 .    ds #H 0
77 .    ds #V .8m
78 .    ds #F .3m
79 .    ds #[ \f1
80 .    ds #] \fP
81 .\}
82 .if t \{\
83 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
84 .    ds #V .6m
85 .    ds #F 0
86 .    ds #[ \&
87 .    ds #] \&
88 .\}
89 .    \" simple accents for nroff and troff
90 .if n \{\
91 .    ds ' \&
92 .    ds ` \&
93 .    ds ^ \&
94 .    ds , \&
95 .    ds ~ ~
96 .    ds /
97 .\}
98 .if t \{\
99 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
100 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
101 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
102 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
103 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
104 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
105 .\}
106 .    \" troff and (daisy-wheel) nroff accents
107 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
108 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
109 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
110 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
111 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
112 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
113 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
114 .ds ae a\h'-(\w'a'u*4/10)'e
115 .ds Ae A\h'-(\w'A'u*4/10)'E
116 .    \" corrections for vroff
117 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
118 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
119 .    \" for low resolution devices (crt and lpr)
120 .if \n(.H>23 .if \n(.V>19 \
121 \{\
122 .    ds : e
123 .    ds 8 ss
124 .    ds o a
125 .    ds d- d\h'-1'\(ga
126 .    ds D- D\h'-1'\(hy
127 .    ds th \o'bp'
128 .    ds Th \o'LP'
129 .    ds ae ae
130 .    ds Ae AE
131 .\}
132 .rm #[ #] #H #V #F C
133 .\" ========================================================================
134 .\"
135 .IX Title "OBJCOPY 1"
136 .TH OBJCOPY 1 "2014-12-23" "binutils-2.25" "GNU Development Tools"
137 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
138 .\" way too many mistakes in technical documents.
139 .if n .ad l
140 .nh
141 .SH "NAME"
142 objcopy \- copy and translate object files
143 .SH "SYNOPSIS"
144 .IX Header "SYNOPSIS"
145 objcopy [\fB\-F\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR]
146         [\fB\-I\fR \fIbfdname\fR|\fB\-\-input\-target=\fR\fIbfdname\fR]
147         [\fB\-O\fR \fIbfdname\fR|\fB\-\-output\-target=\fR\fIbfdname\fR]
148         [\fB\-B\fR \fIbfdarch\fR|\fB\-\-binary\-architecture=\fR\fIbfdarch\fR]
149         [\fB\-S\fR|\fB\-\-strip\-all\fR]
150         [\fB\-g\fR|\fB\-\-strip\-debug\fR]
151         [\fB\-K\fR \fIsymbolname\fR|\fB\-\-keep\-symbol=\fR\fIsymbolname\fR]
152         [\fB\-N\fR \fIsymbolname\fR|\fB\-\-strip\-symbol=\fR\fIsymbolname\fR]
153         [\fB\-\-strip\-unneeded\-symbol=\fR\fIsymbolname\fR]
154         [\fB\-G\fR \fIsymbolname\fR|\fB\-\-keep\-global\-symbol=\fR\fIsymbolname\fR]
155         [\fB\-\-localize\-hidden\fR]
156         [\fB\-L\fR \fIsymbolname\fR|\fB\-\-localize\-symbol=\fR\fIsymbolname\fR]
157         [\fB\-\-globalize\-symbol=\fR\fIsymbolname\fR]
158         [\fB\-W\fR \fIsymbolname\fR|\fB\-\-weaken\-symbol=\fR\fIsymbolname\fR]
159         [\fB\-w\fR|\fB\-\-wildcard\fR]
160         [\fB\-x\fR|\fB\-\-discard\-all\fR]
161         [\fB\-X\fR|\fB\-\-discard\-locals\fR]
162         [\fB\-b\fR \fIbyte\fR|\fB\-\-byte=\fR\fIbyte\fR]
163         [\fB\-i\fR [\fIbreadth\fR]|\fB\-\-interleave\fR[=\fIbreadth\fR]]
164         [\fB\-\-interleave\-width=\fR\fIwidth\fR]
165         [\fB\-j\fR \fIsectionpattern\fR|\fB\-\-only\-section=\fR\fIsectionpattern\fR]
166         [\fB\-R\fR \fIsectionpattern\fR|\fB\-\-remove\-section=\fR\fIsectionpattern\fR]
167         [\fB\-p\fR|\fB\-\-preserve\-dates\fR]
168         [\fB\-D\fR|\fB\-\-enable\-deterministic\-archives\fR]
169         [\fB\-U\fR|\fB\-\-disable\-deterministic\-archives\fR]
170         [\fB\-\-debugging\fR]
171         [\fB\-\-gap\-fill=\fR\fIval\fR]
172         [\fB\-\-pad\-to=\fR\fIaddress\fR]
173         [\fB\-\-set\-start=\fR\fIval\fR]
174         [\fB\-\-adjust\-start=\fR\fIincr\fR]
175         [\fB\-\-change\-addresses=\fR\fIincr\fR]
176         [\fB\-\-change\-section\-address\fR \fIsectionpattern\fR{=,+,\-}\fIval\fR]
177         [\fB\-\-change\-section\-lma\fR \fIsectionpattern\fR{=,+,\-}\fIval\fR]
178         [\fB\-\-change\-section\-vma\fR \fIsectionpattern\fR{=,+,\-}\fIval\fR]
179         [\fB\-\-change\-warnings\fR] [\fB\-\-no\-change\-warnings\fR]
180         [\fB\-\-set\-section\-flags\fR \fIsectionpattern\fR=\fIflags\fR]
181         [\fB\-\-add\-section\fR \fIsectionname\fR=\fIfilename\fR]
182         [\fB\-\-dump\-section\fR \fIsectionname\fR=\fIfilename\fR]
183         [\fB\-\-rename\-section\fR \fIoldname\fR=\fInewname\fR[,\fIflags\fR]]
184         [\fB\-\-long\-section\-names\fR {enable,disable,keep}]
185         [\fB\-\-change\-leading\-char\fR] [\fB\-\-remove\-leading\-char\fR]
186         [\fB\-\-reverse\-bytes=\fR\fInum\fR]
187         [\fB\-\-srec\-len=\fR\fIival\fR] [\fB\-\-srec\-forceS3\fR]
188         [\fB\-\-redefine\-sym\fR \fIold\fR=\fInew\fR]
189         [\fB\-\-redefine\-syms=\fR\fIfilename\fR]
190         [\fB\-\-weaken\fR]
191         [\fB\-\-keep\-symbols=\fR\fIfilename\fR]
192         [\fB\-\-strip\-symbols=\fR\fIfilename\fR]
193         [\fB\-\-strip\-unneeded\-symbols=\fR\fIfilename\fR]
194         [\fB\-\-keep\-global\-symbols=\fR\fIfilename\fR]
195         [\fB\-\-localize\-symbols=\fR\fIfilename\fR]
196         [\fB\-\-globalize\-symbols=\fR\fIfilename\fR]
197         [\fB\-\-weaken\-symbols=\fR\fIfilename\fR]
198         [\fB\-\-alt\-machine\-code=\fR\fIindex\fR]
199         [\fB\-\-prefix\-symbols=\fR\fIstring\fR]
200         [\fB\-\-prefix\-sections=\fR\fIstring\fR]
201         [\fB\-\-prefix\-alloc\-sections=\fR\fIstring\fR]
202         [\fB\-\-add\-gnu\-debuglink=\fR\fIpath-to-file\fR]
203         [\fB\-\-keep\-file\-symbols\fR]
204         [\fB\-\-only\-keep\-debug\fR]
205         [\fB\-\-strip\-dwo\fR]
206         [\fB\-\-extract\-dwo\fR]
207         [\fB\-\-extract\-symbol\fR]
208         [\fB\-\-writable\-text\fR]
209         [\fB\-\-readonly\-text\fR]
210         [\fB\-\-pure\fR]
211         [\fB\-\-impure\fR]
212         [\fB\-\-file\-alignment=\fR\fInum\fR]
213         [\fB\-\-heap=\fR\fIsize\fR]
214         [\fB\-\-image\-base=\fR\fIaddress\fR]
215         [\fB\-\-section\-alignment=\fR\fInum\fR]
216         [\fB\-\-stack=\fR\fIsize\fR]
217         [\fB\-\-subsystem=\fR\fIwhich\fR:\fImajor\fR.\fIminor\fR]
218         [\fB\-\-compress\-debug\-sections\fR]
219         [\fB\-\-decompress\-debug\-sections\fR]
220         [\fB\-\-dwarf\-depth=\fR\fIn\fR]
221         [\fB\-\-dwarf\-start=\fR\fIn\fR]
222         [\fB\-v\fR|\fB\-\-verbose\fR]
223         [\fB\-V\fR|\fB\-\-version\fR]
224         [\fB\-\-help\fR] [\fB\-\-info\fR]
225         \fIinfile\fR [\fIoutfile\fR]
226 .SH "DESCRIPTION"
227 .IX Header "DESCRIPTION"
228 The \s-1GNU \s0\fBobjcopy\fR utility copies the contents of an object
229 file to another.  \fBobjcopy\fR uses the \s-1GNU BFD\s0 Library to
230 read and write the object files.  It can write the destination object
231 file in a format different from that of the source object file.  The
232 exact behavior of \fBobjcopy\fR is controlled by command-line options.
233 Note that \fBobjcopy\fR should be able to copy a fully linked file
234 between any two formats. However, copying a relocatable object file
235 between any two formats may not work as expected.
236 .PP
237 \&\fBobjcopy\fR creates temporary files to do its translations and
238 deletes them afterward.  \fBobjcopy\fR uses \s-1BFD\s0 to do all its
239 translation work; it has access to all the formats described in \s-1BFD\s0
240 and thus is able to recognize most formats without being told
241 explicitly.
242 .PP
243 \&\fBobjcopy\fR can be used to generate S\-records by using an output
244 target of \fBsrec\fR (e.g., use \fB\-O srec\fR).
245 .PP
246 \&\fBobjcopy\fR can be used to generate a raw binary file by using an
247 output target of \fBbinary\fR (e.g., use \fB\-O binary\fR).  When
248 \&\fBobjcopy\fR generates a raw binary file, it will essentially produce
249 a memory dump of the contents of the input object file.  All symbols and
250 relocation information will be discarded.  The memory dump will start at
251 the load address of the lowest section copied into the output file.
252 .PP
253 When generating an S\-record or a raw binary file, it may be helpful to
254 use \fB\-S\fR to remove sections containing debugging information.  In
255 some cases \fB\-R\fR will be useful to remove sections which contain
256 information that is not needed by the binary file.
257 .PP
258 Note\-\-\-\fBobjcopy\fR is not able to change the endianness of its input
259 files.  If the input format has an endianness (some formats do not),
260 \&\fBobjcopy\fR can only copy the inputs into file formats that have the
261 same endianness or which have no endianness (e.g., \fBsrec\fR).
262 (However, see the \fB\-\-reverse\-bytes\fR option.)
263 .SH "OPTIONS"
264 .IX Header "OPTIONS"
265 .IP "\fIinfile\fR" 4
266 .IX Item "infile"
267 .PD 0
268 .IP "\fIoutfile\fR" 4
269 .IX Item "outfile"
270 .PD
271 The input and output files, respectively.
272 If you do not specify \fIoutfile\fR, \fBobjcopy\fR creates a
273 temporary file and destructively renames the result with
274 the name of \fIinfile\fR.
275 .IP "\fB\-I\fR \fIbfdname\fR" 4
276 .IX Item "-I bfdname"
277 .PD 0
278 .IP "\fB\-\-input\-target=\fR\fIbfdname\fR" 4
279 .IX Item "--input-target=bfdname"
280 .PD
281 Consider the source file's object format to be \fIbfdname\fR, rather than
282 attempting to deduce it.
283 .IP "\fB\-O\fR \fIbfdname\fR" 4
284 .IX Item "-O bfdname"
285 .PD 0
286 .IP "\fB\-\-output\-target=\fR\fIbfdname\fR" 4
287 .IX Item "--output-target=bfdname"
288 .PD
289 Write the output file using the object format \fIbfdname\fR.
290 .IP "\fB\-F\fR \fIbfdname\fR" 4
291 .IX Item "-F bfdname"
292 .PD 0
293 .IP "\fB\-\-target=\fR\fIbfdname\fR" 4
294 .IX Item "--target=bfdname"
295 .PD
296 Use \fIbfdname\fR as the object format for both the input and the output
297 file; i.e., simply transfer data from source to destination with no
298 translation.
299 .IP "\fB\-B\fR \fIbfdarch\fR" 4
300 .IX Item "-B bfdarch"
301 .PD 0
302 .IP "\fB\-\-binary\-architecture=\fR\fIbfdarch\fR" 4
303 .IX Item "--binary-architecture=bfdarch"
304 .PD
305 Useful when transforming a architecture-less input file into an object file.
306 In this case the output architecture can be set to \fIbfdarch\fR.  This
307 option will be ignored if the input file has a known \fIbfdarch\fR.  You
308 can access this binary data inside a program by referencing the special
309 symbols that are created by the conversion process.  These symbols are
310 called _binary_\fIobjfile\fR_start, _binary_\fIobjfile\fR_end and
311 _binary_\fIobjfile\fR_size.  e.g. you can transform a picture file into
312 an object file and then access it in your code using these symbols.
313 .IP "\fB\-j\fR \fIsectionpattern\fR" 4
314 .IX Item "-j sectionpattern"
315 .PD 0
316 .IP "\fB\-\-only\-section=\fR\fIsectionpattern\fR" 4
317 .IX Item "--only-section=sectionpattern"
318 .PD
319 Copy only the indicated sections from the input file to the output file.
320 This option may be given more than once.  Note that using this option
321 inappropriately may make the output file unusable.  Wildcard
322 characters are accepted in \fIsectionpattern\fR.
323 .IP "\fB\-R\fR \fIsectionpattern\fR" 4
324 .IX Item "-R sectionpattern"
325 .PD 0
326 .IP "\fB\-\-remove\-section=\fR\fIsectionpattern\fR" 4
327 .IX Item "--remove-section=sectionpattern"
328 .PD
329 Remove any section matching \fIsectionpattern\fR from the output file.
330 This option may be given more than once.  Note that using this option
331 inappropriately may make the output file unusable.  Wildcard
332 characters are accepted in \fIsectionpattern\fR.  Using both the
333 \&\fB\-j\fR and \fB\-R\fR options together results in undefined
334 behaviour.
335 .IP "\fB\-S\fR" 4
336 .IX Item "-S"
337 .PD 0
338 .IP "\fB\-\-strip\-all\fR" 4
339 .IX Item "--strip-all"
340 .PD
341 Do not copy relocation and symbol information from the source file.
342 .IP "\fB\-g\fR" 4
343 .IX Item "-g"
344 .PD 0
345 .IP "\fB\-\-strip\-debug\fR" 4
346 .IX Item "--strip-debug"
347 .PD
348 Do not copy debugging symbols or sections from the source file.
349 .IP "\fB\-\-strip\-unneeded\fR" 4
350 .IX Item "--strip-unneeded"
351 Strip all symbols that are not needed for relocation processing.
352 .IP "\fB\-K\fR \fIsymbolname\fR" 4
353 .IX Item "-K symbolname"
354 .PD 0
355 .IP "\fB\-\-keep\-symbol=\fR\fIsymbolname\fR" 4
356 .IX Item "--keep-symbol=symbolname"
357 .PD
358 When stripping symbols, keep symbol \fIsymbolname\fR even if it would
359 normally be stripped.  This option may be given more than once.
360 .IP "\fB\-N\fR \fIsymbolname\fR" 4
361 .IX Item "-N symbolname"
362 .PD 0
363 .IP "\fB\-\-strip\-symbol=\fR\fIsymbolname\fR" 4
364 .IX Item "--strip-symbol=symbolname"
365 .PD
366 Do not copy symbol \fIsymbolname\fR from the source file.  This option
367 may be given more than once.
368 .IP "\fB\-\-strip\-unneeded\-symbol=\fR\fIsymbolname\fR" 4
369 .IX Item "--strip-unneeded-symbol=symbolname"
370 Do not copy symbol \fIsymbolname\fR from the source file unless it is needed
371 by a relocation.  This option may be given more than once.
372 .IP "\fB\-G\fR \fIsymbolname\fR" 4
373 .IX Item "-G symbolname"
374 .PD 0
375 .IP "\fB\-\-keep\-global\-symbol=\fR\fIsymbolname\fR" 4
376 .IX Item "--keep-global-symbol=symbolname"
377 .PD
378 Keep only symbol \fIsymbolname\fR global.  Make all other symbols local
379 to the file, so that they are not visible externally.  This option may
380 be given more than once.
381 .IP "\fB\-\-localize\-hidden\fR" 4
382 .IX Item "--localize-hidden"
383 In an \s-1ELF\s0 object, mark all symbols that have hidden or internal visibility
384 as local.  This option applies on top of symbol-specific localization options
385 such as \fB\-L\fR.
386 .IP "\fB\-L\fR \fIsymbolname\fR" 4
387 .IX Item "-L symbolname"
388 .PD 0
389 .IP "\fB\-\-localize\-symbol=\fR\fIsymbolname\fR" 4
390 .IX Item "--localize-symbol=symbolname"
391 .PD
392 Make symbol \fIsymbolname\fR local to the file, so that it is not
393 visible externally.  This option may be given more than once.
394 .IP "\fB\-W\fR \fIsymbolname\fR" 4
395 .IX Item "-W symbolname"
396 .PD 0
397 .IP "\fB\-\-weaken\-symbol=\fR\fIsymbolname\fR" 4
398 .IX Item "--weaken-symbol=symbolname"
399 .PD
400 Make symbol \fIsymbolname\fR weak. This option may be given more than once.
401 .IP "\fB\-\-globalize\-symbol=\fR\fIsymbolname\fR" 4
402 .IX Item "--globalize-symbol=symbolname"
403 Give symbol \fIsymbolname\fR global scoping so that it is visible
404 outside of the file in which it is defined.  This option may be given
405 more than once.
406 .IP "\fB\-w\fR" 4
407 .IX Item "-w"
408 .PD 0
409 .IP "\fB\-\-wildcard\fR" 4
410 .IX Item "--wildcard"
411 .PD
412 Permit regular expressions in \fIsymbolname\fRs used in other command
413 line options.  The question mark (?), asterisk (*), backslash (\e) and
414 square brackets ([]) operators can be used anywhere in the symbol
415 name.  If the first character of the symbol name is the exclamation
416 point (!) then the sense of the switch is reversed for that symbol.
417 For example:
418 .Sp
419 .Vb 1
420 \&          \-w \-W !foo \-W fo*
421 .Ve
422 .Sp
423 would cause objcopy to weaken all symbols that start with \*(L"fo\*(R"
424 except for the symbol \*(L"foo\*(R".
425 .IP "\fB\-x\fR" 4
426 .IX Item "-x"
427 .PD 0
428 .IP "\fB\-\-discard\-all\fR" 4
429 .IX Item "--discard-all"
430 .PD
431 Do not copy non-global symbols from the source file.
432 .IP "\fB\-X\fR" 4
433 .IX Item "-X"
434 .PD 0
435 .IP "\fB\-\-discard\-locals\fR" 4
436 .IX Item "--discard-locals"
437 .PD
438 Do not copy compiler-generated local symbols.
439 (These usually start with \fBL\fR or \fB.\fR.)
440 .IP "\fB\-b\fR \fIbyte\fR" 4
441 .IX Item "-b byte"
442 .PD 0
443 .IP "\fB\-\-byte=\fR\fIbyte\fR" 4
444 .IX Item "--byte=byte"
445 .PD
446 If interleaving has been enabled via the \fB\-\-interleave\fR option
447 then start the range of bytes to keep at the \fIbyte\fRth byte.
448 \&\fIbyte\fR can be in the range from 0 to \fIbreadth\fR\-1, where
449 \&\fIbreadth\fR is the value given by the \fB\-\-interleave\fR option.
450 .IP "\fB\-i [\fR\fIbreadth\fR\fB]\fR" 4
451 .IX Item "-i [breadth]"
452 .PD 0
453 .IP "\fB\-\-interleave[=\fR\fIbreadth\fR\fB]\fR" 4
454 .IX Item "--interleave[=breadth]"
455 .PD
456 Only copy a range out of every \fIbreadth\fR bytes.  (Header data is
457 not affected).  Select which byte in the range begins the copy with
458 the \fB\-\-byte\fR option.  Select the width of the range with the
459 \&\fB\-\-interleave\-width\fR option.
460 .Sp
461 This option is useful for creating files to program \s-1ROM. \s0 It is
462 typically used with an \f(CW\*(C`srec\*(C'\fR output target.  Note that
463 \&\fBobjcopy\fR will complain if you do not specify the
464 \&\fB\-\-byte\fR option as well.
465 .Sp
466 The default interleave breadth is 4, so with \fB\-\-byte\fR set to 0,
467 \&\fBobjcopy\fR would copy the first byte out of every four bytes
468 from the input to the output.
469 .IP "\fB\-\-interleave\-width=\fR\fIwidth\fR" 4
470 .IX Item "--interleave-width=width"
471 When used with the \fB\-\-interleave\fR option, copy \fIwidth\fR
472 bytes at a time.  The start of the range of bytes to be copied is set
473 by the \fB\-\-byte\fR option, and the extent of the range is set with
474 the \fB\-\-interleave\fR option.
475 .Sp
476 The default value for this option is 1.  The value of \fIwidth\fR plus
477 the \fIbyte\fR value set by the \fB\-\-byte\fR option must not exceed
478 the interleave breadth set by the \fB\-\-interleave\fR option.
479 .Sp
480 This option can be used to create images for two 16\-bit flashes interleaved
481 in a 32\-bit bus by passing \fB\-b 0 \-i 4 \-\-interleave\-width=2\fR
482 and \fB\-b 2 \-i 4 \-\-interleave\-width=2\fR to two \fBobjcopy\fR
483 commands.  If the input was '12345678' then the outputs would be
484 \&'1256' and '3478' respectively.
485 .IP "\fB\-p\fR" 4
486 .IX Item "-p"
487 .PD 0
488 .IP "\fB\-\-preserve\-dates\fR" 4
489 .IX Item "--preserve-dates"
490 .PD
491 Set the access and modification dates of the output file to be the same
492 as those of the input file.
493 .IP "\fB\-D\fR" 4
494 .IX Item "-D"
495 .PD 0
496 .IP "\fB\-\-enable\-deterministic\-archives\fR" 4
497 .IX Item "--enable-deterministic-archives"
498 .PD
499 Operate in \fIdeterministic\fR mode.  When copying archive members
500 and writing the archive index, use zero for UIDs, GIDs, timestamps,
501 and use consistent file modes for all files.
502 .Sp
503 If \fIbinutils\fR was configured with
504 \&\fB\-\-enable\-deterministic\-archives\fR, then this mode is on by default.
505 It can be disabled with the \fB\-U\fR option, below.
506 .IP "\fB\-U\fR" 4
507 .IX Item "-U"
508 .PD 0
509 .IP "\fB\-\-disable\-deterministic\-archives\fR" 4
510 .IX Item "--disable-deterministic-archives"
511 .PD
512 Do \fInot\fR operate in \fIdeterministic\fR mode.  This is the
513 inverse of the \fB\-D\fR option, above: when copying archive members
514 and writing the archive index, use their actual \s-1UID, GID,\s0 timestamp,
515 and file mode values.
516 .Sp
517 This is the default unless \fIbinutils\fR was configured with
518 \&\fB\-\-enable\-deterministic\-archives\fR.
519 .IP "\fB\-\-debugging\fR" 4
520 .IX Item "--debugging"
521 Convert debugging information, if possible.  This is not the default
522 because only certain debugging formats are supported, and the
523 conversion process can be time consuming.
524 .IP "\fB\-\-gap\-fill\fR \fIval\fR" 4
525 .IX Item "--gap-fill val"
526 Fill gaps between sections with \fIval\fR.  This operation applies to
527 the \fIload address\fR (\s-1LMA\s0) of the sections.  It is done by increasing
528 the size of the section with the lower address, and filling in the extra
529 space created with \fIval\fR.
530 .IP "\fB\-\-pad\-to\fR \fIaddress\fR" 4
531 .IX Item "--pad-to address"
532 Pad the output file up to the load address \fIaddress\fR.  This is
533 done by increasing the size of the last section.  The extra space is
534 filled in with the value specified by \fB\-\-gap\-fill\fR (default zero).
535 .IP "\fB\-\-set\-start\fR \fIval\fR" 4
536 .IX Item "--set-start val"
537 Set the start address of the new file to \fIval\fR.  Not all object file
538 formats support setting the start address.
539 .IP "\fB\-\-change\-start\fR \fIincr\fR" 4
540 .IX Item "--change-start incr"
541 .PD 0
542 .IP "\fB\-\-adjust\-start\fR \fIincr\fR" 4
543 .IX Item "--adjust-start incr"
544 .PD
545 Change the start address by adding \fIincr\fR.  Not all object file
546 formats support setting the start address.
547 .IP "\fB\-\-change\-addresses\fR \fIincr\fR" 4
548 .IX Item "--change-addresses incr"
549 .PD 0
550 .IP "\fB\-\-adjust\-vma\fR \fIincr\fR" 4
551 .IX Item "--adjust-vma incr"
552 .PD
553 Change the \s-1VMA\s0 and \s-1LMA\s0 addresses of all sections, as well as the start
554 address, by adding \fIincr\fR.  Some object file formats do not permit
555 section addresses to be changed arbitrarily.  Note that this does not
556 relocate the sections; if the program expects sections to be loaded at a
557 certain address, and this option is used to change the sections such
558 that they are loaded at a different address, the program may fail.
559 .IP "\fB\-\-change\-section\-address\fR \fIsectionpattern\fR\fB{=,+,\-}\fR\fIval\fR" 4
560 .IX Item "--change-section-address sectionpattern{=,+,-}val"
561 .PD 0
562 .IP "\fB\-\-adjust\-section\-vma\fR \fIsectionpattern\fR\fB{=,+,\-}\fR\fIval\fR" 4
563 .IX Item "--adjust-section-vma sectionpattern{=,+,-}val"
564 .PD
565 Set or change both the \s-1VMA\s0 address and the \s-1LMA\s0 address of any section
566 matching \fIsectionpattern\fR.  If \fB=\fR is used, the section
567 address is set to \fIval\fR.  Otherwise, \fIval\fR is added to or
568 subtracted from the section address.  See the comments under
569 \&\fB\-\-change\-addresses\fR, above. If \fIsectionpattern\fR does not
570 match any sections in the input file, a warning will be issued, unless
571 \&\fB\-\-no\-change\-warnings\fR is used.
572 .IP "\fB\-\-change\-section\-lma\fR \fIsectionpattern\fR\fB{=,+,\-}\fR\fIval\fR" 4
573 .IX Item "--change-section-lma sectionpattern{=,+,-}val"
574 Set or change the \s-1LMA\s0 address of any sections matching
575 \&\fIsectionpattern\fR.  The \s-1LMA\s0 address is the address where the
576 section will be loaded into memory at program load time.  Normally
577 this is the same as the \s-1VMA\s0 address, which is the address of the
578 section at program run time, but on some systems, especially those
579 where a program is held in \s-1ROM,\s0 the two can be different.  If \fB=\fR
580 is used, the section address is set to \fIval\fR.  Otherwise,
581 \&\fIval\fR is added to or subtracted from the section address.  See the
582 comments under \fB\-\-change\-addresses\fR, above.  If
583 \&\fIsectionpattern\fR does not match any sections in the input file, a
584 warning will be issued, unless \fB\-\-no\-change\-warnings\fR is used.
585 .IP "\fB\-\-change\-section\-vma\fR \fIsectionpattern\fR\fB{=,+,\-}\fR\fIval\fR" 4
586 .IX Item "--change-section-vma sectionpattern{=,+,-}val"
587 Set or change the \s-1VMA\s0 address of any section matching
588 \&\fIsectionpattern\fR.  The \s-1VMA\s0 address is the address where the
589 section will be located once the program has started executing.
590 Normally this is the same as the \s-1LMA\s0 address, which is the address
591 where the section will be loaded into memory, but on some systems,
592 especially those where a program is held in \s-1ROM,\s0 the two can be
593 different.  If \fB=\fR is used, the section address is set to
594 \&\fIval\fR.  Otherwise, \fIval\fR is added to or subtracted from the
595 section address.  See the comments under \fB\-\-change\-addresses\fR,
596 above.  If \fIsectionpattern\fR does not match any sections in the
597 input file, a warning will be issued, unless
598 \&\fB\-\-no\-change\-warnings\fR is used.
599 .IP "\fB\-\-change\-warnings\fR" 4
600 .IX Item "--change-warnings"
601 .PD 0
602 .IP "\fB\-\-adjust\-warnings\fR" 4
603 .IX Item "--adjust-warnings"
604 .PD
605 If \fB\-\-change\-section\-address\fR or \fB\-\-change\-section\-lma\fR or
606 \&\fB\-\-change\-section\-vma\fR is used, and the section pattern does not
607 match any sections, issue a warning.  This is the default.
608 .IP "\fB\-\-no\-change\-warnings\fR" 4
609 .IX Item "--no-change-warnings"
610 .PD 0
611 .IP "\fB\-\-no\-adjust\-warnings\fR" 4
612 .IX Item "--no-adjust-warnings"
613 .PD
614 Do not issue a warning if \fB\-\-change\-section\-address\fR or
615 \&\fB\-\-adjust\-section\-lma\fR or \fB\-\-adjust\-section\-vma\fR is used, even
616 if the section pattern does not match any sections.
617 .IP "\fB\-\-set\-section\-flags\fR \fIsectionpattern\fR\fB=\fR\fIflags\fR" 4
618 .IX Item "--set-section-flags sectionpattern=flags"
619 Set the flags for any sections matching \fIsectionpattern\fR.  The
620 \&\fIflags\fR argument is a comma separated string of flag names.  The
621 recognized names are \fBalloc\fR, \fBcontents\fR, \fBload\fR,
622 \&\fBnoload\fR, \fBreadonly\fR, \fBcode\fR, \fBdata\fR, \fBrom\fR,
623 \&\fBshare\fR, and \fBdebug\fR.  You can set the \fBcontents\fR flag
624 for a section which does not have contents, but it is not meaningful
625 to clear the \fBcontents\fR flag of a section which does have
626 contents\*(--just remove the section instead.  Not all flags are
627 meaningful for all object file formats.
628 .IP "\fB\-\-add\-section\fR \fIsectionname\fR\fB=\fR\fIfilename\fR" 4
629 .IX Item "--add-section sectionname=filename"
630 Add a new section named \fIsectionname\fR while copying the file.  The
631 contents of the new section are taken from the file \fIfilename\fR.  The
632 size of the section will be the size of the file.  This option only
633 works on file formats which can support sections with arbitrary names.
634 Note \- it may be necessary to use the \fB\-\-set\-section\-flags\fR
635 option to set the attributes of the newly created section.
636 .IP "\fB\-\-dump\-section\fR \fIsectionname\fR\fB=\fR\fIfilename\fR" 4
637 .IX Item "--dump-section sectionname=filename"
638 Place the contents of section named \fIsectionname\fR into the file
639 \&\fIfilename\fR, overwriting any contents that may have been there
640 previously.  This option is the inverse of \fB\-\-add\-section\fR.
641 This option is similar to the \fB\-\-only\-section\fR option except
642 that it does not create a formatted file, it just dumps the contents
643 as raw binary data, without applying any relocations.  The option can
644 be specified more than once.
645 .IP "\fB\-\-rename\-section\fR \fIoldname\fR\fB=\fR\fInewname\fR\fB[,\fR\fIflags\fR\fB]\fR" 4
646 .IX Item "--rename-section oldname=newname[,flags]"
647 Rename a section from \fIoldname\fR to \fInewname\fR, optionally
648 changing the section's flags to \fIflags\fR in the process.  This has
649 the advantage over usng a linker script to perform the rename in that
650 the output stays as an object file and does not become a linked
651 executable.
652 .Sp
653 This option is particularly helpful when the input format is binary,
654 since this will always create a section called .data.  If for example,
655 you wanted instead to create a section called .rodata containing binary
656 data you could use the following command line to achieve it:
657 .Sp
658 .Vb 3
659 \&          objcopy \-I binary \-O <output_format> \-B <architecture> \e
660 \&           \-\-rename\-section .data=.rodata,alloc,load,readonly,data,contents \e
661 \&           <input_binary_file> <output_object_file>
662 .Ve
663 .IP "\fB\-\-long\-section\-names {enable,disable,keep}\fR" 4
664 .IX Item "--long-section-names {enable,disable,keep}"
665 Controls the handling of long section names when processing \f(CW\*(C`COFF\*(C'\fR
666 and \f(CW\*(C`PE\-COFF\*(C'\fR object formats.  The default behaviour, \fBkeep\fR,
667 is to preserve long section names if any are present in the input file.
668 The \fBenable\fR and \fBdisable\fR options forcibly enable or disable
669 the use of long section names in the output object; when \fBdisable\fR
670 is in effect, any long section names in the input object will be truncated.
671 The \fBenable\fR option will only emit long section names if any are
672 present in the inputs; this is mostly the same as \fBkeep\fR, but it
673 is left undefined whether the \fBenable\fR option might force the
674 creation of an empty string table in the output file.
675 .IP "\fB\-\-change\-leading\-char\fR" 4
676 .IX Item "--change-leading-char"
677 Some object file formats use special characters at the start of
678 symbols.  The most common such character is underscore, which compilers
679 often add before every symbol.  This option tells \fBobjcopy\fR to
680 change the leading character of every symbol when it converts between
681 object file formats.  If the object file formats use the same leading
682 character, this option has no effect.  Otherwise, it will add a
683 character, or remove a character, or change a character, as
684 appropriate.
685 .IP "\fB\-\-remove\-leading\-char\fR" 4
686 .IX Item "--remove-leading-char"
687 If the first character of a global symbol is a special symbol leading
688 character used by the object file format, remove the character.  The
689 most common symbol leading character is underscore.  This option will
690 remove a leading underscore from all global symbols.  This can be useful
691 if you want to link together objects of different file formats with
692 different conventions for symbol names.  This is different from
693 \&\fB\-\-change\-leading\-char\fR because it always changes the symbol name
694 when appropriate, regardless of the object file format of the output
695 file.
696 .IP "\fB\-\-reverse\-bytes=\fR\fInum\fR" 4
697 .IX Item "--reverse-bytes=num"
698 Reverse the bytes in a section with output contents.  A section length must
699 be evenly divisible by the value given in order for the swap to be able to
700 take place. Reversing takes place before the interleaving is performed.
701 .Sp
702 This option is used typically in generating \s-1ROM\s0 images for problematic
703 target systems.  For example, on some target boards, the 32\-bit words
704 fetched from 8\-bit ROMs are re-assembled in little-endian byte order
705 regardless of the \s-1CPU\s0 byte order.  Depending on the programming model, the
706 endianness of the \s-1ROM\s0 may need to be modified.
707 .Sp
708 Consider a simple file with a section containing the following eight
709 bytes:  \f(CW12345678\fR.
710 .Sp
711 Using \fB\-\-reverse\-bytes=2\fR for the above example, the bytes in the
712 output file would be ordered \f(CW21436587\fR.
713 .Sp
714 Using \fB\-\-reverse\-bytes=4\fR for the above example, the bytes in the
715 output file would be ordered \f(CW43218765\fR.
716 .Sp
717 By using \fB\-\-reverse\-bytes=2\fR for the above example, followed by
718 \&\fB\-\-reverse\-bytes=4\fR on the output file, the bytes in the second
719 output file would be ordered \f(CW34127856\fR.
720 .IP "\fB\-\-srec\-len=\fR\fIival\fR" 4
721 .IX Item "--srec-len=ival"
722 Meaningful only for srec output.  Set the maximum length of the Srecords
723 being produced to \fIival\fR.  This length covers both address, data and
724 crc fields.
725 .IP "\fB\-\-srec\-forceS3\fR" 4
726 .IX Item "--srec-forceS3"
727 Meaningful only for srec output.  Avoid generation of S1/S2 records,
728 creating S3\-only record format.
729 .IP "\fB\-\-redefine\-sym\fR \fIold\fR\fB=\fR\fInew\fR" 4
730 .IX Item "--redefine-sym old=new"
731 Change the name of a symbol \fIold\fR, to \fInew\fR.  This can be useful
732 when one is trying link two things together for which you have no
733 source, and there are name collisions.
734 .IP "\fB\-\-redefine\-syms=\fR\fIfilename\fR" 4
735 .IX Item "--redefine-syms=filename"
736 Apply \fB\-\-redefine\-sym\fR to each symbol pair "\fIold\fR \fInew\fR"
737 listed in the file \fIfilename\fR.  \fIfilename\fR is simply a flat file,
738 with one symbol pair per line.  Line comments may be introduced by the hash
739 character.  This option may be given more than once.
740 .IP "\fB\-\-weaken\fR" 4
741 .IX Item "--weaken"
742 Change all global symbols in the file to be weak.  This can be useful
743 when building an object which will be linked against other objects using
744 the \fB\-R\fR option to the linker.  This option is only effective when
745 using an object file format which supports weak symbols.
746 .IP "\fB\-\-keep\-symbols=\fR\fIfilename\fR" 4
747 .IX Item "--keep-symbols=filename"
748 Apply \fB\-\-keep\-symbol\fR option to each symbol listed in the file
749 \&\fIfilename\fR.  \fIfilename\fR is simply a flat file, with one symbol
750 name per line.  Line comments may be introduced by the hash character.
751 This option may be given more than once.
752 .IP "\fB\-\-strip\-symbols=\fR\fIfilename\fR" 4
753 .IX Item "--strip-symbols=filename"
754 Apply \fB\-\-strip\-symbol\fR option to each symbol listed in the file
755 \&\fIfilename\fR.  \fIfilename\fR is simply a flat file, with one symbol
756 name per line.  Line comments may be introduced by the hash character.
757 This option may be given more than once.
758 .IP "\fB\-\-strip\-unneeded\-symbols=\fR\fIfilename\fR" 4
759 .IX Item "--strip-unneeded-symbols=filename"
760 Apply \fB\-\-strip\-unneeded\-symbol\fR option to each symbol listed in
761 the file \fIfilename\fR.  \fIfilename\fR is simply a flat file, with one
762 symbol name per line.  Line comments may be introduced by the hash
763 character.  This option may be given more than once.
764 .IP "\fB\-\-keep\-global\-symbols=\fR\fIfilename\fR" 4
765 .IX Item "--keep-global-symbols=filename"
766 Apply \fB\-\-keep\-global\-symbol\fR option to each symbol listed in the
767 file \fIfilename\fR.  \fIfilename\fR is simply a flat file, with one
768 symbol name per line.  Line comments may be introduced by the hash
769 character.  This option may be given more than once.
770 .IP "\fB\-\-localize\-symbols=\fR\fIfilename\fR" 4
771 .IX Item "--localize-symbols=filename"
772 Apply \fB\-\-localize\-symbol\fR option to each symbol listed in the file
773 \&\fIfilename\fR.  \fIfilename\fR is simply a flat file, with one symbol
774 name per line.  Line comments may be introduced by the hash character.
775 This option may be given more than once.
776 .IP "\fB\-\-globalize\-symbols=\fR\fIfilename\fR" 4
777 .IX Item "--globalize-symbols=filename"
778 Apply \fB\-\-globalize\-symbol\fR option to each symbol listed in the file
779 \&\fIfilename\fR.  \fIfilename\fR is simply a flat file, with one symbol
780 name per line.  Line comments may be introduced by the hash character.
781 This option may be given more than once.
782 .IP "\fB\-\-weaken\-symbols=\fR\fIfilename\fR" 4
783 .IX Item "--weaken-symbols=filename"
784 Apply \fB\-\-weaken\-symbol\fR option to each symbol listed in the file
785 \&\fIfilename\fR.  \fIfilename\fR is simply a flat file, with one symbol
786 name per line.  Line comments may be introduced by the hash character.
787 This option may be given more than once.
788 .IP "\fB\-\-alt\-machine\-code=\fR\fIindex\fR" 4
789 .IX Item "--alt-machine-code=index"
790 If the output architecture has alternate machine codes, use the
791 \&\fIindex\fRth code instead of the default one.  This is useful in case
792 a machine is assigned an official code and the tool-chain adopts the
793 new code, but other applications still depend on the original code
794 being used.  For \s-1ELF\s0 based architectures if the \fIindex\fR
795 alternative does not exist then the value is treated as an absolute
796 number to be stored in the e_machine field of the \s-1ELF\s0 header.
797 .IP "\fB\-\-writable\-text\fR" 4
798 .IX Item "--writable-text"
799 Mark the output text as writable.  This option isn't meaningful for all
800 object file formats.
801 .IP "\fB\-\-readonly\-text\fR" 4
802 .IX Item "--readonly-text"
803 Make the output text write protected.  This option isn't meaningful for all
804 object file formats.
805 .IP "\fB\-\-pure\fR" 4
806 .IX Item "--pure"
807 Mark the output file as demand paged.  This option isn't meaningful for all
808 object file formats.
809 .IP "\fB\-\-impure\fR" 4
810 .IX Item "--impure"
811 Mark the output file as impure.  This option isn't meaningful for all
812 object file formats.
813 .IP "\fB\-\-prefix\-symbols=\fR\fIstring\fR" 4
814 .IX Item "--prefix-symbols=string"
815 Prefix all symbols in the output file with \fIstring\fR.
816 .IP "\fB\-\-prefix\-sections=\fR\fIstring\fR" 4
817 .IX Item "--prefix-sections=string"
818 Prefix all section names in the output file with \fIstring\fR.
819 .IP "\fB\-\-prefix\-alloc\-sections=\fR\fIstring\fR" 4
820 .IX Item "--prefix-alloc-sections=string"
821 Prefix all the names of all allocated sections in the output file with
822 \&\fIstring\fR.
823 .IP "\fB\-\-add\-gnu\-debuglink=\fR\fIpath-to-file\fR" 4
824 .IX Item "--add-gnu-debuglink=path-to-file"
825 Creates a .gnu_debuglink section which contains a reference to \fIpath-to-file\fR
826 and adds it to the output file.
827 .IP "\fB\-\-keep\-file\-symbols\fR" 4
828 .IX Item "--keep-file-symbols"
829 When stripping a file, perhaps with \fB\-\-strip\-debug\fR or
830 \&\fB\-\-strip\-unneeded\fR, retain any symbols specifying source file names,
831 which would otherwise get stripped.
832 .IP "\fB\-\-only\-keep\-debug\fR" 4
833 .IX Item "--only-keep-debug"
834 Strip a file, removing contents of any sections that would not be
835 stripped by \fB\-\-strip\-debug\fR and leaving the debugging sections
836 intact.  In \s-1ELF\s0 files, this preserves all note sections in the output.
837 .Sp
838 The intention is that this option will be used in conjunction with
839 \&\fB\-\-add\-gnu\-debuglink\fR to create a two part executable.  One a
840 stripped binary which will occupy less space in \s-1RAM\s0 and in a
841 distribution and the second a debugging information file which is only
842 needed if debugging abilities are required.  The suggested procedure
843 to create these files is as follows:
844 .RS 4
845 .IP "1.<Link the executable as normal.  Assuming that is is called>" 4
846 .IX Item "1.<Link the executable as normal. Assuming that is is called>"
847 \&\f(CW\*(C`foo\*(C'\fR then...
848 .ie n .IP "1.<Run ""objcopy \-\-only\-keep\-debug foo foo.dbg"" to>" 4
849 .el .IP "1.<Run \f(CWobjcopy \-\-only\-keep\-debug foo foo.dbg\fR to>" 4
850 .IX Item "1.<Run objcopy --only-keep-debug foo foo.dbg to>"
851 create a file containing the debugging info.
852 .ie n .IP "1.<Run ""objcopy \-\-strip\-debug foo"" to create a>" 4
853 .el .IP "1.<Run \f(CWobjcopy \-\-strip\-debug foo\fR to create a>" 4
854 .IX Item "1.<Run objcopy --strip-debug foo to create a>"
855 stripped executable.
856 .ie n .IP "1.<Run ""objcopy \-\-add\-gnu\-debuglink=foo.dbg foo"">" 4
857 .el .IP "1.<Run \f(CWobjcopy \-\-add\-gnu\-debuglink=foo.dbg foo\fR>" 4
858 .IX Item "1.<Run objcopy --add-gnu-debuglink=foo.dbg foo>"
859 to add a link to the debugging info into the stripped executable.
860 .RE
861 .RS 4
862 .Sp
863 Note\-\-\-the choice of \f(CW\*(C`.dbg\*(C'\fR as an extension for the debug info
864 file is arbitrary.  Also the \f(CW\*(C`\-\-only\-keep\-debug\*(C'\fR step is
865 optional.  You could instead do this:
866 .IP "1.<Link the executable as normal.>" 4
867 .IX Item "1.<Link the executable as normal.>"
868 .PD 0
869 .ie n .IP "1.<Copy ""foo"" to  ""foo.full"">" 4
870 .el .IP "1.<Copy \f(CWfoo\fR to  \f(CWfoo.full\fR>" 4
871 .IX Item "1.<Copy foo to foo.full>"
872 .ie n .IP "1.<Run ""objcopy \-\-strip\-debug foo"">" 4
873 .el .IP "1.<Run \f(CWobjcopy \-\-strip\-debug foo\fR>" 4
874 .IX Item "1.<Run objcopy --strip-debug foo>"
875 .ie n .IP "1.<Run ""objcopy \-\-add\-gnu\-debuglink=foo.full foo"">" 4
876 .el .IP "1.<Run \f(CWobjcopy \-\-add\-gnu\-debuglink=foo.full foo\fR>" 4
877 .IX Item "1.<Run objcopy --add-gnu-debuglink=foo.full foo>"
878 .RE
879 .RS 4
880 .PD
881 .Sp
882 i.e., the file pointed to by the \fB\-\-add\-gnu\-debuglink\fR can be the
883 full executable.  It does not have to be a file created by the
884 \&\fB\-\-only\-keep\-debug\fR switch.
885 .Sp
886 Note\-\-\-this switch is only intended for use on fully linked files.  It
887 does not make sense to use it on object files where the debugging
888 information may be incomplete.  Besides the gnu_debuglink feature
889 currently only supports the presence of one filename containing
890 debugging information, not multiple filenames on a one-per-object-file
891 basis.
892 .RE
893 .IP "\fB\-\-strip\-dwo\fR" 4
894 .IX Item "--strip-dwo"
895 Remove the contents of all \s-1DWARF \s0.dwo sections, leaving the
896 remaining debugging sections and all symbols intact.
897 This option is intended for use by the compiler as part of
898 the \fB\-gsplit\-dwarf\fR option, which splits debug information
899 between the .o file and a separate .dwo file.  The compiler
900 generates all debug information in the same file, then uses
901 the \fB\-\-extract\-dwo\fR option to copy the .dwo sections to
902 the .dwo file, then the \fB\-\-strip\-dwo\fR option to remove
903 those sections from the original .o file.
904 .IP "\fB\-\-extract\-dwo\fR" 4
905 .IX Item "--extract-dwo"
906 Extract the contents of all \s-1DWARF \s0.dwo sections.  See the
907 \&\fB\-\-strip\-dwo\fR option for more information.
908 .IP "\fB\-\-file\-alignment\fR \fInum\fR" 4
909 .IX Item "--file-alignment num"
910 Specify the file alignment.  Sections in the file will always begin at
911 file offsets which are multiples of this number.  This defaults to
912 512.
913 [This option is specific to \s-1PE\s0 targets.]
914 .IP "\fB\-\-heap\fR \fIreserve\fR" 4
915 .IX Item "--heap reserve"
916 .PD 0
917 .IP "\fB\-\-heap\fR \fIreserve\fR\fB,\fR\fIcommit\fR" 4
918 .IX Item "--heap reserve,commit"
919 .PD
920 Specify the number of bytes of memory to reserve (and optionally commit)
921 to be used as heap for this program.
922 [This option is specific to \s-1PE\s0 targets.]
923 .IP "\fB\-\-image\-base\fR \fIvalue\fR" 4
924 .IX Item "--image-base value"
925 Use \fIvalue\fR as the base address of your program or dll.  This is
926 the lowest memory location that will be used when your program or dll
927 is loaded.  To reduce the need to relocate and improve performance of
928 your dlls, each should have a unique base address and not overlap any
929 other dlls.  The default is 0x400000 for executables, and 0x10000000
930 for dlls.
931 [This option is specific to \s-1PE\s0 targets.]
932 .IP "\fB\-\-section\-alignment\fR \fInum\fR" 4
933 .IX Item "--section-alignment num"
934 Sets the section alignment.  Sections in memory will always begin at
935 addresses which are a multiple of this number.  Defaults to 0x1000.
936 [This option is specific to \s-1PE\s0 targets.]
937 .IP "\fB\-\-stack\fR \fIreserve\fR" 4
938 .IX Item "--stack reserve"
939 .PD 0
940 .IP "\fB\-\-stack\fR \fIreserve\fR\fB,\fR\fIcommit\fR" 4
941 .IX Item "--stack reserve,commit"
942 .PD
943 Specify the number of bytes of memory to reserve (and optionally commit)
944 to be used as stack for this program.
945 [This option is specific to \s-1PE\s0 targets.]
946 .IP "\fB\-\-subsystem\fR \fIwhich\fR" 4
947 .IX Item "--subsystem which"
948 .PD 0
949 .IP "\fB\-\-subsystem\fR \fIwhich\fR\fB:\fR\fImajor\fR" 4
950 .IX Item "--subsystem which:major"
951 .IP "\fB\-\-subsystem\fR \fIwhich\fR\fB:\fR\fImajor\fR\fB.\fR\fIminor\fR" 4
952 .IX Item "--subsystem which:major.minor"
953 .PD
954 Specifies the subsystem under which your program will execute.  The
955 legal values for \fIwhich\fR are \f(CW\*(C`native\*(C'\fR, \f(CW\*(C`windows\*(C'\fR,
956 \&\f(CW\*(C`console\*(C'\fR, \f(CW\*(C`posix\*(C'\fR, \f(CW\*(C`efi\-app\*(C'\fR, \f(CW\*(C`efi\-bsd\*(C'\fR,
957 \&\f(CW\*(C`efi\-rtd\*(C'\fR, \f(CW\*(C`sal\-rtd\*(C'\fR, and \f(CW\*(C`xbox\*(C'\fR.  You may optionally set
958 the subsystem version also.  Numeric values are also accepted for
959 \&\fIwhich\fR.
960 [This option is specific to \s-1PE\s0 targets.]
961 .IP "\fB\-\-extract\-symbol\fR" 4
962 .IX Item "--extract-symbol"
963 Keep the file's section flags and symbols but remove all section data.
964 Specifically, the option:
965 .RS 4
966 .IP "*<removes the contents of all sections;>" 4
967 .IX Item "*<removes the contents of all sections;>"
968 .PD 0
969 .IP "*<sets the size of every section to zero; and>" 4
970 .IX Item "*<sets the size of every section to zero; and>"
971 .IP "*<sets the file's start address to zero.>" 4
972 .IX Item "*<sets the file's start address to zero.>"
973 .RE
974 .RS 4
975 .PD
976 .Sp
977 This option is used to build a \fI.sym\fR file for a VxWorks kernel.
978 It can also be a useful way of reducing the size of a \fB\-\-just\-symbols\fR
979 linker input file.
980 .RE
981 .IP "\fB\-\-compress\-debug\-sections\fR" 4
982 .IX Item "--compress-debug-sections"
983 Compress \s-1DWARF\s0 debug sections using zlib.
984 .IP "\fB\-\-decompress\-debug\-sections\fR" 4
985 .IX Item "--decompress-debug-sections"
986 Decompress \s-1DWARF\s0 debug sections using zlib.
987 .IP "\fB\-V\fR" 4
988 .IX Item "-V"
989 .PD 0
990 .IP "\fB\-\-version\fR" 4
991 .IX Item "--version"
992 .PD
993 Show the version number of \fBobjcopy\fR.
994 .IP "\fB\-v\fR" 4
995 .IX Item "-v"
996 .PD 0
997 .IP "\fB\-\-verbose\fR" 4
998 .IX Item "--verbose"
999 .PD
1000 Verbose output: list all object files modified.  In the case of
1001 archives, \fBobjcopy \-V\fR lists all members of the archive.
1002 .IP "\fB\-\-help\fR" 4
1003 .IX Item "--help"
1004 Show a summary of the options to \fBobjcopy\fR.
1005 .IP "\fB\-\-info\fR" 4
1006 .IX Item "--info"
1007 Display a list showing all architectures and object formats available.
1008 .IP "\fB@\fR\fIfile\fR" 4
1009 .IX Item "@file"
1010 Read command-line options from \fIfile\fR.  The options read are
1011 inserted in place of the original @\fIfile\fR option.  If \fIfile\fR
1012 does not exist, or cannot be read, then the option will be treated
1013 literally, and not removed.
1014 .Sp
1015 Options in \fIfile\fR are separated by whitespace.  A whitespace
1016 character may be included in an option by surrounding the entire
1017 option in either single or double quotes.  Any character (including a
1018 backslash) may be included by prefixing the character to be included
1019 with a backslash.  The \fIfile\fR may itself contain additional
1020 @\fIfile\fR options; any such options will be processed recursively.
1021 .SH "SEE ALSO"
1022 .IX Header "SEE ALSO"
1023 \&\fIld\fR\|(1), \fIobjdump\fR\|(1), and the Info entries for \fIbinutils\fR.
1024 .SH "COPYRIGHT"
1025 .IX Header "COPYRIGHT"
1026 Copyright (c) 1991\-2014 Free Software Foundation, Inc.
1027 .PP
1028 Permission is granted to copy, distribute and/or modify this document
1029 under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
1030 or any later version published by the Free Software Foundation;
1031 with no Invariant Sections, with no Front-Cover Texts, and with no
1032 Back-Cover Texts.  A copy of the license is included in the
1033 section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".