|
|
| |
ELFLS(1) |
FreeBSD General Commands Manual |
ELFLS(1) |
elfls - display the contents of an ELF file
elfls examines an ELF file, reads the program header table and the
section header table, and displays a synopsis of the contents.
- -c, --sources
- Include the listing of the source files.
- -d, --dependencies
- Include the listing of the program's dependencies.
- -i, --nostr
- 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, --nopos
- Suppress display of positions of entries within the file.
- -P, --nophdr
- Suppress the listing of the program header table.
- -S, --noshdr
- Suppress the listing of the section header table.
- -w, --width=N
- Set the maximum width of the lines of the output to N. N can
be zero to display each entry on a separate line, with no maximum
width.
- --help
- Display help and exit.
- --version
- Display version information and exit.
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, an ampersand
& if the file is a shared library, or a dollar sign $ if
the file is a core file. 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.
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:
- B
- Binary data: machine language instructions or data used by the program
proper.
- P
- The program header table.
- D
- The dynamic linking information section.
- I
- The interpreter specification. Typically, this will be the pathname of the
dynamic linker.
- N
- A note section, the details of which are unspecified.
- U
- Exception frame stack data, used by the code to unwind stacks.
- 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 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 --nostr is specified, interpreter and
note entries in the program header table are simply displayed as a string
indicating their contents.
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:
- B
- 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.
- $
- A string table.
- H
- A hash table of symbols used for dynamic linking.
- D
- The dynamic linking information section.
- P
- A procedure linking table.
- O
- The global offset table.
- I
- The interpreter specification. Typically, this will be the pathname of the
dynamic linker.
- R
- A list of relocation records.
- V
- A section specifying version dependencies for the program.
- G
- A section providing debug information.
- U
- An exception header data section, used when unwinding the stack.
- N
- A note section, the contents of which are unspecified.
- C
- A comment section: 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 --nostr is specified, interpreter,
comment and note entries in the program header table are simply displayed as
a string indicating their contents.
Copyright © 1999,2011 Brian Raiter
<breadbox@muppetlabs.com>.
License GPLv2+: GNU GPL version 2 or later. This is free software:
you are free to change and redistribute it. There is NO WARRANTY, to the
extent permitted by law.
Visit the GSP FreeBSD Man Page Interface. Output converted with ManDoc. |