* write.c (renumber_sections): New static BFD_ASSEMBLER function.
[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
3.TH objcopy 1 "June 1993" "cygnus support" "GNU Development Tools"
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 "\|]"
f7b839f7
DM
26.RB "[\|" \-b\ \fIbyte\fP |\ \-\-byte=\fIbyte\fP "\|]"
27.RB "[\|" \-i\ \fIinterleave\fP |\ \-\-interleave=\fIinterleave\fP "\|]"
3883531f
JO
28.RB "[\|" \-v\ |\ \-\-verbose\fR "\|]"
29.RB "[\|" \-V\ |\ \-\-version\fR "\|]"
30.RB "[\|" \-\-help\fR "\|]"
b26ac613 31.B infile
3883531f 32.RB "[\|" outfile\fR "\|]"
08ad9921
JO
33.SH DESCRIPTION
34The GNU
35.B objcopy
36utility copies the contents of an object file to another.
37.B objcopy
38uses the GNU BFD Library to read and write the object files. It can
39write the destination object file in a format different from that of
40the source object file. The exact behavior of
41.B objcopy
42is controlled by command-line options.
b26ac613 43.PP
08ad9921
JO
44.B objcopy
45creates temporary files to do its translations and deletes them
46afterward.
47.B objcopy
48uses BFD to do all its translation work; it knows about all the
49formats BFD knows about, and thus is able to recognize most formats
50without being told explicitly.
b26ac613
DM
51.PP
52.I infile
53and
54.I outfile
55are the source and output files respectively. If you do not specify
08ad9921
JO
56.IR outfile ,
57.B objcopy
58creates a temporary file and destructively renames the result with the
59name of the input file.
b26ac613
DM
60
61.SH OPTIONS
08ad9921 62.TP
eae04238 63.B \-I \fIbfdname\fR, \fB\-\-input\-target=\fIbfdname
08ad9921 64Consider the source file's object format to be
eae04238 65.IR bfdname ,
08ad9921
JO
66rather than attempting to deduce it.
67.TP
eae04238 68.B \-O \fIbfdname\fR, \fB\-\-output\-target=\fIbfdname
08ad9921 69Write the output file using the object format
eae04238 70.IR bfdname .
08ad9921 71.TP
eae04238 72.B \-F \fIbfdname\fR, \fB\-\-target=\fIbfdname
08ad9921 73Use
eae04238 74.I bfdname
08ad9921
JO
75as the object format for both the input and the output file; i.e.
76simply transfer data from source to destination with no translation.
77.TP
0aca460e
ILT
78.B \-R \fIsectionname\fR, \fB\-\-remove-section=\fIsectionname
79Remove the named section from the file. This option may be given more
80than once. Note that using this option inappropriately may make the
81output file unusable.
82.TP
3883531f 83.B \-S\fR, \fB\-\-strip\-all
08ad9921
JO
84Do not copy relocation and symbol information from the source file.
85.TP
3883531f 86.B \-g\fR, \fB\-\-strip\-debug
08ad9921
JO
87Do not copy debugging symbols from the source file.
88.TP
3883531f 89.B \-x\fR, \fB \-\-discard\-all
08ad9921
JO
90Do not copy non-global symbols from the source file.
91.TP
3883531f 92.B \-X\fR, \fB\-\-discard\-locals
08ad9921
JO
93Do not copy compiler-generated local symbols. (These usually start
94with "L" or ".").
95.TP
f7b839f7
DM
96.B \-b \fIbyte\fR, \fB\-\-byte=\fIbyte
97Keep only every \fIbyte\fPth byte of the input file (header data is
98not affected). \fIbyte\fP can be in the range from 0 to the
99interleave-1. This option is useful for creating files to program
100ROMs. It is typically used with an srec output target.
101.TP
102.B \-i \fIinterleave\fR, \fB\-\-interleave=\fIinterleave
103Only copy one out of every \fIinterleave\fP bytes. Which one to copy is
104selected by the \fB\-b\fP or \fB\-\-byte\fP option. The default is 4.
105The interleave is ignored if neither \fB\-b\fP nor \fB\-\-byte\fP is given.
106.TP
3883531f 107.B \-v\fR, \fB\-\-verbose
08ad9921 108Verbose output: list all object files modified. In the case of
b26ac613
DM
109archives, "\fBobjcopy \-V\fR" lists all members of the archive.
110.TP
3883531f 111.B \-V\fR, \fB\-\-version
08ad9921 112Show the version number of
b26ac613
DM
113.B objcopy
114and exit.
115.TP
116.B \-\-help
117Show a summary of the options to
118.B objcopy
119and exit.
08ad9921
JO
120.SH "SEE ALSO"
121.RB "`\|" binutils "\|'"
122entry in
123.B
124info\c
125\&;
126.I
127The GNU Binary Utilities\c
128\&, Roland H. Pesch (June 1993).
129
130.SH COPYING
131Copyright (c) 1993 Free Software Foundation, Inc.
132.PP
133Permission is granted to make and distribute verbatim copies of
134this manual provided the copyright notice and this permission notice
135are preserved on all copies.
136.PP
137Permission is granted to copy and distribute modified versions of this
138manual under the conditions for verbatim copying, provided that the
139entire resulting derived work is distributed under the terms of a
140permission notice identical to this one.
141.PP
142Permission is granted to copy and distribute translations of this
143manual into another language, under the above conditions for modified
144versions, except that this permission notice may be included in
145translations approved by the Free Software Foundation instead of in
146the original English.
This page took 0.073492 seconds and 4 git commands to generate.