HOME

TheInfoList



OR:

In
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes, and development of both hardware and software. Computing has scientific, ...
, 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 for executable files, object code,
shared libraries In computer science, a library is a collection of non-volatile resources used by computer programs, often for software development. These may include configuration data, documentation, help data, message templates, pre-written code and ...
, and core dumps. First published in the specification for the application binary interface (ABI) of the
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, ...
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, ...
(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 Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, ...
systems. In 1999, it was chosen as the standard binary file format for Unix and
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
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 and address sizes so it does not exclude any particular
central processing unit 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, a ...
(CPU) or instruction set architecture. This has allowed it to be adopted by many different
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
s 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 The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable uni ...
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 or
64-bit In computer architecture, 64-bit integers, memory addresses, or other data units are those that are 64 bits wide. Also, 64-bit CPUs and ALUs are those that are based on processor registers, address buses, or data buses of that size. A ...
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 ELF vs
64-bit In computer architecture, 64-bit integers, memory addresses, or other data units are those that are 64 bits wide. Also, 64-bit CPUs and ALUs are those that are based on processor registers, address buses, or data buses of that size. A ...
ELF, because the are in a different structure location for alignment reasons. Each entry is structured as:


Section header


Tools

*
readelf readelf is a program for displaying various information about object files on Unix-like systems such as objdump. It is part of the GNU binutils. readelf and objdump objdump has a similar function but with different features like disassembling. ...
is a Unix binary utility that displays information about one or more ELF files. A
free software Free software or libre software is computer software distributed under terms that allow users to run the software for any purpose as well as to study, change, and distribute it and any adapted versions. Free software is a matter of liberty, n ...
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. * objdump provides a wide range of information about ELF files and other object formats. objdump uses the
Binary File Descriptor library The Binary File Descriptor library (BFD) is the GNU Project's main mechanism for the portable manipulation of object files in a variety of formats. , it supports approximately 50 file formats for some 25 instruction set architectures. History ...
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 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 T ...
and
COFF The Common Object File Format (COFF) is a format for executable, object code, and shared library computer files used on Unix systems. It was introduced in Unix System V, replaced the previously used a.out format, and formed the basis for e ...
formats in
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
operating systems: *
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, whi ...
* Solaris / Illumos * IRIX * FreeBSD * NetBSD * OpenBSD *
Redox Redox (reduction–oxidation, , ) is a type of chemical reaction in which the oxidation states of substrate change. Oxidation is the loss of electrons or an increase in the oxidation state, while reduction is the gain of electrons or ...
*
DragonFly BSD DragonFly BSD is a free and open-source Unix-like operating system forked from FreeBSD 4.8. Matthew Dillon, an Amiga developer in the late 1980s and early 1990s and FreeBSD developer between 1994 and 2003, began working on 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 ...
* HP-UX (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, in its Itanium and amd64 versions * BeOS Revision 4 and later for x86 based computers (where it replaced the Portable Executable format; the PowerPC version stayed with Preferred Executable Format) *
Haiku is a type of short form poetry originally from Japan. Traditional Japanese haiku consist of three phrases that contain a '' kireji'', or "cutting word", 17 '' on'' (phonetic units similar to syllables) in a 5, 7, 5 pattern, and a '' kigo'', or ...
, an open source reimplementation of BeOS * RISC OS * Stratus VOS, in PA-RISC and x86 versions * SkyOS * Fuchsia OS *
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 processi ...
* 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 ...
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, PlayStation Vita,
PlayStation (console) The (abbreviated as PS, commonly known as the PS1/PS one or its codename PSX) is a home video game console developed and marketed by Sony Computer Entertainment. It was released in Japan on 3 December 1994, in North America on 9 September 1995 ...
, PlayStation 2,
PlayStation 3 The PlayStation 3 (PS3) is a home video game console developed by Sony Interactive Entertainment, Sony Computer Entertainment. The successor to the PlayStation 2, it is part of the PlayStation brand of consoles. It was first released on Novemb ...
, PlayStation 4, PlayStation 5 * GP2X * Dreamcast * GameCube * 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 regions of the world. It is Nintendo's fifth major home game console, ...
*
Wii U The Wii U ( ) is a home video game console developed by Nintendo as the successor to the Wii. Released in late 2012, it is the first eighth-generation video game console and competed with Microsoft's Xbox One and Sony's PlayStation 4. ...


PowerPC

Other (operating) systems running on PowerPC 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 Aros may refer to: *Aros (Middle-earth), a river in J. R. R. Tolkien's Middle-earth legendarium * Aros, Mull, the location of Aros Castle, a ruined 13th-century castle on the Isle of Mull, Scotland *AROS Research Operating System, a free software i ...
* Café OS (The operating system ran on Wii U)


Mobile phones

Some operating systems for mobile phones and mobile devices use ELF: * Symbian OS v9 uses E32Image format that is based on the ELF file format; * Sony Ericsson, for example, the W800i, W610, W300, etc. * Siemens, the SGOLD and SGOLD2 platforms: from Siemens C65 to S75 and BenQ-Siemens E71/ EL71; *
Motorola Motorola, Inc. () was an American multinational telecommunications company based in Schaumburg, Illinois, United States. After having lost $4.3 billion from 2007 to 2009, the company split into two independent public companies, 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 Nokia Corporation (natively Nokia Oyj, referred to as Nokia) is a Finnish multinational telecommunications, information technology, and consumer electronics corporation, established in 1865. Nokia's main headquarters are in Espoo, Finland, i ...
phones or tablets running the Maemo or the Meego OS, for example, the Nokia N900. * Android 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 Patch or Patches may refer to: Arts, entertainment and media * Patch Johnson, a fictional character from ''Days of Our Lives'' * Patch (''My Little Pony''), a toy * "Patches" (Dickey Lee song), 1962 * "Patches" (Chairmen of the Board song ...
that adds assembly code to the main firmware, which is a feature known as ''ELFPack'' in the underground modding culture. The ELF file format is also used with the Atmel AVR (8-bit), AVR32 and with Texas Instruments MSP430 microcontroller architectures. Some implementations of Open Firmware can also load ELF files, most notably
Apple An apple is an edible fruit produced by an apple tree (''Malus domestica''). Apple trees are cultivated worldwide and are the most widely grown species in the genus '' Malus''. The tree originated in Central Asia, where its wild ancest ...
's implementation used in almost all PowerPC 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 IA-32 (short for "Intel Architecture, 32-bit", commonly called i386) is the 32-bit version of the x86 instruction set architecture, designed by Intel and first implemented in the 80386 microprocessor in 1985. IA-32 is the first incarnatio ...
: **
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: **
System V ABI, PPC Supplement
' **
PowerPC Embedded Application Binary Interface
32-Bit Implementation'' (1995-10-01) **

' Version 1.9 (2004) *
RISC-V RISC-V (pronounced "risk-five" where five refers to the number of generations of RISC architecture that were developed at the University of California, Berkeley since 1981) is an open standard instruction set architecture (ISA) based on est ...
: **
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/9000 ...
: **
S/390 32bit ELF ABI Supplement
' * zSeries: **
zSeries 64bit ELF ABI Supplement
' * Symbian OS 9: **
E32Image file format on Symbian OS 9
' The
Linux Standard Base The Linux Standard Base (LSB) was a joint project by several Linux distributions under the organizational structure of the Linux Foundation to standardize the software system structure, including the Filesystem Hierarchy Standard used in the Li ...
(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 Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, ...
and
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
s 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 The Santa Cruz Operation, Inc. (usually known as SCO, pronounced either as individual letters or as a word) was an American software company, based in Santa Cruz, California, that was best known for selling three Unix operating system variants ...
offices on August 22, 1997. The steering committee was
Marc Ewing Marc Ewing is an American computer engineer and entrepreneur. He is the creator and originator of the Red Hat brand of software, most notably the Red Hat range of Linux operating system distributions. He was involved in the 86open project in t ...
, Dion Johnson, Evan Leibovitch, Bruce Perens, Andrew Roach,
Bryan Wayne Sparks Caldera was a US-based software company founded in 1994 to develop Linux- and DOS-based operating system products. Caldera Caldera, Inc. was a Canopy-funded software company founded in October 1994 and incorporated on 25 January 1995 by f ...
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 Jordan K. Hubbard (born April 8, 1963) is an open source software developer, authoring software such as the Ardent Window Manager and various other open source tools and libraries before co-founding the FreeBSD project with Nate Williams and Rodne ...
, 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,
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 P ...
, FreeBSD,
Intel Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California. It is the world's largest semiconductor chip manufacturer by revenue, and is one of the developers of the x86 ser ...
,
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, whi ...
, NetBSD, SCO and SunSoft. The project progressed and in mid-1998, SCO began developing lxrun, an open-source
compatibility layer In software engineering, a compatibility layer is an interface that allows binaries for a legacy or foreign system to run on a host system. This translates system calls for the foreign system into native system calls for the host system. With s ...
able to run Linux binaries on
OpenServer Xinuos OpenServer, previously SCO UNIX and SCO Open Desktop (SCO ODT), is a closed source computer operating system developed by Santa Cruz Operation (SCO), later acquired by SCO Group, and now owned by Xinuos. Early versions of OpenServer wer ...
, UnixWare, and Solaris. SCO announced official support of lxrun at
LinuxWorld LinuxWorld has various meanings: * LinuxWorld Conference and Expo - a series of Linux conferences worldwide that became OpenSource World in 2009 * LinuxWorld Magazine LinuxWorld has various meanings: * LinuxWorld Conference and Expo LinuxWorld ...
in March 1999. Sun Microsystems 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 In software engineering, a compatibility layer is an interface that allows binaries for a legacy or foreign system to run on a host system. This translates system calls for the foreign system into native system calls for the host system. With s ...
) 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 Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, whi ...
and other
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
operating systems. Additionally to the CPU architecture abstraction (
byte order 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 s ...
, 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, a ...
instruction set 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 This is a comparison of binary executable file formats which, once loaded by a suitable executable loader, can be directly executed by the CPU rather than being interpreted by software. In addition to the binary application code, the executables ma ...
*
DWARF Dwarf or dwarves may refer to: Common uses *Dwarf (folklore), a being from Germanic mythology and folklore * Dwarf, a person or animal with dwarfism Arts, entertainment, and media Fictional entities * Dwarf (''Dungeons & Dragons''), a humanoid ...
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-lev ...
* 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 The SCO Group (often referred to SCO and later called The TSG Group) was an American software company in existence from 2002 to 2012 that became known for owning Unix operating system assets that had belonged to the Santa Cruz Operation (the ...
vs IBM, September 19, 2006
86open and ELF discussion
on Groklaw, August 13, 2006 {{Executables Executable file formats