Elf Format
   HOME

TheInfoList



OR:

In computing, the Executable and Linkable FormatTool Interface Standard (TIS)
Portable Formats Specification
Version 1.1'' (October 1993)
(ELF, formerly named Extensible Linking Format), is a common standard
file format A file format is a standard way that information is encoded for storage in a computer file. It specifies how bits are used to encode information in a digital storage medium. File formats may be either proprietary or free. Some file formats ...
for
executable In computing, executable code, an executable file, or an executable program, sometimes simply referred to as an executable or binary, causes a computer "to perform indicated tasks according to encoded instruction (computer science), instructi ...
files, object code, shared libraries, and core dumps. First published in the specification for the application binary interface (ABI) of the Unix operating system version named
System V Release 4 Unix System V (pronounced: "System Five") is one of the first commercial versions of the Unix operating system. It was originally developed by AT&T and first released in 1983. Four major versions of System V were released, numbered 1, 2, 3, an ...
(SVR4), and later in the Tool Interface Standard,Tool Interface Standard (TIS)
Executable and Linking Format (ELF) Specification
Version 1.2'' (May 1995)
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 on x86 processors by the
86open In computing, the Executable and Linkable FormatTool Interface Standard (TIS) Portable Formats SpecificationVersion 1.1'' (October 1993) (ELF, formerly named Extensible Linking Format), is a common standard file format for executable files, obj ...
project. By design, the ELF format is flexible, extensible, and cross-platform. For instance, it supports different
endiannesses In computing, endianness, also known as byte sex, is the order or sequence of bytes of a word of digital data in computer memory. Endianness is primarily expressed as big-endian (BE) or little-endian (LE). A big-endian system stores the most sig ...
and address sizes so it does not exclude any particular central processing unit (CPU) or
instruction set architecture In computer science, an instruction set architecture (ISA), also called computer architecture, is an abstract model of a computer. A device that executes instructions described by that ISA, such as a central processing unit (CPU), is called an ' ...
. This has allowed it to be adopted by many different operating systems on many different hardware platforms.


File layout

Each ELF file is made up of one ELF header, followed by file data. The data can include: * Program header table, describing zero or more memory segments * Section header table, describing zero or more sections * Data referred to by entries in the program header table or section header table The segments contain information that is needed for run time execution of the file, while sections contain important data for linking and relocation. Any byte in the entire file can be owned by one section at most, and orphan bytes can occur which are unowned by any section.


File header

The ELF header defines whether to use
32-bit In computer architecture, 32-bit computing refers to computer systems with a processor, memory, and other major system components that operate on data in 32-bit units. Compared to smaller bit widths, 32-bit computers can perform large calculation ...
or 64-bit addresses. The header contains three fields that are affected by this setting and offset other fields that follow them. The ELF header is 52 or 64 bytes long for 32-bit and 64-bit binaries respectively.


Program header

The program header table tells the system how to create a process image. It is found at file offset , and consists of entries, each with size . The layout is slightly different in
32-bit In computer architecture, 32-bit computing refers to computer systems with a processor, memory, and other major system components that operate on data in 32-bit units. Compared to smaller bit widths, 32-bit computers can perform large calculation ...
ELF vs 64-bit ELF, because the are in a different structure location for alignment reasons. Each entry is structured as:


Section header


Tools

* readelf is a Unix binary utility that displays information about one or more ELF files. A free software implementation is provided by GNU Binutils. * elfutils provides alternative tools to GNU Binutils purely for Linux. * elfdump is a command for viewing ELF information in an ELF file, available under Solaris and
FreeBSD FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD), which was based on Research Unix. The first version of FreeBSD was released in 1993. In 2005, FreeBSD was the most popular ...
. * objdump provides a wide range of information about ELF files and other object formats. objdump uses the Binary File Descriptor library as a back-end to structure the ELF data. * The Unix file utility can display some information about ELF files, including the
instruction set architecture In computer science, an instruction set architecture (ISA), also called computer architecture, is an abstract model of a computer. A device that executes instructions described by that ISA, such as a central processing unit (CPU), is called an ' ...
for which the code in a relocatable, executable, or shared object file is intended, or on which an ELF core dump was produced.


Applications


Unix-like systems

