objcopy [ -F bfdname | --target=bfdname ] [ -I bfdname | --input-target=bfdname ] [ -O bfdname | --output-target=bfdname ] [ -S | --strip-all ] [ -g | --strip-debug ] [ -K symbolname | --keep-symbol=symbolname ] [ -N symbolname | --strip-symbol=symbolname ] [ -L symbolname | --localize-symbol=symbolname ] [ -W symbolname | --weaken-symbol=symbolname ] [ -x | --discard-all ] [ -X | --discard-locals ] [ -b byte | --byte=byte ] [ -i interleave | --interleave=interleave ] [ -j sectionname | --only-section=sectionname ] [ -R sectionname | --remove-section=sectionname ] [ -p | --preserve-dates ] [ --debugging ] [ --gap-fill=val ] [ --pad-to=address ] [ --set-start=val ] [ --adjust-start=incr ] [ --change-addresses=incr ] [ --change-section-address section{=,+,-}val ] [ --change-section-lma section{=,+,-}val ] [ --change-section-vma section{=,+,-}val ] [ --change-warnings ] [ --no-change-warnings ] [ --set-section-flags section=flags ] [ --add-section sectionname=filename ] [ --change-leading-char ] [ --remove-leading-char ] [ --redefine-sym old=new ] [ --weaken ] [ -v | --verbose ] [ -V | --version ] [ --help ] infile [outfile]
The GNU objcopy
utility copies the contents of an object
file to another. objcopy
uses the GNU BFD Library to
read and write the object files. It can write the destination object
file in a format different from that of the source object file. The
exact behavior of objcopy
is controlled by command-line options.
objcopy
creates temporary files to do its translations and
deletes them afterward. objcopy
uses BFD to do all its
translation work; it has access to all the formats described in BFD
and thus is able to recognize most formats without being told
explicitly. See BFD.
objcopy
can be used to generate S-records by using an output
target of `srec
' (e.g., use `-O srec
').
objcopy
can be used to generate a raw binary file by using an
output target of `binary
' (e.g., use `-O binary
'). When
objcopy
generates a raw binary file, it will essentially produce
a memory dump of the contents of the input object file. All symbols and
relocation information will be discarded. The memory dump will start at
the load address of the lowest section copied into the output file.
When generating an S-record or a raw binary file, it may be helpful to
use `-S
' to remove sections containing debugging information. In
some cases `-R
' will be useful to remove sections which contain
information that is not needed by the binary file.
infile
outfile
objcopy
creates a
temporary file and destructively renames the result with
the name of infile.
-I bfdname
--input-target=bfdname
-O bfdname
--output-target=bfdname
-F bfdname
--target=bfdname
-j sectionname
--only-section=sectionname
-R sectionname
--remove-section=sectionname
-S
--strip-all
-g
--strip-debug
--strip-unneeded
-K symbolname
--keep-symbol=symbolname
-N symbolname
--strip-symbol=symbolname
-L symbolname
--localize-symbol=symbolname
-W symbolname
--weaken-symbol=symbolname
-x
--discard-all
-X
--discard-locals
L
' or `.
'.)
-b byte
--byte=byte
-i
' or `--interleave
'
option, or the default of 4. This option is useful for creating files
to program ROM. It is typically used with an srec
output
target.
-i interleave
--interleave=interleave
--byte
' option. The default is 4.
objcopy
ignores this option if you do not specify either `-b
' or
`--byte
'.
-p
--preserve-dates
--debugging
--gap-fill val
--pad-to address
--gap-fill
' (default zero).
--set-start val
--change-start incr
--adjust-start incr
--change-addresses incr
--adjust-vma incr
--change-section-address section{=,+,-}val
--adjust-section-vma section{=,+,-}val
=
' is used, the section address is set to
val. Otherwise, val is added to or subtracted from the
section address. See the comments under `--change-addresses
',
above. If section does not exist in the input file, a warning will
be issued, unless `--no-change-warnings
' is used.
--change-section-lma section{=,+,-}val
=
' is used, the section address is set to
val. Otherwise, val is added to or subtracted from the
section address. See the comments under `--change-addresses
',
above. If section does not exist in the input file, a warning
will be issued, unless `--no-change-warnings
' is used.
--change-section-vma section{=,+,-}val
=
' is used, the section address
is set to val. Otherwise, val is added to or subtracted
from the section address. See the comments under
`--change-addresses
', above. If section does not exist in
the input file, a warning will be issued, unless
`--no-change-warnings
' is used.
--change-warnings
--adjust-warnings
--change-section-address
' or `--change-section-lma
' or
`--change-section-vma
' is used, and the named section does not
exist, issue a warning. This is the default.
--no-change-warnings
--no-adjust-warnings
--change-section-address
' or
`--adjust-section-lma
' or `--adjust-section-vma
' is used, even
if the named section does not exist.
--set-section-flags section=flags
alloc
', `contents
', `load
', `noload
',
`readonly
', `code
', `data
', `rom
', `share
', and
`debug
'. You can set the `contents
' flag for a section which
does not have contents, but it is not meaningful to clear the
`contents
' flag of a section which does have contents--just remove
the section instead. Not all flags are meaningful for all object file
formats.
--add-section sectionname=filename
--change-leading-char
objcopy
to
change the leading character of every symbol when it converts between
object file formats. If the object file formats use the same leading
character, this option has no effect. Otherwise, it will add a
character, or remove a character, or change a character, as
appropriate.
--remove-leading-char
--change-leading-char
because it always changes the symbol name
when appropriate, regardless of the object file format of the output
file.
--redefine-sym old=new
--weaken
-R
option to the linker. This option is only effective when
using an object file format which supports weak symbols.
-V
--version
objcopy
.
-v
--verbose
objcopy -V
' lists all members of the archive.
--help
objcopy
.
Packaging copyright © 1988-2000 OAR Corporation
Context copyright by each document's author. See Free Software Foundation for information.