elfdump
is a diagnostic tool that gives you information about the contents of an ELF object file.
NOTE: This tool is included in the compiler suite because you may find it useful, but it is an unsupported tool.
Using the elfdump Command Line Tool
elfdump
reads the input ELF object files that you specify and generates a report of information about the ELF object files.
By default, elfdump output includes a header for each file and information for all sections in each file. But the command line options allow you to change the content and format of the output information.
Listing 8.1 Sample elfdump output
ELF FILE NAME: samplelib_startup.o FILE CLASS: 32-bit objects DATA ENCODING: little endian FILE TYPE: relocatable ENTRY POINT: undefined TARGET: ARM/Thumb Architecture EABI VERSION: 2 ATTRIBUTES: SECTION INFORMATION section offset size props alignment name -------------------------------------------------------------------------------------------- 1 00000040 00000008 a + w 0004 runtime_helper_data_area 2 00000048 00000004 a + w 0004 palm$$_slib_boxl_0_0 . . . _________ ___/ Section 1 \_____________________________________________________________________________ / | name: runtime_helper_data_area | type: 0x1 (progbits) | flags: 0x00000003 (allocated + writable) | address: 0x00000000 | offset: 0x00000040 | size: 0x8 | link: 0x0 | info: 0x0 | alignment: 4 00000000 00 00 00 00 00 00 00 00 . . . . . . . . _________ ___/ Section 2 \_____________________________________________________________________________ / | name: palm$$_slib_boxl_0_0 | type: 0x1 (progbits) | flags: 0x00000003 (allocated + writable) | address: 0x00000000 | offset: 0x00000048 | size: 0x4 | link: 0x0 | info: 0x0 | alignment: 4 00000000 00 00 00 00 . . . .
elfdump Reference
This section provides reference information for the elfdump tool.
elfdump Command Line Interface
The general format of the elfdump
command line interface is this:
elfdump [options] input_files
-
options
-
elfdump
options, as described in the section "elfdump Options." -
input_files
- A list of ELF object files.
elfdump Options
-
-help
-
elfdump
prints a summary of help. -
-o outputfile
- Sets the name of the output file to the name specified by outputfile.
- If you do not specify an output filename,
elfdump
sends the output information tostdout
(usually dumping the information to the screen). -
-V
-
elfdump
writes the its version numbers tostderr
, and exits without performing any further actions. -
-v level
- Sets the
elfdump
verbosity level: -
0
-
elfdump
displays errors only. This is the default verbosity level. -
1
-
elfdump
displays warnings and errors. -
2
-
elfdump
displays all messages. -
-nodis
-
elfdump
disassembles executable bytecode sections, showing them as hex data dumps. -
-nodwarfdis
-
elfdump
does not decode debug data. -
-sortsyms
-
elfdump
sorts the output symbol table by value. -
-disdata
-
elfdump
disassembles data sections as code including labels. -
-allsyms
-
elfdump
shows all (possibly superfluous) symbols in the disassembly. -
-arch vers
-
elfdump
disassemble for the given instruction set architecture. -
vers
- An instruction set architecture value.
- Valid values:
v3
,v3M
,v4
,v4xM
,v4T
,v4TxM
,v5
,v5xM
,v5T
,v5TxM
,v5TexP
,v5TE
- The default value is
v5TE
. -
-summary
-
elfdump
includes only segment and section summaries.