elfls

Langue: en

Version: 314976 (ubuntu - 07/07/09)

Section: 1 (Commandes utilisateur)

NAME

elfls - display the contents of an ELF file

SYNOPSIS

elfls [-hvPScdEip] [-w N] FILE...

DESCRIPTION

elfls examines an ELF file, reads the program header table and the section header table, and displays a synopsis of the contents.

OPTIONS

-h
Display help and exit.
-v
Display version number and exit.
-P
Suppress the listing of the program header table.
-S
Suppress the listing of the section header table.
-c
Include the listing of the source files.
-d
Include the listing of the program's dependencies.
-E
Don't examines the contents of the ELF identifier. By default elfls verifies that a version 1 ELF identifier is present, and indicates a 32-bit ELF file of the proper endianness. Use of this option skips this verification.
-i
Don't treat small entries specially. By default, program and section header entries whose referenced contents are mainly or entirely short, null-terminated strings are listed by simply displaying the string (namely interpreter, comment, and note sections). Use of this option causes such entries to be displayed the same as other entries.
-p
Suppress display of positions of entries within the file.
-w N
Set the maximum width of the lines of the output to N. N can be zero to indicate no maximum width.

PROGRAM OUTPUT

The output of the program, for each ELF file given on the command line, is as follows:

file name
dependencies
source files
program header table
section header table

The first line of the output shows the name of the file, and the architecture it was created for. The file name will be suffixed with an asterisk * if the file is a binary executable, or an ampersand & if the file is a shared library. Otherwise, the file is an object file. (This is the only line that is guaranteed to be output. The other information is not shown if the data is not applicable, not present in the file, or suppressed via the command-line options.)

After the file name is shown the list of shared-object libraries with which the file is dynamically linked, if any.

Next is shown the list of the source files which were used to build the file, presuming this information is available.

The list of entries in the program header table appears next. See below for a detailed description of the output. Binary executables and shared libraries always contain a program header table.

Finally, the entries in the section header table are displayed. See below for a detailed description of the output. ELF files almost always contain a section header table, although they are only required for object files.

PROGRAM HEADER TABLE

The entries in the program header table are displayed in following format:

ind T rwx pos size address

ind
The index number of the entry in the program header table.
T
A letter indicating the entry's type. The possible types are:
  P
Program data: machine language instructions or data used by the program proper.
  T
The program header table.
  L
The dynamic linking information section.
  I
The interpreter specification. Typically, this will be the pathname of the dynamic linker.
  N
The note section, which typically includes the name and version number of the program that created the file.
rwx
Flags indicating memory permissions for the contents of this entry. r indicates that the contents are to be loaded into readable memory, w indicates that the memory is to be writeable, and x indicates that the memory is to be executable. An s can also appear in the final position, which additionally indicates that this section contains the program's starting point.
pos
A hexadecimal number indicating the position within the file of this entry's contents.
size
A hexadecimal number indicating the size of the entry's contents.
address
A hexadecimal number indicating the (virtual) memory address at which to load this entry's contents.

A hexadecimal number at the end of the entry prefixed with a + indicates by how much the size of this entry should be larger in memory than it is in the file (with the extra bytes at the end to be initialized to zeroes).

Note that, unless the -i switch is used, interpreter and note entries in the program header table are simply displayed as a string indicating their contents.

SECTION HEADER TABLE

The entries in the section header table are displayed in the following format:

ind T rwx pos size name

ind
The index number of the entry in the section header table.
T
A letter indicating the entry's type. The possible types are:
  P
Program data: machine language instructions or data that are part of the program proper.
  0
Zero-initialized program data: memory is to be allocated as usual for this entry, but no data is present in the file. The memory is instead initialized to all bits zero.
  S
A table of the symbols used in the file.
  D
A symbol table, the contents of which are typically symbols specifically needed for dynamic linking.
  $
A string table.
  H
The hash table of symbols used for dynamic linking.
  L
The dynamic linking information section.
  I
The interpreter specification. Typically, this will be the pathname of the dynamic linker.
  R
A list of relocation records.
  A
A list of relocation records with explicit addends.
  U
A list of version definition records.
  V
A list of version dependencies for the program.
  W
An array of version symbol identifiers (used by the previous two sections).
  N
The note section, which typically includes the name and version number of the program that created the file.
  C
A comment section: unspecified auxiliary information, typically inserted by the program that created the file.
rwx
Flags indicating the memory usage and permission for this entry. r indicates that the contents are to be loaded into memory during process execution, w indicates that the contents are to be writeable during process execution, and x indicates that the contents contain machine-executable instructions.
pos
A hexadecimal number indicating the position within the file of this entry's contents.
size
A hexadecimal number indicating the size of the entry's contents.
name
The name of this section. If the section is a list of relocation entries, then the name will be suffixed with a colon and a number, the number indicating the index of the section to which the relocation information applies. Furthermore, several sections types contain information that refer to strings and/or symbols, which are contained in a string table section and/or symbol hash table section. Such sections will have a number in square brackets after the name, indicating the index of this section. An S in square brackets appearing after the name of a string table section indicates the string table that contains the section names.

Note that, unless the -i switch is used, interpreter, comment and note entries in the program header table are simply displayed as a string indicating their contents.

SEE ALSO

objdump(1)

The Portable Formats Specification for ELF version 1.1, created by the TIS (Tool Interface Standards), can currently be found at the following locations:

ftp://tsx.mit.edu/pub/linux/packages/GCC/ELF.doc.tar.gz
a compressed archive of the documentation in Postscript format.
http://www.muppetlabs.com/~breadbox/software/ELF.txt
a flat-text transcription of same.

AUTHOR

Brian Raiter <breadbox@muppetlabs.com>.