* Makefile.in: Revert 2001-06-17.
[deliverable/binutils-gdb.git] / binutils / objcopy.1
CommitLineData
16b2b71c
NC
1.\" Automatically generated by Pod::Man version 1.02
2.\" Wed May 30 12:24:28 2001
3.\"
4.\" Standard preamble:
5.\" ======================================================================
6.de Sh \" Subsection heading
0285c67d
NC
7.br
8.if t .Sp
9.ne 5
10.PP
11\fB\\$1\fR
12.PP
13..
16b2b71c 14.de Sp \" Vertical space (when we can't use .PP)
0285c67d
NC
15.if t .sp .5v
16.if n .sp
252b5132 17..
16b2b71c 18.de Ip \" List item
0285c67d
NC
19.br
20.ie \\n(.$>=3 .ne \\$3
21.el .ne 3
22.IP "\\$1" \\$2
23..
16b2b71c 24.de Vb \" Begin verbatim text
0285c67d
NC
25.ft CW
26.nf
27.ne \\$1
28..
16b2b71c 29.de Ve \" End verbatim text
0285c67d 30.ft R
252b5132 31
0285c67d
NC
32.fi
33..
16b2b71c
NC
34.\" Set up some character translations and predefined strings. \*(-- will
35.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
36.\" double quote, and \*(R" will give a right double quote. | will give a
37.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used
38.\" to do unbreakable dashes and therefore won't be available. \*(C` and
39.\" \*(C' expand to `' in nroff, nothing in troff, for use with C<>
0285c67d 40.tr \(*W-|\(bv\*(Tr
16b2b71c 41.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
0285c67d 42.ie n \{\
16b2b71c
NC
43. ds -- \(*W-
44. ds PI pi
45. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
46. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
47. ds L" ""
48. ds R" ""
49. ds C` `
50. ds C' '
0285c67d
NC
51'br\}
52.el\{\
16b2b71c
NC
53. ds -- \|\(em\|
54. ds PI \(*p
55. ds L" ``
56. ds R" ''
0285c67d 57'br\}
16b2b71c
NC
58.\"
59.\" If the F register is turned on, we'll generate index entries on stderr
60.\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and
61.\" index entries marked with X<> in POD. Of course, you'll have to process
62.\" the output yourself in some meaningful fashion.
63.if \nF \{\
64. de IX
65. tm Index:\\$1\t\\n%\t"\\$2"
66. .
67. nr % 0
68. rr F
0285c67d 69.\}
16b2b71c
NC
70.\"
71.\" For nroff, turn off justification. Always turn off hyphenation; it
72.\" makes way too many mistakes in technical documents.
73.hy 0
74.\"
75.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
76.\" Fear. Run. Save yourself. No user-serviceable parts.
0285c67d 77.bd B 3
16b2b71c 78. \" fudge factors for nroff and troff
0285c67d 79.if n \{\
16b2b71c
NC
80. ds #H 0
81. ds #V .8m
82. ds #F .3m
83. ds #[ \f1
84. ds #] \fP
0285c67d
NC
85.\}
86.if t \{\
16b2b71c
NC
87. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
88. ds #V .6m
89. ds #F 0
90. ds #[ \&
91. ds #] \&
0285c67d 92.\}
16b2b71c 93. \" simple accents for nroff and troff
0285c67d 94.if n \{\
16b2b71c
NC
95. ds ' \&
96. ds ` \&
97. ds ^ \&
98. ds , \&
99. ds ~ ~
100. ds /
0285c67d
NC
101.\}
102.if t \{\
16b2b71c
NC
103. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
104. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
105. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
106. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
107. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
108. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
0285c67d 109.\}
16b2b71c 110. \" troff and (daisy-wheel) nroff accents
0285c67d
NC
111.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
112.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
0285c67d
NC
113.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
114.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
115.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
116.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
117.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
118.ds ae a\h'-(\w'a'u*4/10)'e
119.ds Ae A\h'-(\w'A'u*4/10)'E
16b2b71c 120. \" corrections for vroff
0285c67d
NC
121.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
122.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
16b2b71c 123. \" for low resolution devices (crt and lpr)
0285c67d
NC
124.if \n(.H>23 .if \n(.V>19 \
125\{\
16b2b71c
NC
126. ds : e
127. ds 8 ss
128. ds o a
129. ds d- d\h'-1'\(ga
130. ds D- D\h'-1'\(hy
131. ds th \o'bp'
132. ds Th \o'LP'
133. ds ae ae
134. ds Ae AE
0285c67d
NC
135.\}
136.rm #[ #] #H #V #F C
16b2b71c
NC
137.\" ======================================================================
138.\"
139.IX Title "OBJCOPY.1 1"
140.TH OBJCOPY.1 1 "binutils-2.11.90" "2001-05-30" "GNU"
141.UC
0285c67d 142.SH "NAME"
252b5132 143objcopy \- copy and translate object files
0285c67d 144.SH "SYNOPSIS"
16b2b71c
NC
145.IX Header "SYNOPSIS"
146objcopy [ \-F \fIbfdname\fR | \-\-target=\fIbfdname\fR ]
147 [ \-I \fIbfdname\fR | \-\-input-target=\fIbfdname\fR ]
148 [ \-O \fIbfdname\fR | \-\-output-target=\fIbfdname\fR ]
149 [ \-B \fIbfdarch\fR | \-\-binary-architecture=\fIbfdarch\fR ]
150 [ \-S | \-\-strip-all ] [ \-g | \-\-strip-debug ]
151 [ \-K \fIsymbolname\fR | \-\-keep-symbol=\fIsymbolname\fR ]
152 [ \-N \fIsymbolname\fR | \-\-strip-symbol=\fIsymbolname\fR ]
153 [ \-G \fIsymbolname\fR | \-\-keep-global-symbol=\fIsymbolname\fR]
154 [ \-L \fIsymbolname\fR | \-\-localize-symbol=\fIsymbolname\fR ]
155 [ \-W \fIsymbolname\fR | \-\-weaken-symbol=\fIsymbolname\fR ]
156 [ \-x | \-\-discard-all ] [ \-X | \-\-discard-locals ]
157 [ \-b \fIbyte\fR | \-\-byte=\fIbyte\fR ]
158 [ \-i \fIinterleave\fR | \-\-interleave=\fIinterleave\fR ]
159 [ \-j \fIsectionname\fR | \-\-only-section=\fIsectionname\fR ]
160 [ \-R \fIsectionname\fR | \-\-remove-section=\fIsectionname\fR ]
161 [ \-p | \-\-preserve-dates ] [ \-\-debugging ]
162 [ \-\-gap-fill=\fIval\fR ] [ \-\-pad-to=\fIaddress\fR ]
163 [ \-\-set-start=\fIval\fR ] [ \-\-adjust-start=\fIincr\fR ]
164 [ \-\-change-addresses=\fIincr\fR ]
165 [ \-\-change-section-address \fIsection\fR{=,+,\-}\fIval\fR ]
166 [ \-\-change-section-lma \fIsection\fR{=,+,\-}\fIval\fR ]
167 [ \-\-change-section-vma \fIsection\fR{=,+,\-}\fIval\fR ]
168 [ \-\-change-warnings ] [ \-\-no-change-warnings ]
169 [ \-\-set-section-flags \fIsection\fR=\fIflags\fR ]
170 [ \-\-add-section \fIsectionname\fR=\fIfilename\fR ]
171 [ \-\-change-leading-char ] [ \-\-remove-leading-char ]
172 [ \-\-srec-len=\fIival\fR ] [ \-\-srec-forceS3 ]
173 [ \-\-redefine-sym \fIold\fR=\fInew\fR ] [ \-\-weaken ]
174 [ \-\-keep-symbols=\fIfilename\fR ]
175 [ \-\-strip-symbols=\fIfilename\fR ]
176 [ \-\-keep-global-symbols=\fIfilename\fR ]
177 [ \-\-localize-symbols=\fIfilename\fR ]
178 [ \-\-weaken-symbols=\fIfilename\fR ]
179 [ \-v | \-\-verbose ] [ \-V | \-\-version ] [ \-\-help ]
0285c67d
NC
180 \fIinfile\fR [\fIoutfile\fR]
181.SH "DESCRIPTION"
16b2b71c
NC
182.IX Header "DESCRIPTION"
183The \s-1GNU\s0 \f(CW\*(C`objcopy\*(C'\fR utility copies the contents of an object
184file to another. \f(CW\*(C`objcopy\*(C'\fR uses the \s-1GNU\s0 \s-1BFD\s0 Library to
0285c67d
NC
185read and write the object files. It can write the destination object
186file in a format different from that of the source object file. The
16b2b71c
NC
187exact behavior of \f(CW\*(C`objcopy\*(C'\fR is controlled by command-line options.
188Note that \f(CW\*(C`objcopy\*(C'\fR should be able to copy a fully linked file
0285c67d
NC
189between any two formats. However, copying a relocatable object file
190between any two formats may not work as expected.
252b5132 191.PP
16b2b71c
NC
192\&\f(CW\*(C`objcopy\*(C'\fR creates temporary files to do its translations and
193deletes them afterward. \f(CW\*(C`objcopy\*(C'\fR uses \s-1BFD\s0 to do all its
194translation work; it has access to all the formats described in \s-1BFD\s0
0285c67d
NC
195and thus is able to recognize most formats without being told
196explicitly.
252b5132 197.PP
16b2b71c 198\&\f(CW\*(C`objcopy\*(C'\fR can be used to generate S-records by using an output
0285c67d 199target of \fBsrec\fR (e.g., use \fB\-O srec\fR).
252b5132 200.PP
16b2b71c 201\&\f(CW\*(C`objcopy\*(C'\fR can be used to generate a raw binary file by using an
0285c67d 202output target of \fBbinary\fR (e.g., use \fB\-O binary\fR). When
16b2b71c 203\&\f(CW\*(C`objcopy\*(C'\fR generates a raw binary file, it will essentially produce
0285c67d
NC
204a memory dump of the contents of the input object file. All symbols and
205relocation information will be discarded. The memory dump will start at
206the load address of the lowest section copied into the output file.
252b5132 207.PP
16b2b71c 208When generating an S-record or a raw binary file, it may be helpful to
0285c67d
NC
209use \fB\-S\fR to remove sections containing debugging information. In
210some cases \fB\-R\fR will be useful to remove sections which contain
211information that is not needed by the binary file.
252b5132 212.PP
16b2b71c 213Note \- \f(CW\*(C`objcopy\*(C'\fR is not able to change the endianness of its input
0285c67d 214files. If the input format has an endianness, (some formats do not),
16b2b71c 215\&\f(CW\*(C`objcopy\*(C'\fR can only copy the inputs into file formats that have the
0285c67d
NC
216same endianness or which have no endianness (eg \fBsrec\fR).
217.SH "OPTIONS"
16b2b71c
NC
218.IX Header "OPTIONS"
219.Ip "\f(CW\*(C`\f(CIinfile\f(CW\*(C'\fR" 4
220.IX Item "infile"
221.Ip "\f(CW\*(C`\f(CIoutfile\f(CW\*(C'\fR" 4
222.IX Item "outfile"
0285c67d 223The input and output files, respectively.
16b2b71c 224If you do not specify \fIoutfile\fR, \f(CW\*(C`objcopy\*(C'\fR creates a
0285c67d
NC
225temporary file and destructively renames the result with
226the name of \fIinfile\fR.
16b2b71c
NC
227.Ip "\f(CW\*(C`\-I \f(CIbfdname\f(CW \*(C'\fR" 4
228.IX Item "-I bfdname "
229.Ip "\f(CW\*(C`\-\-input\-target=\f(CIbfdname\f(CW\*(C'\fR" 4
230.IX Item "--input-target=bfdname"
0285c67d
NC
231Consider the source file's object format to be \fIbfdname\fR, rather than
232attempting to deduce it.
16b2b71c
NC
233.Ip "\f(CW\*(C`\-O \f(CIbfdname\f(CW\*(C'\fR" 4
234.IX Item "-O bfdname"
235.Ip "\f(CW\*(C`\-\-output\-target=\f(CIbfdname\f(CW\*(C'\fR" 4
236.IX Item "--output-target=bfdname"
0285c67d 237Write the output file using the object format \fIbfdname\fR.
16b2b71c
NC
238.Ip "\f(CW\*(C`\-F \f(CIbfdname\f(CW\*(C'\fR" 4
239.IX Item "-F bfdname"
240.Ip "\f(CW\*(C`\-\-target=\f(CIbfdname\f(CW\*(C'\fR" 4
241.IX Item "--target=bfdname"
0285c67d
NC
242Use \fIbfdname\fR as the object format for both the input and the output
243file; i.e., simply transfer data from source to destination with no
244translation.
16b2b71c
NC
245.Ip "\f(CW\*(C`\-B \f(CIbfdarch\f(CW\*(C'\fR" 4
246.IX Item "-B bfdarch"
247.Ip "\f(CW\*(C`\-\-binary\-architecture=\f(CIbfdarch\f(CW\*(C'\fR" 4
248.IX Item "--binary-architecture=bfdarch"
0285c67d
NC
249Useful when transforming a raw binary input file into an object file.
250In this case the output architecture can be set to \fIbfdarch\fR. This
251option will be ignored if the input file has a known \fIbfdarch\fR. You
252can access this binary data inside a program by referencing the special
253symbols that are created by the conversion process. These symbols are
254called _binary_\fIobjfile\fR_start, _binary_\fIobjfile\fR_end and
255_binary_\fIobjfile\fR_size. e.g. you can transform a picture file into
256an object file and then access it in your code using these symbols.
16b2b71c
NC
257.Ip "\f(CW\*(C`\-j \f(CIsectionname\f(CW\*(C'\fR" 4
258.IX Item "-j sectionname"
259.Ip "\f(CW\*(C`\-\-only\-section=\f(CIsectionname\f(CW\*(C'\fR" 4
260.IX Item "--only-section=sectionname"
0285c67d
NC
261Copy only the named section from the input file to the output file.
262This option may be given more than once. Note that using this option
263inappropriately may make the output file unusable.
16b2b71c
NC
264.Ip "\f(CW\*(C`\-R \f(CIsectionname\f(CW\*(C'\fR" 4
265.IX Item "-R sectionname"
266.Ip "\f(CW\*(C`\-\-remove\-section=\f(CIsectionname\f(CW\*(C'\fR" 4
267.IX Item "--remove-section=sectionname"
0285c67d
NC
268Remove any section named \fIsectionname\fR from the output file. This
269option may be given more than once. Note that using this option
270inappropriately may make the output file unusable.
16b2b71c
NC
271.Ip "\f(CW\*(C`\-S\*(C'\fR" 4
272.IX Item "-S"
273.Ip "\f(CW\*(C`\-\-strip\-all\*(C'\fR" 4
274.IX Item "--strip-all"
252b5132 275Do not copy relocation and symbol information from the source file.
16b2b71c
NC
276.Ip "\f(CW\*(C`\-g\*(C'\fR" 4
277.IX Item "-g"
278.Ip "\f(CW\*(C`\-\-strip\-debug\*(C'\fR" 4
279.IX Item "--strip-debug"
252b5132 280Do not copy debugging symbols from the source file.
16b2b71c
NC
281.Ip "\f(CW\*(C`\-\-strip\-unneeded\*(C'\fR" 4
282.IX Item "--strip-unneeded"
252b5132 283Strip all symbols that are not needed for relocation processing.
16b2b71c
NC
284.Ip "\f(CW\*(C`\-K \f(CIsymbolname\f(CW\*(C'\fR" 4
285.IX Item "-K symbolname"
286.Ip "\f(CW\*(C`\-\-keep\-symbol=\f(CIsymbolname\f(CW\*(C'\fR" 4
287.IX Item "--keep-symbol=symbolname"
0285c67d
NC
288Copy only symbol \fIsymbolname\fR from the source file. This option may
289be given more than once.
16b2b71c
NC
290.Ip "\f(CW\*(C`\-N \f(CIsymbolname\f(CW\*(C'\fR" 4
291.IX Item "-N symbolname"
292.Ip "\f(CW\*(C`\-\-strip\-symbol=\f(CIsymbolname\f(CW\*(C'\fR" 4
293.IX Item "--strip-symbol=symbolname"
0285c67d 294Do not copy symbol \fIsymbolname\fR from the source file. This option
252b5132 295may be given more than once.
16b2b71c
NC
296.Ip "\f(CW\*(C`\-G \f(CIsymbolname\f(CW\*(C'\fR" 4
297.IX Item "-G symbolname"
298.Ip "\f(CW\*(C`\-\-keep\-global\-symbol=\f(CIsymbolname\f(CW\*(C'\fR" 4
299.IX Item "--keep-global-symbol=symbolname"
300Keep only symbol \fIsymbolname\fR global. Make all other symbols local
301to the file, so that they are not visible externally. This option may
302be given more than once.
303.Ip "\f(CW\*(C`\-L \f(CIsymbolname\f(CW\*(C'\fR" 4
304.IX Item "-L symbolname"
305.Ip "\f(CW\*(C`\-\-localize\-symbol=\f(CIsymbolname\f(CW\*(C'\fR" 4
306.IX Item "--localize-symbol=symbolname"
0285c67d 307Make symbol \fIsymbolname\fR local to the file, so that it is not
252b5132 308visible externally. This option may be given more than once.
16b2b71c
NC
309.Ip "\f(CW\*(C`\-W \f(CIsymbolname\f(CW\*(C'\fR" 4
310.IX Item "-W symbolname"
311.Ip "\f(CW\*(C`\-\-weaken\-symbol=\f(CIsymbolname\f(CW\*(C'\fR" 4
312.IX Item "--weaken-symbol=symbolname"
0285c67d 313Make symbol \fIsymbolname\fR weak. This option may be given more than once.
16b2b71c
NC
314.Ip "\f(CW\*(C`\-x\*(C'\fR" 4
315.IX Item "-x"
316.Ip "\f(CW\*(C`\-\-discard\-all\*(C'\fR" 4
317.IX Item "--discard-all"
252b5132 318Do not copy non-global symbols from the source file.
16b2b71c
NC
319.Ip "\f(CW\*(C`\-X\*(C'\fR" 4
320.IX Item "-X"
321.Ip "\f(CW\*(C`\-\-discard\-locals\*(C'\fR" 4
322.IX Item "--discard-locals"
0285c67d
NC
323Do not copy compiler-generated local symbols.
324(These usually start with \fBL\fR or \fB.\fR.)
16b2b71c
NC
325.Ip "\f(CW\*(C`\-b \f(CIbyte\f(CW\*(C'\fR" 4
326.IX Item "-b byte"
327.Ip "\f(CW\*(C`\-\-byte=\f(CIbyte\f(CW\*(C'\fR" 4
328.IX Item "--byte=byte"
0285c67d
NC
329Keep only every \fIbyte\fRth byte of the input file (header data is not
330affected). \fIbyte\fR can be in the range from 0 to \fIinterleave\fR\-1,
16b2b71c 331where \fIinterleave\fR is given by the \fB\-i\fR or \fB\*(--interleave\fR
0285c67d 332option, or the default of 4. This option is useful for creating files
16b2b71c 333to program \s-1ROM\s0. It is typically used with an \f(CW\*(C`srec\*(C'\fR output
0285c67d 334target.
16b2b71c
NC
335.Ip "\f(CW\*(C`\-i \f(CIinterleave\f(CW\*(C'\fR" 4
336.IX Item "-i interleave"
337.Ip "\f(CW\*(C`\-\-interleave=\f(CIinterleave\f(CW\*(C'\fR" 4
338.IX Item "--interleave=interleave"
0285c67d 339Only copy one out of every \fIinterleave\fR bytes. Select which byte to
16b2b71c
NC
340copy with the \fI\-b\fR or \fB\*(--byte\fR option. The default is 4.
341\&\f(CW\*(C`objcopy\*(C'\fR ignores this option if you do not specify either \fB\-b\fR or
342\&\fB\*(--byte\fR.
343.Ip "\f(CW\*(C`\-p\*(C'\fR" 4
344.IX Item "-p"
345.Ip "\f(CW\*(C`\-\-preserve\-dates\*(C'\fR" 4
346.IX Item "--preserve-dates"
252b5132
RH
347Set the access and modification dates of the output file to be the same
348as those of the input file.
16b2b71c
NC
349.Ip "\f(CW\*(C`\-\-debugging\*(C'\fR" 4
350.IX Item "--debugging"
252b5132
RH
351Convert debugging information, if possible. This is not the default
352because only certain debugging formats are supported, and the
353conversion process can be time consuming.
16b2b71c
NC
354.Ip "\f(CW\*(C`\-\-gap\-fill \f(CIval\f(CW\*(C'\fR" 4
355.IX Item "--gap-fill val"
0285c67d
NC
356Fill gaps between sections with \fIval\fR. This operation applies to
357the \fIload address\fR (\s-1LMA\s0) of the sections. It is done by increasing
252b5132 358the size of the section with the lower address, and filling in the extra
0285c67d 359space created with \fIval\fR.
16b2b71c
NC
360.Ip "\f(CW\*(C`\-\-pad\-to \f(CIaddress\f(CW\*(C'\fR" 4
361.IX Item "--pad-to address"
0285c67d 362Pad the output file up to the load address \fIaddress\fR. This is
252b5132 363done by increasing the size of the last section. The extra space is
16b2b71c
NC
364filled in with the value specified by \fB\*(--gap-fill\fR (default zero).
365.Ip "\f(CW\*(C`\-\-set\-start \f(CIval\f(CW\*(C'\fR" 4
366.IX Item "--set-start val"
0285c67d
NC
367Set the start address of the new file to \fIval\fR. Not all object file
368formats support setting the start address.
16b2b71c
NC
369.Ip "\f(CW\*(C`\-\-change\-start \f(CIincr\f(CW\*(C'\fR" 4
370.IX Item "--change-start incr"
371.Ip "\f(CW\*(C`\-\-adjust\-start \f(CIincr\f(CW\*(C'\fR" 4
372.IX Item "--adjust-start incr"
0285c67d 373Change the start address by adding \fIincr\fR. Not all object file
252b5132 374formats support setting the start address.
16b2b71c
NC
375.Ip "\f(CW\*(C`\-\-change\-addresses \f(CIincr\f(CW\*(C'\fR" 4
376.IX Item "--change-addresses incr"
377.Ip "\f(CW\*(C`\-\-adjust\-vma \f(CIincr\f(CW\*(C'\fR" 4
378.IX Item "--adjust-vma incr"
0285c67d
NC
379Change the \s-1VMA\s0 and \s-1LMA\s0 addresses of all sections, as well as the start
380address, by adding \fIincr\fR. Some object file formats do not permit
381section addresses to be changed arbitrarily. Note that this does not
382relocate the sections; if the program expects sections to be loaded at a
252b5132 383certain address, and this option is used to change the sections such
0285c67d 384that they are loaded at a different address, the program may fail.
16b2b71c
NC
385.Ip "\f(CW\*(C`\-\-change\-section\-address \f(CIsection\f(CW{=,+,\-}\f(CIval\f(CW\*(C'\fR" 4
386.IX Item "--change-section-address section{=,+,-}val"
387.Ip "\f(CW\*(C`\-\-adjust\-section\-vma \f(CIsection\f(CW{=,+,\-}\f(CIval\f(CW\*(C'\fR" 4
388.IX Item "--adjust-section-vma section{=,+,-}val"
0285c67d 389Set or change both the \s-1VMA\s0 address and the \s-1LMA\s0 address of the named
16b2b71c
NC
390\&\fIsection\fR. If \fB=\fR is used, the section address is set to
391\&\fIval\fR. Otherwise, \fIval\fR is added to or subtracted from the
392section address. See the comments under \fB\*(--change-addresses\fR,
0285c67d 393above. If \fIsection\fR does not exist in the input file, a warning will
16b2b71c
NC
394be issued, unless \fB\*(--no-change-warnings\fR is used.
395.Ip "\f(CW\*(C`\-\-change\-section\-lma \f(CIsection\f(CW{=,+,\-}\f(CIval\f(CW\*(C'\fR" 4
396.IX Item "--change-section-lma section{=,+,-}val"
0285c67d
NC
397Set or change the \s-1LMA\s0 address of the named \fIsection\fR. The \s-1LMA\s0
398address is the address where the section will be loaded into memory at
399program load time. Normally this is the same as the \s-1VMA\s0 address, which
400is the address of the section at program run time, but on some systems,
401especially those where a program is held in \s-1ROM\s0, the two can be
402different. If \fB=\fR is used, the section address is set to
16b2b71c
NC
403\&\fIval\fR. Otherwise, \fIval\fR is added to or subtracted from the
404section address. See the comments under \fB\*(--change-addresses\fR,
0285c67d 405above. If \fIsection\fR does not exist in the input file, a warning
16b2b71c
NC
406will be issued, unless \fB\*(--no-change-warnings\fR is used.
407.Ip "\f(CW\*(C`\-\-change\-section\-vma \f(CIsection\f(CW{=,+,\-}\f(CIval\f(CW\*(C'\fR" 4
408.IX Item "--change-section-vma section{=,+,-}val"
0285c67d
NC
409Set or change the \s-1VMA\s0 address of the named \fIsection\fR. The \s-1VMA\s0
410address is the address where the section will be located once the
411program has started executing. Normally this is the same as the \s-1LMA\s0
412address, which is the address where the section will be loaded into
413memory, but on some systems, especially those where a program is held in
16b2b71c 414\&\s-1ROM\s0, the two can be different. If \fB=\fR is used, the section address
0285c67d
NC
415is set to \fIval\fR. Otherwise, \fIval\fR is added to or subtracted
416from the section address. See the comments under
16b2b71c 417\&\fB\*(--change-addresses\fR, above. If \fIsection\fR does not exist in
0285c67d 418the input file, a warning will be issued, unless
16b2b71c
NC
419\&\fB\*(--no-change-warnings\fR is used.
420.Ip "\f(CW\*(C`\-\-change\-warnings\*(C'\fR" 4
421.IX Item "--change-warnings"
422.Ip "\f(CW\*(C`\-\-adjust\-warnings\*(C'\fR" 4
423.IX Item "--adjust-warnings"
424If \fB\*(--change-section-address\fR or \fB\*(--change-section-lma\fR or
425\&\fB\*(--change-section-vma\fR is used, and the named section does not
0285c67d 426exist, issue a warning. This is the default.
16b2b71c
NC
427.Ip "\f(CW\*(C`\-\-no\-change\-warnings\*(C'\fR" 4
428.IX Item "--no-change-warnings"
429.Ip "\f(CW\*(C`\-\-no\-adjust\-warnings\*(C'\fR" 4
430.IX Item "--no-adjust-warnings"
431Do not issue a warning if \fB\*(--change-section-address\fR or
432\&\fB\*(--adjust-section-lma\fR or \fB\*(--adjust-section-vma\fR is used, even
0285c67d 433if the named section does not exist.
16b2b71c
NC
434.Ip "\f(CW\*(C`\-\-set\-section\-flags \f(CIsection\f(CW=\f(CIflags\f(CW\*(C'\fR" 4
435.IX Item "--set-section-flags section=flags"
0285c67d 436Set the flags for the named section. The \fIflags\fR argument is a
252b5132 437comma separated string of flag names. The recognized names are
16b2b71c
NC
438\&\fBalloc\fR, \fBcontents\fR, \fBload\fR, \fBnoload\fR,
439\&\fBreadonly\fR, \fBcode\fR, \fBdata\fR, \fBrom\fR, \fBshare\fR, and
440\&\fBdebug\fR. You can set the \fBcontents\fR flag for a section which
0285c67d 441does not have contents, but it is not meaningful to clear the
16b2b71c 442\&\fBcontents\fR flag of a section which does have contents\*(--just remove
0285c67d
NC
443the section instead. Not all flags are meaningful for all object file
444formats.
16b2b71c
NC
445.Ip "\f(CW\*(C`\-\-add\-section \f(CIsectionname\f(CW=\f(CIfilename\f(CW\*(C'\fR" 4
446.IX Item "--add-section sectionname=filename"
252b5132 447Add a new section named \fIsectionname\fR while copying the file. The
0285c67d
NC
448contents of the new section are taken from the file \fIfilename\fR. The
449size of the section will be the size of the file. This option only
450works on file formats which can support sections with arbitrary names.
16b2b71c
NC
451.Ip "\f(CW\*(C`\-\-change\-leading\-char\*(C'\fR" 4
452.IX Item "--change-leading-char"
252b5132
RH
453Some object file formats use special characters at the start of
454symbols. The most common such character is underscore, which compilers
16b2b71c 455often add before every symbol. This option tells \f(CW\*(C`objcopy\*(C'\fR to
0285c67d
NC
456change the leading character of every symbol when it converts between
457object file formats. If the object file formats use the same leading
458character, this option has no effect. Otherwise, it will add a
459character, or remove a character, or change a character, as
252b5132 460appropriate.
16b2b71c
NC
461.Ip "\f(CW\*(C`\-\-remove\-leading\-char\*(C'\fR" 4
462.IX Item "--remove-leading-char"
252b5132
RH
463If the first character of a global symbol is a special symbol leading
464character used by the object file format, remove the character. The
465most common symbol leading character is underscore. This option will
0285c67d
NC
466remove a leading underscore from all global symbols. This can be useful
467if you want to link together objects of different file formats with
468different conventions for symbol names. This is different from
16b2b71c 469\&\f(CW\*(C`\-\-change\-leading\-char\*(C'\fR because it always changes the symbol name
252b5132 470when appropriate, regardless of the object file format of the output
0285c67d 471file.
16b2b71c
NC
472.Ip "\f(CW\*(C`\-\-srec\-len=\f(CIival\f(CW\*(C'\fR" 4
473.IX Item "--srec-len=ival"
0285c67d
NC
474Meaningful only for srec output. Set the maximum length of the Srecords
475being produced to \fIival\fR. This length covers both address, data and
476crc fields.
16b2b71c
NC
477.Ip "\f(CW\*(C`\-\-srec\-forceS3\*(C'\fR" 4
478.IX Item "--srec-forceS3"
0285c67d 479Meaningful only for srec output. Avoid generation of S1/S2 records,
16b2b71c
NC
480creating S3\-only record format.
481.Ip "\f(CW\*(C`\-\-redefine\-sym \f(CIold\f(CW=\f(CInew\f(CW\*(C'\fR" 4
482.IX Item "--redefine-sym old=new"
0285c67d 483Change the name of a symbol \fIold\fR, to \fInew\fR. This can be useful
57938635
AM
484when one is trying link two things together for which you have no
485source, and there are name collisions.
16b2b71c
NC
486.Ip "\f(CW\*(C`\-\-weaken\*(C'\fR" 4
487.IX Item "--weaken"
0285c67d
NC
488Change all global symbols in the file to be weak. This can be useful
489when building an object which will be linked against other objects using
16b2b71c 490the \f(CW\*(C`\-R\*(C'\fR option to the linker. This option is only effective when
0285c67d 491using an object file format which supports weak symbols.
16b2b71c
NC
492.Ip "\f(CW\*(C`\-\-keep\-symbols=\f(CIfilename\f(CW\*(C'\fR" 4
493.IX Item "--keep-symbols=filename"
494Apply \fB\*(--keep-symbol\fR option to each symbol listed in the file
495\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol
496name per line. Line comments may be introduced by the hash character.
497This option may be given more than once.
498.Ip "\f(CW\*(C`\-\-strip\-symbols=\f(CIfilename\f(CW\*(C'\fR" 4
499.IX Item "--strip-symbols=filename"
500Apply \fB\*(--strip-symbol\fR option to each symbol listed in the file
501\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol
502name per line. Line comments may be introduced by the hash character.
503This option may be given more than once.
504.Ip "\f(CW\*(C`\-\-keep\-global\-symbols=\f(CIfilename\f(CW\*(C'\fR" 4
505.IX Item "--keep-global-symbols=filename"
506Apply \fB\*(--keep-global-symbol\fR option to each symbol listed in the
507file \fIfilename\fR. \fIfilename\fR is simply a flat file, with one
508symbol name per line. Line comments may be introduced by the hash
509character. This option may be given more than once.
510.Ip "\f(CW\*(C`\-\-localize\-symbols=\f(CIfilename\f(CW\*(C'\fR" 4
511.IX Item "--localize-symbols=filename"
512Apply \fB\*(--localize-symbol\fR option to each symbol listed in the file
513\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol
514name per line. Line comments may be introduced by the hash character.
515This option may be given more than once.
516.Ip "\f(CW\*(C`\-\-weaken\-symbols=\f(CIfilename\f(CW\*(C'\fR" 4
517.IX Item "--weaken-symbols=filename"
518Apply \fB\*(--weaken-symbol\fR option to each symbol listed in the file
519\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol
520name per line. Line comments may be introduced by the hash character.
521This option may be given more than once.
522.Ip "\f(CW\*(C`\-V\*(C'\fR" 4
523.IX Item "-V"
524.Ip "\f(CW\*(C`\-\-version\*(C'\fR" 4
525.IX Item "--version"
526Show the version number of \f(CW\*(C`objcopy\*(C'\fR.
527.Ip "\f(CW\*(C`\-v\*(C'\fR" 4
528.IX Item "-v"
529.Ip "\f(CW\*(C`\-\-verbose\*(C'\fR" 4
530.IX Item "--verbose"
252b5132 531Verbose output: list all object files modified. In the case of
0285c67d 532archives, \fBobjcopy \-V\fR lists all members of the archive.
16b2b71c
NC
533.Ip "\f(CW\*(C`\-\-help\*(C'\fR" 4
534.IX Item "--help"
535Show a summary of the options to \f(CW\*(C`objcopy\*(C'\fR.
252b5132 536.SH "SEE ALSO"
16b2b71c
NC
537.IX Header "SEE ALSO"
538\&\fIld\fR\|(1), \fIobjdump\fR\|(1), and the Info entries for \fIbinutils\fR.
0285c67d 539.SH "COPYRIGHT"
16b2b71c 540.IX Header "COPYRIGHT"
0285c67d 541Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc.
cf055d54 542.PP
0285c67d 543Permission is granted to copy, distribute and/or modify this document
16b2b71c 544under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1
0285c67d
NC
545or any later version published by the Free Software Foundation;
546with no Invariant Sections, with no Front-Cover Texts, and with no
547Back-Cover Texts. A copy of the license is included in the
16b2b71c 548section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
This page took 0.12348 seconds and 4 git commands to generate.