Executable and Linkable Format

Uses your system voice; voice and rate in settings.

Snapshot

≈ 6 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

In computing, the Executable and Linkable Format (ELF, formerly named Extensible Linking Format) is a common standard file format for executable files, object code, shared libraries, device drivers, 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 (SVR4), 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 on x86 processors by the 86open 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 CPU or instruction set architecture. This has allowed it to be adopted by many different operating systems on many different hardware platforms.

In computing, the Executable and Linkable Format (ELF, formerly named Extensible Linking Format) is a common standard file format for executable files, object code, shared libraries, device drivers, 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 (SVR4), 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 on x86 processors by the 86open 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 CPU or instruction set architecture. This has allowed it to be adopted by many different operating systems on many different hardware platforms. | colspan="2" | || colspan="2" | 1 || |Further specifies the ABI version. Its interpretation depends on the target ABI. Linux kernel (after at least 2.6) has no definition of it, so it is ignored for statically linked executables. In that case, offset and size of EI_PAD are 8 . glibc 2.12+ in case treats this field as ABI version of the dynamic linker: it defines a list of dynamic linker's features, treats as a feature level requested by the shared object (executable or dynamic library) and refuses to load it if an unknown feature is requested, i.e. is greater than the largest known feature. |- | colspan="2" | || colspan="2" | 7 || |Reserved padding bytes. Currently unused. Should be filled with zeros and ignored when read. |- | colspan="2" | || colspan="2" | 2 || | Identifies object file type. |- | colspan="2" | || colspan="2" | 2 || |Specifies target instruction set architecture. Some examples are: |- | colspan="2" | || colspan="2" | 4 || |Set to 1 for the original version of ELF. |- | colspan="2" | || 4 || 8 || |This is the memory address of the entry point from where the process starts executing. This field is either 32 or 64 bits long, depending on the format defined earlier (byte 0x04). If the file doesn't have an associated entry point, then this holds zero. |- | || || 4 || 8 || |Points to the start of the program header table. It usually follows the file header immediately following this one, making the offset 0x34 or 0x40 for 32- and 64-bit ELF executables, respectively. |- | || || 4 || 8 || |Points to the start of the section header table. |- | || || colspan="2" | 4 || |Interpretation of this field depends on the target architecture. |- | || || colspan="2" | 2 || |Contains the size of this header, normally 64 Bytes for 64-bit and 52 Bytes for 32-bit format. |- | || || colspan="2" | 2 || |Contains the size of a program header table entry. As explained below, this will typically be 0x20 (32-bit) or 0x38 (64-bit). |- | || || colspan="2" | 2 || |Contains the number of entries in the program header table. |- | || || colspan="2" | 2 || |Contains the size of a section header table entry. As explained below, this will typically be 0x28 (32-bit) or 0x40 (64-bit). |- | || || colspan="2" | 2 || |Contains the number of entries in the section header table. |- | || || colspan="2" | 2 || |Contains index of the section header table entry that contains the section names. |- | | | colspan="3" | |End of ELF Header (size). |} 00000000 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 |.ELF............| 00000010 02 00 3e 00 01 00 00 00 c5 48 40 00 00 00 00 00 |..>......H@.....| | colspan="3" | |End of Program Header (size). |} | colspan="2" |0x08 |4 |8 | |Identifies the attributes of the section. |- | | |4 |8 | |Virtual address of the section in memory, for sections that are loaded. |- | | |4 |8 | |Offset of the section in the file image. |- | | |4 |8 | |Size in bytes of the section. May be 0. |- | | | colspan="2" |4 | |Contains the section index of an associated section. This field is used for several purposes, depending on the type of section. |- | | | colspan="2" |4 | |Contains extra information about the section. This field is used for several purposes, depending on the type of section. |- | | |4 |8 | |Contains the required alignment of the section. This field must be a power of two. |- | | |4 |8 | |Contains the size, in bytes, of each entry, for sections that contain fixed-size entries. Otherwise, this field contains zero. |- | | | colspan="3" | |End of Section Header (size). |} ELF relocation into non-relocatable objects by Julien Vanegue (2003-08-13) Embedded ELF debugging without ptrace by the ELFsh team (2005-08-01) Study of ELF loading and relocs by Pat Beirne (1999-08-03) FreeBSD manual page NetBSD ELF FAQ Linux 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 Announcement of 86open on Debian Announce mailing list October 10, 1997, Bruce Perens in The SCO Group vs IBM, September 19, 2006 on Groklaw, August 13, 2006

Text derived from https://en.wikipedia.org/w/index.php?oldid=1378065486 under CC BY-SA 4.0; modifications have been made.

Sources cited in this revision

31 named source(s) extracted from the cited revision. A source with no author is shown by its publication; nothing is invented.