копировать и переводить объектные файлы (copy and translate object files)
Имя (Name)
objcopy - copy and translate object files
Синопсис (Synopsis)
objcopy [-F
bfdname|--target=
bfdname]
[-I
bfdname|--input-target=
bfdname]
[-O
bfdname|--output-target=
bfdname]
[-B
bfdarch|--binary-architecture=
bfdarch]
[-S
|--strip-all
]
[-g
|--strip-debug
]
[--strip-unneeded
]
[-K
symbolname|--keep-symbol=
symbolname]
[-N
symbolname|--strip-symbol=
symbolname]
[--strip-unneeded-symbol=
symbolname]
[-G
symbolname|--keep-global-symbol=
symbolname]
[--localize-hidden
]
[-L
symbolname|--localize-symbol=
symbolname]
[--globalize-symbol=
symbolname]
[--globalize-symbols=
filename]
[-W
symbolname|--weaken-symbol=
symbolname]
[-w
|--wildcard
]
[-x
|--discard-all
]
[-X
|--discard-locals
]
[-b
byte|--byte=
byte]
[-i
[breadth]|--interleave
[=breadth]]
[--interleave-width=
width]
[-j
sectionpattern|--only-section=
sectionpattern]
[-R
sectionpattern|--remove-section=
sectionpattern]
[--keep-section=
sectionpattern]
[--remove-relocations=
sectionpattern]
[-p
|--preserve-dates
]
[-D
|--enable-deterministic-archives
]
[-U
|--disable-deterministic-archives
]
[--debugging
]
[--gap-fill=
val]
[--pad-to=
address]
[--set-start=
val]
[--adjust-start=
incr]
[--change-addresses=
incr]
[--change-section-address
sectionpattern{=,+,-}val]
[--change-section-lma
sectionpattern{=,+,-}val]
[--change-section-vma
sectionpattern{=,+,-}val]
[--change-warnings
] [--no-change-warnings
]
[--set-section-flags
sectionpattern=flags]
[--set-section-alignment
sectionpattern=align]
[--add-section
sectionname=filename]
[--dump-section
sectionname=filename]
[--update-section
sectionname=filename]
[--rename-section
oldname=newname[,flags]]
[--long-section-names
{enable,disable,keep}]
[--change-leading-char
] [--remove-leading-char
]
[--reverse-bytes=
num]
[--srec-len=
ival] [--srec-forceS3
]
[--redefine-sym
old=new]
[--redefine-syms=
filename]
[--weaken
]
[--keep-symbols=
filename]
[--strip-symbols=
filename]
[--strip-unneeded-symbols=
filename]
[--keep-global-symbols=
filename]
[--localize-symbols=
filename]
[--weaken-symbols=
filename]
[--add-symbol
name=[section:]value[,flags]]
[--alt-machine-code=
index]
[--prefix-symbols=
string]
[--prefix-sections=
string]
[--prefix-alloc-sections=
string]
[--add-gnu-debuglink=
path-to-file]
[--keep-file-symbols
]
[--only-keep-debug
]
[--strip-dwo
]
[--extract-dwo
]
[--extract-symbol
]
[--writable-text
]
[--readonly-text
]
[--pure
]
[--impure
]
[--file-alignment=
num]
[--heap=
size]
[--image-base=
address]
[--section-alignment=
num]
[--stack=
size]
[--subsystem=
which:major.minor]
[--compress-debug-sections
]
[--decompress-debug-sections
]
[--elf-stt-common=
val]
[--merge-notes
]
[--no-merge-notes
]
[--verilog-data-width=
val]
[-v
|--verbose
]
[-V
|--version
]
[--help
] [--info
]
infile [outfile]
Описание (Description)
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. Note
that objcopy
should be able to copy a fully linked file between
any two formats. However, copying a relocatable object file
between any two formats may not work as expected.
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.
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.
Note---objcopy
is not able to change the endianness of its input
files. If the input format has an endianness (some formats do
not), objcopy
can only copy the inputs into file formats that
have the same endianness or which have no endianness (e.g.,
srec
). (However, see the --reverse-bytes
option.)