The ELF format has replaced older executable formats in various environments. It has replaced
a.out a.out is a file format used in older versions of Unix-like computer operating systems for executables, object code, and, in later systems, shared libraries. This is an abbreviated form of "assembler output", the filename of the output of Ken Th ...
and COFF formats in Unix-like operating systems: * Linux *
Solaris Solaris may refer to: Arts and entertainment Literature, television and film * ''Solaris'' (novel), a 1961 science fiction novel by Stanisław Lem ** ''Solaris'' (1968 film), directed by Boris Nirenburg ** ''Solaris'' (1972 film), directed by ...
/ Illumos *
IRIX IRIX ( ) is a discontinued operating system developed by Silicon Graphics (SGI) to run on the company's proprietary MIPS workstations and servers. It is based on UNIX System V with BSD extensions. In IRIX, SGI originated the XFS file system and ...
*
FreeBSD FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD), which was based on Research Unix. The first version of FreeBSD was released in 1993. In 2005, FreeBSD was the most popular ...
*
NetBSD NetBSD is a free and open-source Unix operating system based on the Berkeley Software Distribution (BSD). It was the first open-source BSD descendant officially released after 386BSD was forked. It continues to be actively developed and is a ...
*
OpenBSD OpenBSD is a security-focused, free and open-source, Unix-like operating system based on the Berkeley Software Distribution (BSD). Theo de Raadt created OpenBSD in 1995 by forking NetBSD 1.0. According to the website, the OpenBSD project em ...
* Redox * DragonFly BSD *
Syllable A syllable is a unit of organization for a sequence of speech sounds typically made up of a syllable nucleus (most often a vowel) with optional initial and final margins (typically, consonants). Syllables are often considered the phonological "bu ...
*
HP-UX HP-UX (from "Hewlett Packard Unix") is Hewlett Packard Enterprise's proprietary implementation of the Unix operating system, based on Unix System V (initially System III) and first released in 1984. Current versions support HPE Integrity Ser ...
(except for 32-bit PA-RISC programs which continue to use SOM) * QNX Neutrino * MINIX


Non-Unix adoption

ELF has also seen some adoption in non-Unix operating systems, such as: *
OpenVMS OpenVMS, often referred to as just VMS, is a multi-user, multiprocessing and virtual memory-based operating system. It is designed to support time-sharing, batch processing, transaction processing and workstation applications. Customers using Ope ...
, in its Itanium and amd64 versions *
BeOS BeOS is an operating system for personal computers first developed by Be Inc. in 1990. It was first written to run on BeBox hardware. BeOS was positioned as a multimedia platform that could be used by a substantial population of desktop users a ...
Revision 4 and later for x86 based computers (where it replaced the Portable Executable format; the
PowerPC PowerPC (with the backronym Performance Optimization With Enhanced RISC – Performance Computing, sometimes abbreviated as PPC) is a reduced instruction set computer (RISC) instruction set architecture (ISA) created by the 1991 Apple Inc., App ...
version stayed with Preferred Executable Format) * Haiku, an open source reimplementation of BeOS * RISC OS * Stratus VOS, in PA-RISC and x86 versions * SkyOS *
Fuchsia OS Fuchsia is an open-source capability-based operating system developed by Google. In contrast to Google's Linux-based operating systems such as ChromeOS and Android, Fuchsia is based on a custom kernel named Zircon. It publicly debuted as a self ...
*
Z/TPF Transaction Processing Facility (TPF) is an IBM real-time operating system for mainframe computers descended from the IBM System/360 family, including zSeries and System z9. TPF delivers fast, high-volume, high-throughput transaction processing ...
* HPE NonStop OS * Deos
Microsoft Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
also uses the ELF format, but only for its Windows Subsystem for Linux compatibility system.


Game consoles

