]> Git Repo - binutils.git/blame_incremental - binutils/objcopy.1
* Makefile.in: Revert 2001-06-17.
[binutils.git] / binutils / objcopy.1
... / ...
CommitLineData
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
7.br
8.if t .Sp
9.ne 5
10.PP
11\fB\\$1\fR
12.PP
13..
14.de Sp \" Vertical space (when we can't use .PP)
15.if t .sp .5v
16.if n .sp
17..
18.de Ip \" List item
19.br
20.ie \\n(.$>=3 .ne \\$3
21.el .ne 3
22.IP "\\$1" \\$2
23..
24.de Vb \" Begin verbatim text
25.ft CW
26.nf
27.ne \\$1
28..
29.de Ve \" End verbatim text
30.ft R
31
32.fi
33..
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<>
40.tr \(*W-|\(bv\*(Tr
41.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
42.ie n \{\
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' '
51'br\}
52.el\{\
53. ds -- \|\(em\|
54. ds PI \(*p
55. ds L" ``
56. ds R" ''
57'br\}
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
69.\}
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.
77.bd B 3
78. \" fudge factors for nroff and troff
79.if n \{\
80. ds #H 0
81. ds #V .8m
82. ds #F .3m
83. ds #[ \f1
84. ds #] \fP
85.\}
86.if t \{\
87. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
88. ds #V .6m
89. ds #F 0
90. ds #[ \&
91. ds #] \&
92.\}
93. \" simple accents for nroff and troff
94.if n \{\
95. ds ' \&
96. ds ` \&
97. ds ^ \&
98. ds , \&
99. ds ~ ~
100. ds /
101.\}
102.if t \{\
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'
109.\}
110. \" troff and (daisy-wheel) nroff accents
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'
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
120. \" corrections for vroff
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'
123. \" for low resolution devices (crt and lpr)
124.if \n(.H>23 .if \n(.V>19 \
125\{\
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
135.\}
136.rm #[ #] #H #V #F C
137.\" ======================================================================
138.\"
139.IX Title "OBJCOPY.1 1"
140.TH OBJCOPY.1 1 "binutils-2.11.90" "2001-05-30" "GNU"
141.UC
142.SH "NAME"
143objcopy \- copy and translate object files
144.SH "SYNOPSIS"
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 ]
180 \fIinfile\fR [\fIoutfile\fR]
181.SH "DESCRIPTION"
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
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
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
189between any two formats. However, copying a relocatable object file
190between any two formats may not work as expected.
191.PP
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
195and thus is able to recognize most formats without being told
196explicitly.
197.PP
198\&\f(CW\*(C`objcopy\*(C'\fR can be used to generate S-records by using an output
199target of \fBsrec\fR (e.g., use \fB\-O srec\fR).
200.PP
201\&\f(CW\*(C`objcopy\*(C'\fR can be used to generate a raw binary file by using an
202output target of \fBbinary\fR (e.g., use \fB\-O binary\fR). When
203\&\f(CW\*(C`objcopy\*(C'\fR generates a raw binary file, it will essentially produce
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.
207.PP
208When generating an S-record or a raw binary file, it may be helpful to
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.
212.PP
213Note \- \f(CW\*(C`objcopy\*(C'\fR is not able to change the endianness of its input
214files. If the input format has an endianness, (some formats do not),
215\&\f(CW\*(C`objcopy\*(C'\fR can only copy the inputs into file formats that have the
216same endianness or which have no endianness (eg \fBsrec\fR).
217.SH "OPTIONS"
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"
223The input and output files, respectively.
224If you do not specify \fIoutfile\fR, \f(CW\*(C`objcopy\*(C'\fR creates a
225temporary file and destructively renames the result with
226the name of \fIinfile\fR.
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"
231Consider the source file's object format to be \fIbfdname\fR, rather than
232attempting to deduce it.
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"
237Write the output file using the object format \fIbfdname\fR.
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"
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.
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"
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.
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"
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.
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"
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.
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"
275Do not copy relocation and symbol information from the source file.
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"
280Do not copy debugging symbols from the source file.
281.Ip "\f(CW\*(C`\-\-strip\-unneeded\*(C'\fR" 4
282.IX Item "--strip-unneeded"
283Strip all symbols that are not needed for relocation processing.
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"
288Copy only symbol \fIsymbolname\fR from the source file. This option may
289be given more than once.
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"
294Do not copy symbol \fIsymbolname\fR from the source file. This option
295may be given more than once.
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"
307Make symbol \fIsymbolname\fR local to the file, so that it is not
308visible externally. This option may be given more than once.
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"
313Make symbol \fIsymbolname\fR weak. This option may be given more than once.
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"
318Do not copy non-global symbols from the source file.
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"
323Do not copy compiler-generated local symbols.
324(These usually start with \fBL\fR or \fB.\fR.)
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"
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,
331where \fIinterleave\fR is given by the \fB\-i\fR or \fB\*(--interleave\fR
332option, or the default of 4. This option is useful for creating files
333to program \s-1ROM\s0. It is typically used with an \f(CW\*(C`srec\*(C'\fR output
334target.
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"
339Only copy one out of every \fIinterleave\fR bytes. Select which byte to
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"
347Set the access and modification dates of the output file to be the same
348as those of the input file.
349.Ip "\f(CW\*(C`\-\-debugging\*(C'\fR" 4
350.IX Item "--debugging"
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.
354.Ip "\f(CW\*(C`\-\-gap\-fill \f(CIval\f(CW\*(C'\fR" 4
355.IX Item "--gap-fill val"
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
358the size of the section with the lower address, and filling in the extra
359space created with \fIval\fR.
360.Ip "\f(CW\*(C`\-\-pad\-to \f(CIaddress\f(CW\*(C'\fR" 4
361.IX Item "--pad-to address"
362Pad the output file up to the load address \fIaddress\fR. This is
363done by increasing the size of the last section. The extra space is
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"
367Set the start address of the new file to \fIval\fR. Not all object file
368formats support setting the start address.
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"
373Change the start address by adding \fIincr\fR. Not all object file
374formats support setting the start address.
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"
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
383certain address, and this option is used to change the sections such
384that they are loaded at a different address, the program may fail.
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"
389Set or change both the \s-1VMA\s0 address and the \s-1LMA\s0 address of the named
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,
393above. If \fIsection\fR does not exist in the input file, a warning will
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"
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
403\&\fIval\fR. Otherwise, \fIval\fR is added to or subtracted from the
404section address. See the comments under \fB\*(--change-addresses\fR,
405above. If \fIsection\fR does not exist in the input file, a warning
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"
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
414\&\s-1ROM\s0, the two can be different. If \fB=\fR is used, the section address
415is set to \fIval\fR. Otherwise, \fIval\fR is added to or subtracted
416from the section address. See the comments under
417\&\fB\*(--change-addresses\fR, above. If \fIsection\fR does not exist in
418the input file, a warning will be issued, unless
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
426exist, issue a warning. This is the default.
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
433if the named section does not exist.
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"
436Set the flags for the named section. The \fIflags\fR argument is a
437comma separated string of flag names. The recognized names are
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
441does not have contents, but it is not meaningful to clear the
442\&\fBcontents\fR flag of a section which does have contents\*(--just remove
443the section instead. Not all flags are meaningful for all object file
444formats.
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"
447Add a new section named \fIsectionname\fR while copying the file. The
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.
451.Ip "\f(CW\*(C`\-\-change\-leading\-char\*(C'\fR" 4
452.IX Item "--change-leading-char"
453Some object file formats use special characters at the start of
454symbols. The most common such character is underscore, which compilers
455often add before every symbol. This option tells \f(CW\*(C`objcopy\*(C'\fR to
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
460appropriate.
461.Ip "\f(CW\*(C`\-\-remove\-leading\-char\*(C'\fR" 4
462.IX Item "--remove-leading-char"
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
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
469\&\f(CW\*(C`\-\-change\-leading\-char\*(C'\fR because it always changes the symbol name
470when appropriate, regardless of the object file format of the output
471file.
472.Ip "\f(CW\*(C`\-\-srec\-len=\f(CIival\f(CW\*(C'\fR" 4
473.IX Item "--srec-len=ival"
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.
477.Ip "\f(CW\*(C`\-\-srec\-forceS3\*(C'\fR" 4
478.IX Item "--srec-forceS3"
479Meaningful only for srec output. Avoid generation of S1/S2 records,
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"
483Change the name of a symbol \fIold\fR, to \fInew\fR. This can be useful
484when one is trying link two things together for which you have no
485source, and there are name collisions.
486.Ip "\f(CW\*(C`\-\-weaken\*(C'\fR" 4
487.IX Item "--weaken"
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
490the \f(CW\*(C`\-R\*(C'\fR option to the linker. This option is only effective when
491using an object file format which supports weak symbols.
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"
531Verbose output: list all object files modified. In the case of
532archives, \fBobjcopy \-V\fR lists all members of the archive.
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.
536.SH "SEE ALSO"
537.IX Header "SEE ALSO"
538\&\fIld\fR\|(1), \fIobjdump\fR\|(1), and the Info entries for \fIbinutils\fR.
539.SH "COPYRIGHT"
540.IX Header "COPYRIGHT"
541Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc.
542.PP
543Permission is granted to copy, distribute and/or modify this document
544under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1
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
548section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
This page took 0.029492 seconds and 4 git commands to generate.