* objcopy.c (struct section_list): Add fields used, adjust, val.
[deliverable/binutils-gdb.git] / binutils / objcopy.1
CommitLineData
08ad9921
JO
1.\" Copyright (c) 1991 Free Software Foundation
2.\" See section COPYING for conditions for redistribution
6c7ed084 3.TH objcopy 1 "October 1994" "cygnus support" "GNU Development Tools"
08ad9921
JO
4.de BP
5.sp
6.ti \-.2i
7\(**
8..
9
10.SH NAME
f7b839f7 11objcopy \- copy and translate object files
08ad9921
JO
12
13.SH SYNOPSIS
14.hy 0
15.na
b26ac613 16.TP
08ad9921 17.B objcopy
eae04238
DM
18.RB "[\|" \-F\ \fIbfdname\fB\ |\ \-\-target=\fIbfdname\fR "\|]"
19.RB "[\|" \-I\ \fIbfdname\fB\ |\ \-\-input\-target=\fIbfdname\fR "\|]"
20.RB "[\|" \-O\ \fIbfdname\fB\ |\ \-\-output\-target=\fIbfdname\fR "\|]"
0aca460e 21.RB "[\|" \-R\ \fIsectionname\fB\ |\ \-\-remove\-section=\fIsectionname\fR "\|]"
3883531f
JO
22.RB "[\|" \-S\ |\ \-\-strip\-all\fR "\|]"
23.RB "[\|" \-g\ |\ \-\-strip\-debug\fR "\|]"
24.RB "[\|" \-x\ |\ \-\-discard\-all\fR "\|]"
25.RB "[\|" \-X\ |\ \-\-discard\-locals\fR "\|]"
6c7ed084
ILT
26.RB "[\|" \-b\ \fIbyte\fP |\ \-\-byte=\fIbyte\fP "\|]"
27.RB "[\|" \-i\ \fIinterleave\fP |\ \-\-interleave=\fIinterleave\fP "\|]"
28.RB "[\|" \-\-set\-start=\fIval\fP "\|]"
29.RB "[\|" \-\-adjust\-start=\fIincr\fP "\|]"
30.RB "[\|" \-\-adjust\-vma=\fIincr\fP "\|]"
31.RB "[\|" \-\-adjust\-section\-vma=\fIsection{=,+,-}val\fP "\|]"
32.RB "[\|" \-\-adjust\-warnings "\|]"
33.RB "[\|" \-\-no\-adjust\-warnings "\|]"
3883531f
JO
34.RB "[\|" \-v\ |\ \-\-verbose\fR "\|]"
35.RB "[\|" \-V\ |\ \-\-version\fR "\|]"
36.RB "[\|" \-\-help\fR "\|]"
b26ac613 37.B infile
3883531f 38.RB "[\|" outfile\fR "\|]"
08ad9921
JO
39.SH DESCRIPTION
40The GNU
41.B objcopy
42utility copies the contents of an object file to another.
43.B objcopy
44uses the GNU BFD Library to read and write the object files. It can
45write the destination object file in a format different from that of
46the source object file. The exact behavior of
47.B objcopy
48is controlled by command-line options.
b26ac613 49.PP
08ad9921
JO
50.B objcopy
51creates temporary files to do its translations and deletes them
52afterward.
53.B objcopy
54uses BFD to do all its translation work; it knows about all the
55formats BFD knows about, and thus is able to recognize most formats
56without being told explicitly.
b26ac613
DM
57.PP
58.I infile
59and
60.I outfile
61are the source and output files respectively. If you do not specify
08ad9921
JO
62.IR outfile ,
63.B objcopy
64creates a temporary file and destructively renames the result with the
65name of the input file.
b26ac613
DM
66
67.SH OPTIONS
08ad9921 68.TP
eae04238 69.B \-I \fIbfdname\fR, \fB\-\-input\-target=\fIbfdname
08ad9921 70Consider the source file's object format to be
eae04238 71.IR bfdname ,
08ad9921
JO
72rather than attempting to deduce it.
73.TP
eae04238 74.B \-O \fIbfdname\fR, \fB\-\-output\-target=\fIbfdname
08ad9921 75Write the output file using the object format
eae04238 76.IR bfdname .
08ad9921 77.TP
eae04238 78.B \-F \fIbfdname\fR, \fB\-\-target=\fIbfdname
08ad9921 79Use
eae04238 80.I bfdname
08ad9921
JO
81as the object format for both the input and the output file; i.e.
82simply transfer data from source to destination with no translation.
83.TP
0aca460e
ILT
84.B \-R \fIsectionname\fR, \fB\-\-remove-section=\fIsectionname
85Remove the named section from the file. This option may be given more
86than once. Note that using this option inappropriately may make the
87output file unusable.
88.TP
3883531f 89.B \-S\fR, \fB\-\-strip\-all
08ad9921
JO
90Do not copy relocation and symbol information from the source file.
91.TP
3883531f 92.B \-g\fR, \fB\-\-strip\-debug
08ad9921
JO
93Do not copy debugging symbols from the source file.
94.TP
3883531f 95.B \-x\fR, \fB \-\-discard\-all
08ad9921
JO
96Do not copy non-global symbols from the source file.
97.TP
3883531f 98.B \-X\fR, \fB\-\-discard\-locals
08ad9921
JO
99Do not copy compiler-generated local symbols. (These usually start
100with "L" or ".").
101.TP
f7b839f7
DM
102.B \-b \fIbyte\fR, \fB\-\-byte=\fIbyte
103Keep only every \fIbyte\fPth byte of the input file (header data is
104not affected). \fIbyte\fP can be in the range from 0 to the
105interleave-1. This option is useful for creating files to program
106ROMs. It is typically used with an srec output target.
107.TP
108.B \-i \fIinterleave\fR, \fB\-\-interleave=\fIinterleave
109Only copy one out of every \fIinterleave\fP bytes. Which one to copy is
110selected by the \fB\-b\fP or \fB\-\-byte\fP option. The default is 4.
111The interleave is ignored if neither \fB\-b\fP nor \fB\-\-byte\fP is given.
112.TP
6c7ed084
ILT
113.B \fB\-\-set\-start=\fIval
114Set the start address of the new file to \fIval\fP. Not all object
115file formats support setting the start address.
116.TP
117.B \fB\-\-adjust\-start=\fIincr
118Adjust the start address by adding \fIincr\fP. Not all object file
119formats support setting the start address.
120.TP
121.B \fB\-\-adjust\-vma=\fIincr
122Adjust the address of all sections, as well as the start address, by
123adding \fIincr\fP. Some object file formats do not permit section
124addresses to be changed arbitrarily. Note that this does not relocate
125the sections; if the program expects sections to be loaded at a
126certain address, and this option is used to change the sections such
127that they are loaded at a different address, the program may fail.
128.TP
129.B \fB\-\-adjust\-section\-vma=\fIsection{=,+,-}val
130Set or adjust the address of the named \fIsection\fP. If \fI=\fP is
131used, the section address is set to \fIval\fP. Otherwise, \fIval\fP
132is added to or subtracted from the section address. See the comments
133under \fB\-\-adjust\-vma\fP, above. If \fIsection\fP does not exist
134in the input file, a warning will be issued, unless
135\fB\-\-no\-adjust\-warnings\fP is used.
136.TP
137.B \fB\-\-adjust\-warnings
138If \fB\-\-adjust\-section\-vma\fP is used, and the named section does
139not exist, issue a warning. This is the default.
140.TP
141.B \fB\-\-no\-adjust\-warnings
142Do not issue a warning if \fB\-\-adjust\-section\-vma\fP is used, even
143if the named section does not exist.
144.TP
3883531f 145.B \-v\fR, \fB\-\-verbose
08ad9921 146Verbose output: list all object files modified. In the case of
b26ac613
DM
147archives, "\fBobjcopy \-V\fR" lists all members of the archive.
148.TP
3883531f 149.B \-V\fR, \fB\-\-version
08ad9921 150Show the version number of
b26ac613
DM
151.B objcopy
152and exit.
153.TP
154.B \-\-help
155Show a summary of the options to
156.B objcopy
157and exit.
08ad9921
JO
158.SH "SEE ALSO"
159.RB "`\|" binutils "\|'"
160entry in
161.B
162info\c
163\&;
164.I
165The GNU Binary Utilities\c
166\&, Roland H. Pesch (June 1993).
167
168.SH COPYING
6c7ed084 169Copyright (c) 1993,1994 Free Software Foundation, Inc.
08ad9921
JO
170.PP
171Permission is granted to make and distribute verbatim copies of
172this manual provided the copyright notice and this permission notice
173are preserved on all copies.
174.PP
175Permission is granted to copy and distribute modified versions of this
176manual under the conditions for verbatim copying, provided that the
177entire resulting derived work is distributed under the terms of a
178permission notice identical to this one.
179.PP
180Permission is granted to copy and distribute translations of this
181manual into another language, under the above conditions for modified
182versions, except that this permission notice may be included in
183translations approved by the Free Software Foundation instead of in
184the original English.
This page took 0.12131 seconds and 4 git commands to generate.