Red Hat ENTERPRISE LINUX 4 - USING BINUTILS Manuel d'utilisateur Page 20

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 80
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 19
14 Chapter 4. objcopy
[--help] [--info]
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. 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).
infile
outfile
The input and output files, respectively. If you do not specify outfile, objcopy creates a
temporary file and destructively renames the result with the name of infile.
-I bfdname
-input-target=bfdname
Consider the source file’s object format to be bfdname, rather than attempting to deduce it.
Section 16.1 Target Selection, for more information.
-O bfdname
-output-target=bfdname
Write the output file using the object format bfdname. Section 16.1 Target Selection, for more
information.
-F bfdname
-target=bfdname
Use bfdname as the object format for both the input and the output file; i.e., simply transfer data
from source to destination with no translation. Section 16.1 Target Selection, for more informa-
tion.
-B bfdarch
-binary-architecture=bfdarch
Useful when transforming a raw binary input file into an object file. In this case the output
architecture can be set to bfdarch. This option will be ignored if the input file has a known
bfdarch. You can access this binary data inside a program by referencing the special symbols
that are created by the conversion process. These symbols are called _binary_objfile_start,
Vue de la page 19
1 2 ... 15 16 17 18 19 20 21 22 23 24 25 ... 79 80

Commentaires sur ces manuels

Pas de commentaire