Some game consoles also use ELF: *
PlayStation Portable The PlayStation Portable (PSP) is a handheld game console developed and marketed by Sony Computer Entertainment. It was first released in Japan on December 12, 2004, in North America on March 24, 2005, and in PAL regions on September 1, 2005, ...
,
PlayStation Vita The PlayStation Vita (PS Vita, or Vita) is a handheld video game console developed and marketed by Sony Interactive Entertainment. It was first released in Japan on December 17, 2011, and in North America, Europe, and other international territo ...
, PlayStation (console),
PlayStation 2 The PlayStation 2 (PS2) is a home video game console developed and marketed by Sony Computer Entertainment. It was first released in Japan on 4 March 2000, in North America on 26 October 2000, in Europe on 24 November 2000, and in Australia on 3 ...
, PlayStation 3,
PlayStation 4 The PlayStation 4 (PS4) is a home video game console developed by Sony Interactive Entertainment. Announced as the successor to the PlayStation 3 in February 2013, it was launched on November 15, 2013, in North America, November 29, 2013 in ...
,
PlayStation 5 The PlayStation 5 (PS5) is a home video game console developed by Sony Interactive Entertainment. Announced as the successor to the PlayStation 4 in April 2019, it was launched on November 12, 2020, in Australia, Japan, New Zealand, North Ame ...
* GP2X * Dreamcast *
GameCube The is a home video game console developed and released by Nintendo in Japan on September 14, 2001, in North America on November 18, 2001, and in PAL territories in 2002. It is the successor to the Nintendo 64 (1996), and predecessor of the Wii ...
* Nintendo 64 *
Wii The Wii ( ) is a home video game console developed and marketed by Nintendo. It was released on November 19, 2006, in North America and in December 2006 for most other Regional lockout, regions of the world. It is Nintendo's fifth major ho ...
* Wii U


PowerPC

Other (operating) systems running on
PowerPC PowerPC (with the backronym Performance Optimization With Enhanced RISC – Performance Computing, sometimes abbreviated as PPC) is a reduced instruction set computer (RISC) instruction set architecture (ISA) created by the 1991 Apple Inc., App ...
that use ELF: * AmigaOS 4, the ELF executable has replaced the prior Extended Hunk Format (EHF) which was used on Amigas equipped with PPC processor expansion cards. * MorphOS * AROS * Café OS (The operating system ran on Wii U)


Mobile phones

Some operating systems for mobile phones and mobile devices use ELF: *
Symbian Symbian is a discontinued mobile operating system A mobile operating system is an operating system for mobile phones, tablets, smartwatches, smartglasses, or other non-laptop personal mobile computing devices. While computers such as typic ...
OS v9 uses E32Image format that is based on the ELF file format; * Sony Ericsson, for example, the W800i, W610, W300, etc. *
Siemens Siemens AG ( ) is a German multinational conglomerate corporation and the largest industrial manufacturing company in Europe headquartered in Munich with branch offices abroad. The principal divisions of the corporation are ''Industry'', '' ...
, the SGOLD and SGOLD2 platforms: from Siemens C65 to S75 and BenQ-Siemens E71/ EL71; * Motorola, for example, the E398, SLVR L7, v360, v3i (and all phone LTE2 which has the patch applied). * Bada, for example, the
Samsung Wave S8500 The Samsung Wave (or Samsung Wave GT-S8500) is a smartphone developed and produced by Samsung Electronics. It is the first smartphone to run the Bada operating system developed by Samsung Electronics, which was commercially released on May 24, 201 ...
. * Nokia phones or tablets running the Maemo or the Meego OS, for example, the Nokia N900. *
Android Android may refer to: Science and technology * Android (robot), a humanoid robot or synthetic organism designed to imitate a human * Android (operating system), Google's mobile operating system ** Bugdroid, a Google mascot sometimes referred to ...
uses ELF (shared object) libraries for the Java Native Interface. With Android Runtime (ART), the default since Android 5.0 "Lollipop", all applications are compiled into native ELF binaries on installation. Some phones can run ELF files through the use of a patch that adds assembly code to the main
firmware In computing, firmware is a specific class of computer software that provides the low-level control for a device's specific hardware. Firmware, such as the BIOS of a personal computer, may contain basic functions of a device, and may provide h ...
, which is a feature known as ''ELFPack'' in the underground modding culture. The ELF file format is also used with the
Atmel AVR AVR is a family of microcontrollers developed since 1996 by Atmel, acquired by Microchip Technology in 2016. These are modified Harvard architecture 8-bit Reduced instruction set computer, RISC single-chip microcontrollers. AVR was one of the f ...
(8-bit),
AVR32 AVR32 is a 32-bit RISC microcontroller architecture produced by Atmel. The microcontroller architecture was designed by a handful of people educated at the Norwegian University of Science and Technology, including lead designer Øyvind Strøm an ...
and with Texas Instruments MSP430 microcontroller architectures. Some implementations of Open Firmware can also load ELF files, most notably Apple's implementation used in almost all
PowerPC PowerPC (with the backronym Performance Optimization With Enhanced RISC – Performance Computing, sometimes abbreviated as PPC) is a reduced instruction set computer (RISC) instruction set architecture (ISA) created by the 1991 Apple Inc., App ...
machines the company produced.


