In
computing, the 'Executable and Linking Format' ('ELF', formerly called 'Extensible Linking Format') is a common standard
file format for
executables,
object code,
shared libraries, and
core dumps. First published in the
System V Application Binary Interface specification, and later in the
Tool Interface Standard, it was quickly accepted among different vendors of
Unix systems. In 1999 it was chosen as the standard binary file format for Unix and
Unix-like systems by the
86open project.
Today the ELF format has replaced executable formats such as
a.out and
COFF in the
Linux,
Solaris,
IRIX,
FreeBSD,
NetBSD, and
OpenBSD operating systems (
DragonFly BSD was forked from FreeBSD after the switch to ELF). Because other formats are proprietary, platform-specific, or less extensible than ELF, some users hold that ELF outperforms other formats, whereas others may consider it a competitor to the other formats. ELF is also used in the Itanium version of
OpenVMS, a non-UNIX-based operating system, as well as replacing the
Portable Executable on
BeOS Revision 4 and later for
x86 based computers (
PPC computers stayed with
Preferred Executable Format, having never used Portable Executable), which are also not UNIX-based. The
PlayStation Portable,
PlayStation 2 and
PlayStation 3 consoles also use ELF as their executable file format.
ELF file layout
Each ELF file is made up of one ELF header, followed by file data. The file data can include:
★ Program header table, describing zero or more segments
★ Section header table, describing zero or more sections
★ Data referred to by entries in the program or section header table
The segments contain information that is necessary for runtime execution of the file, while sections contain important data for linking and relocation. Each byte in the entire file is taken by no more than one section at a time, but there can be orphan bytes, which are not covered by a section. In the normal case of a Unix executable one or more sections are enclosed in one segment.
Tools
★
readelf is a Unix binary utility that displays information about one or more ELF files. A
GPL implementation is provided by
GNU Binutils.
★
elfdump is a Solaris command for viewing ELF information in an elf file.
★
objdump provides a wide range of information about ELF files and other object formats.
See also
★
Portable Executable (PE)
★
DWARF
★
Mach-O
External links
★ Tool Interface Standard (TIS)
Executable and Linking Format (ELF) Specification Version 1.2 (May 1995)
★
ELF for the ARM Architecture
★
ELF-64 Object File Format Version 1.5 Draft 2 (May 1998)
★
Elf library routines
★
free ELF object file access library
★
ELFIO: a C++ library for reading and generating files in the ELF binary format.
★ ''
How To Write Shared Libraries'' by
Ulrich Drepper (2006-08-20)
★ ''
An unsung hero: The hardworking ELF'' by Peter Seebach (2005-12-20)
★ ''
LibElf and GElf — A Library to Manipulate ELF Files'' by Neelakanth Nadgir (August 2001)
★ ''
The ELF Object File Format by Dissection'' by Eric Youngdale (1995-05-01)
★ ''
A Whirlwind Tutorial on Creating Really Teensy ELF Executables for Linux'' by Brian Raiter
★
FreeBSD Handbook — Binary formats
★
Description of the ELF binary format
★
elf(5) manual page
★
NetBSD ELF FAQ
★
view Sun's Linker and Libraries Guide