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

  • 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 23
18 Chapter 4. objcopy
-add-section sectionname=filename
Add a new section named sectionname while copying the file. The contents of the new section
are taken from the file filename. The size of the section will be the size of the file. This option
only works on file formats which can support sections with arbitrary names.
-rename-section oldname=newname[,flags]
Rename a section from oldname to newname, optionally changing the section’s flags to flags
in the process. This has the advantage over usng a linker script to perform the rename in that the
output stays as an object file and does not become a linked executable.
This option is particularly helpful when the input format is binary, since this will always cre-
ate a section called .data. If for example, you wanted instead to create a section called .rodata
containing binary data you could use the following command line to achieve it:
objcopy -I binary -O
output_format -B architecture \
--rename-section .data=.rodata,alloc,load,readonly,data,contents \
input_binary_file output_object_file
-change-leading-char
Some object file formats use special characters at the start of symbols. The most common
such character is underscore, which compilers often add before every symbol. This option tells
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. Oth-
erwise, it will add a character, or remove a character, or change a character, as appropriate.
-remove-leading-char
If the first character of a global symbol is a special symbol leading character used by the object
file format, remove the character. The most common symbol leading character is underscore.
This option will remove a leading underscore from all global symbols. This can be useful if
you want to link together objects of different file formats with different conventions for symbol
names. This is different from -change-leading-char because it always changes the symbol
name when appropriate, regardless of the object file format of the output file.
-srec-len=ival
Meaningful only for srec output. Set the maximum length of the Srecords being produced to
ival. This length covers both address, data and crc fields.
-srec-forceS3
Meaningful only for srec output. Avoid generation of S1/S2 records, creating S3-only record
format.
-redefine-sym old=new
Change the name of a symbol old, to new. This can be useful when one is trying link two things
together for which you have no source, and there are name collisions.
-redefine-syms=filename
Apply -redefine-sym to each symbol pair "old new" listed in the file filename. filename
is simply a flat file, with one symbol pair per line. Line comments may be introduced by the hash
character. This option may be given more than once.
-weaken
Change all global symbols in the file to be weak. This can be useful when building an object
which will be linked against other objects using the -R option to the linker. This option is only
effective when using an object file format which supports weak symbols.
Vue de la page 23
1 2 ... 19 20 21 22 23 24 25 26 27 28 29 ... 79 80

Commentaires sur ces manuels

Pas de commentaire