Specifications

* Generic: **
System V Application Binary Interface
' Edition 4.1 (1997-03-18) **

' (October 2009) * AMD64: **
System V ABI, AMD64 Supplement
' * Arm: **
ELF for the ARM Architecture
' * IA-32: **
System V ABI, Intel386 Architecture Processor Supplement
' * IA-64: **
Itanium Software Conventions and Runtime Guide
' (September 2000) * M32R: **
M32R ELF ABI Supplement
' Version 1.2 (2004-08-26) * MIPS: **
System V ABI, MIPS RISC Processor Supplement
' **

' (2003-06-11) * Motorola 6800: **
Motorola 8- and 16- bit Embedded ABI
' * PA-RISC: **
ELF Supplement for PA-RISC
' Version 1.43 (October 6, 1997) *
PowerPC PowerPC (with the backronym Performance Optimization With Enhanced RISC – Performance Computing, sometimes abbreviated as PPC) is a reduced instruction set computer (RISC) instruction set architecture (ISA) created by the 1991 Apple Inc., App ...
: **
System V ABI, PPC Supplement
' **
PowerPC Embedded Application Binary Interface
32-Bit Implementation'' (1995-10-01) **

' Version 1.9 (2004) * RISC-V: **
RISC-V ELF Specification
' * SPARC: **
System V ABI, SPARC Supplement
' *
S/390 The IBM System/390 is a discontinued mainframe product family implementing the ESA/390, the fifth generation of the System/360 instruction set architecture. The first computers to use the ESA/390 were the Enterprise System/9000 (ES/90 ...
: **
S/390 32bit ELF ABI Supplement
' * zSeries: **
zSeries 64bit ELF ABI Supplement
' *
Symbian Symbian is a discontinued mobile operating system A mobile operating system is an operating system for mobile phones, tablets, smartwatches, smartglasses, or other non-laptop personal mobile computing devices. While computers such as typic ...
OS 9: **
E32Image file format on Symbian OS 9
' The Linux Standard Base (LSB) supplements some of the above specifications for architectures in which it is specified. For example, that is the case for the System V ABI, AMD64 Supplement.


86open

86open was a project to form consensus on a common binary file format for Unix and Unix-like operating systems on the common PC compatible x86 architecture, to encourage software developers to port to the architecture. The initial idea was to standardize on a small subset of Spec 1170, a predecessor of the Single UNIX Specification, and the GNU C Library (glibc) to enable unmodified binaries to run on the x86 Unix-like operating systems. The project was originally designated "Spec 150". The format eventually chosen was ELF, specifically the Linux implementation of ELF, after it had turned out to be a ''de facto'' standard supported by all involved vendors and operating systems. The group began email discussions in 1997 and first met together at the Santa Cruz Operation offices on August 22, 1997. The steering committee was Marc Ewing, Dion Johnson, Evan Leibovitch, Bruce Perens, Andrew Roach, Bryan Wayne Sparks and Linus Torvalds. Other people on the project were Keith Bostic, Chuck Cranor, Michael Davidson, Chris G. Demetriou, Ulrich Drepper, Don Dugger, Steve Ginzburg, Jon "maddog" Hall, Ron Holt, Jordan Hubbard, Dave Jensen, Kean Johnston, Andrew Josey, Robert Lipe, Bela Lubkin, Tim Marsland, Greg Page, Ronald Joe Record, Tim Ruckle, Joel Silverstein, Chia-pi Tien, and Erik Troan. Operating systems and companies represented were
BeOS BeOS is an operating system for personal computers first developed by Be Inc. in 1990. It was first written to run on BeBox hardware. BeOS was positioned as a multimedia platform that could be used by a substantial population of desktop users a ...
,
BSDI Berkeley Software Design, Inc. (BSDI or, later, BSDi), was a corporation which developed, sold licenses for, and supported BSD/OS (originally known as BSD/386), a commercial and partially proprietary variant of the BSD Unix operating system for ...
,
FreeBSD FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD), which was based on Research Unix. The first version of FreeBSD was released in 1993. In 2005, FreeBSD was the most popular ...
, Intel, Linux,
NetBSD NetBSD is a free and open-source Unix operating system based on the Berkeley Software Distribution (BSD). It was the first open-source BSD descendant officially released after 386BSD was forked. It continues to be actively developed and is a ...
, SCO and SunSoft. The project progressed and in mid-1998, SCO began developing
lxrun In Unix computing, lxrun is a compatibility layer to allow Linux binaries to run on UnixWare, SCO OpenServer and Solaris without recompilation. It was created by Mike Davidson. It has been an open source software project since 1997, and is ava ...
, an open-source compatibility layer able to run Linux binaries on OpenServer, UnixWare, and
Solaris Solaris may refer to: Arts and entertainment Literature, television and film * ''Solaris'' (novel), a 1961 science fiction novel by Stanisław Lem ** ''Solaris'' (1968 film), directed by Boris Nirenburg ** ''Solaris'' (1972 film), directed by ...
. SCO announced official support of lxrun at LinuxWorld in March 1999.
Sun Microsystems Sun Microsystems, Inc. (Sun for short) was an American technology company that sold computers, computer components, software, and information technology services and created the Java programming language, the Solaris operating system, ZFS, the ...
began officially supporting lxrun for Solaris in early 1999, and later moved to integrated support of the Linux binary format via Solaris Containers for Linux Applications. With the BSDs having long supported Linux binaries (through a compatibility layer) and the main x86 Unix vendors having added support for the format, the project decided that Linux ELF was the format chosen by the industry and "declare itself dissolved" on July 25, 1999.


