| |||
| Home > Using fromELF > fromELF command-line options | |||
The fromELF command syntax is as follows:
fromelf [-help] [ -fieldoffsets [[-select select_options ]]] [-nolinkview] [-nodebug] [-vsn] [[text_output_format] | code_output_format] [-base n] [memory_config] [-utputo output_file] {input_file}
where:
-helpThis option shows help and usage information. If this option is specified, other command-line options are ignored. Calling fromELF without any parameters produces the same help information.
-fieldoffsetsThis option produces, to standard output, a list of assembly language EQU directives
that equate C++ class or C structure field names to their offsets
from the base of the class or structure. The input ELF file can
be a relocatable object or an image.
Use -o to redirect the output to a file.
Use the INCLUDE command from armasm to load the
produced file and provide access to C++ classes and C structure
members by name from assembly language. See RealView Compilation Tools for BREW Assembler Guide for
more information on armasm.
If the source file does not have debug information, this option
is not available. You cannot use this option together with a .code_output_format
-fieldoffsets outputs all structure information.
To output a subset of the structures, use -select . select_options
If you do not require a file that can be input to armasm,
use the -text -a option to format the display
addresses in a more readable form. The -a option
only outputs address information for structures and static data
in images because the addresses are not known in a relocatable object.
-select select_optionsUse -select together
with either the select_option-fieldoffsets or -text
-a options to select only those fields that match the patterns
in the option list.
Use special characters to select multiple fields:
Join options in the list together with a , as
in: a*,b*,c*.
The wildcard character * can
be used to match any name.
The wildcard character ? can
be used to match any single letter.
Specify the fields to include by prefixing a + to
the select_option string. This is the default.
Specify the fields to exclude by prefixing a ~ to
the select_option string.
If you are using a special character on Unix, you must enclose the options in quotes to prevent the shell expanding the selection.
-nolinkviewUse -nolinkview to
discard the section-level view (link-time view) from the ELF image
and retain only the segment level view (load-time view). Discarding
the link-view section level eliminates:
the section header table
the section header string table
the string table
the symbol table
all debug sections.
All that is left in the output is the program header table and the program segments. According to the ELF specification, these are all that a program loader can rely upon being present in an ELF file.
This option can have unexpected effects if -elf is
not specified on the command line. See Example 6.2 for an example of
correct usage.
-nodebugThis
option does not put debug information in the output files. This
is the default for binary images. If -nodebug is
specified, it affects all output formats. It overrides the -text
-g option.
This option can have unexpected effects if -elf is
not specified on the command line. The options in Example 6.1 produce
a text file because no output format has been specified.
To get ELF format output use the options shown in Example 6.2
-vsnThis option displays fromELF version information.
text_output_formatUse a text specification, for example -text
-c, to display image information in text format. You can
decode an ELF image or ELF object file using this option. This is
the default. If no text or code output format is specified, -text is
assumed.
If is
not specified with the output_file-o option, the information is
displayed on stdout.
If a specific text category is not specified, the default is to output header information.
If specified, the text category consists of one or more of the following:
aPrints the global and static data addresses (including addresses
for structure and union contents). This option can only be used
on files containing debug information. Use the -select option
to output a subset of the data addresses.
cDisassembles code
dPrints contents of the data sections
gPrints debug information
rPrints relocation information
sPrints the symbol table
tPrints the string table(s)
vPrints detailed information on each segment and section header of the image
zPrints the code and data sizes.
The category selectors can be specified as one of:
individual options, -text
-c -d
a single concatenated string, -text -cd
category selectors only, -c -d
multiple characters following a slash character, -text/cd.
If an output format is not specified, the default output format
of -text is used and the individual category
selectors are recognized. If another output format is specified,
the selectors are ignored.
code_output_formatThis option selects the binary or ELF output file
options. can
be one of:code_output_format
-binPlain binary. You can split output from this option
into multiple files with the option.memory_config
-ihfExtended
Intellec Hex format. You can specify the base address of the output
with the -base option. (This option is deprecated
and will be removed from future versions of the product.)
-m32Motorola
32-bit format (32-bit S-records). You can specify the base address
of the output with the -base option.
-i32Intel
Hex-32 format. You can specify the base address of the output with
the -base option.
-vhxByte
Oriented (Verilog Memory Model) Hex format. This format is suitable
for loading into the memory models of HDL simulators. You can split
output from this option into multiple files with the option.memory_config
-elfELF format (resaves as ELF). This can be used to convert a debug ELF image into a no-debug ELF image.
If you use fromELF to convert an ELF image containing multiple load
regions to a binary format using any of the -bin, -ihf, -m32, -i32,
or -vhx options, fromELF creates an output directory
named and
generates one binary output file for each load region in the input
image. fromELF places the output files in the output_file directory.output_file
-base nThis option specifies the base address of the output
for Motorola S-record, Intel Hex, and Extended Intellec Hex file
formats. This option is available only if -m32, -i32,
or -ihf is specified as the output format.
You can specify the base address as either:
a decimal value, for example -base
0
as a hexadecimal value, for example -base
0x8000.
All addresses encoded in the output file start at the base
address . If you
do not specify a n-base option, the base address
is taken from the load region address.
If multiple load regions are present, the -base value
is used for each output file. That is, it overrides all load region
addresses.
memory_configThis option outputs multiple files for multiple
memory banks. This option is available only if -vhx or -bin is
specified as the output format.
The format of ismemory_config - where:widthxbanks
widthis the width of memory in the target memory system (8-bit, 16-bit, 32-bit, or 64-bit).
banksspecifies the number of memory banks in the target memory system.
Valid configurations are:
-8x1 -8x2 -8x4 -16x1 -16x2 -32x1 -32x2 -64x1
fromELF uses the last specified configuration if more than
one configuration is specified. If this option is selected for any
format other than -bin or -vhx it
is ignored.
If the image has one load region, fromELF generates files with
the following naming conventions: bank
If
there is one memory bank ( is
1) the output file is named by the banks-o argument.output_file
If there are multiple memory banks (bank>1), fromELF generates number
of files starting with banks and
finishing with output_file0.
For example:output_file bank-1
fromelf -vhx -8x2 test.axf -o test
generates two files named test0 and test1.
If the image has multiple load regions, fromELF creates a directory
named and
generates bank files for each load region named output_file to load
region0.load region
banks-1
The memory width specified by controls
the size of the chunk of information read from the image and written
to a file. The first chunk read is allocated to the first file (width),
the next chunk is allocated to the next file. After a chunk is allocated to
the last file, allocation begins again with the first file (that
is, the allocation is modulo based on the number of files). For
example:output_file0
For a of memory_config-8x4
byte0 -> file0 byte1 -> file1 byte2 -> file2 byte3 -> file3 byte4 -> file0 ...
For a of memory_config-16x2
halfword0 -> file0 halfword1 -> file1 halfword3 -> file0 ...
-output output_fileThis option specifies the name of the output file,
or the name of the output directory if multiple output files are
created (see the description of and text_output_format for more
information). Specifying the output file is optional with the code_output_format-text output
option and mandatory with all other outputs.
input_fileThis option specifies the ELF file to be translated.
fromELF accepts only ARM-executable ELF files and ARM object ELF files (.o).