FatELF: universal binaries for Linux

FatELF is an ELF binary-format extension that adds fat binary capabilities. It is aimed for Linux and other Unix-like operating systems. Additionally to the CPU architecture abstraction ( byte order, word size,
CPU A central processing unit (CPU), also called a central processor, main processor or just processor, is the electronic circuitry that executes instructions comprising a computer program. The CPU performs basic arithmetic, logic, controlling, and ...
instruction set In computer science, an instruction set architecture (ISA), also called computer architecture, is an abstract model of a computer. A device that executes instructions described by that ISA, such as a central processing unit (CPU), is called an ' ...
etc.), there is the potential advantage of software-platform abstraction e.g., binaries which support multiple kernel ABI versions. , FatELF has not been integrated into the mainline Linux kernel.


See also

* Application binary interface * Comparison of executable file formats * DWARF a format for debugging data *
Intel Binary Compatibility Standard The Intel Binary Compatibility Standard (iBCS) is a standardized application binary interface (ABI) for Unix operating systems on Intel-386-compatible computers, published by AT&T, Intel and SCO in 1988, and updated in 1990. It extends source-leve ...
* Portable Executable format used by Windows * vDSO virtual DSO * Position-independent code


References


Further reading

* Code

ftp://ftp.iecc.com/pub/linker/] Errata
https://archive.today/20200114224817/https://linker.iecc.com/ 2020-01-14 -->
* *
An unsung hero: The hardworking ELF
' by Peter Seebach, December 20, 2005, archived from the original on February 24, 2007 * *
The ELF Object File Format: Introduction
',
The ELF Object File Format by Dissection
' by Eric Youngdale (1995-05-01) *

' by Brian Raiter

by Julien Vanegue (2003-08-13)

by the ELFsh team (2005-08-01) *

' by Pat Beirne (1999-08-03)


External links



(archived version)
FreeBSD manual page





Oracle Solaris Linker and Libraries Guide

The ERESI project : reverse engineering on ELF-based operating systems

Linux Today article on 86open
July 26, 1999

October 10, 1997, Bruce Perens
Declaration of Ulrich Drepper (PDF)
in The SCO Group vs IBM, September 19, 2006
86open and ELF discussion
on Groklaw, August 13, 2006 {{Executables Executable file formats