| ELF | |
|---|---|
| File extension: | none, .o, .so |
| Developed by: | Unix System Laboratories |
| Type of format: | Binary, executable, object, shared libraries, core dump |
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,[1] and later in the Tool Interface Standard,[2] 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. Unlike many other proprietary executable file formats, ELF is flexible and extensible, and it is not bound to any particular processor or architecture. This has allowed it to be adopted by many different operating systems on many different platforms. Today the ELF format has replaced older executable formats such as a.out and COFF in many Unix-like operating systems such as: Linux, Solaris, IRIX, FreeBSD, NetBSD, OpenBSD, DragonFly BSD, and HP-UX (except for 32-bit PA-RISC programs which continue to use SOM). ELF has also seen some adoption in non-Unix operating systems, such as the Itanium version of OpenVMS, and BeOS Revision 4 and later for x86 based computers (where it replaced the Portable Executable format, the PowerPC version stayed with Preferred Executable Format). The PlayStation Portable, PlayStation 2, PlayStation 3 and GP2X consoles also use ELF and the Nintendo DS and Nintendo Gamecube consoles use ELF variants as their executable file format. AmigaOS 4.0 and MorphOS also running on PowerPC machines, use ELF. On Amiga platform the ELF executable has replaced the previous EHF (Extended Hunk Format) which was used on Amiga equipped with PPC processor expansion cards.
Contents |
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
readelfis a Unix binary utility that displays information about one or more ELF files. A GPL implementation is provided by GNU Binutils.elfdumpis a Solaris command for viewing ELF information in an elf file.objdumpprovides a wide range of information about ELF files and other object formats.
Specifications
- Generic:
- Generic ELF Specification
- System V Application Binary Interface Edition 4.1 (1997-03-18)
- System V ABI Update (December 2003)
- ELF-64 Object File Format Version 1.5 Draft 2 (May 1998)
- AMD64:
- ARM[3]:
- IA32:
- IA64:
- M32R:
- ELF Specification for the M32R Architecture
- M32R ELF ABI Supplement Version 1.2 (2004-08-26)
- MIPS:
- Motorola 6800:
- PA-RISC:
- Processor-Specific ELF Supplement for PA-RISC
- 64-bit PA-RISC Run-time Architecture Version 3.3 (1997-10-06)
- PowerPC:
- ELF Specification for the PPC32 Architecture
- System V ABI, PPC Supplement
- PowerPC Embedded Application Binary Interface 32-Bit Implementation (1995-10-01)
- ELF Specification for the PPC64 Architecture
- 64-bit PowerPC ELF Application Binary Interface Supplement Version 1.9 (2004)
- SPARC:
- S/390:
- zSeries:
See also
References
- ^ System V Application Binary Interface Edition 4.1 (1997-03-18)
- ^ Tool Interface Standard (TIS) Executable and Linking Format (ELF) Specification Version 1.2 (May 1995)
- ^ Application Binary Interface (ABI) for the ARM Architecture
Further reading
- John R. Levine (October 1999). Linkers and Loaders. Morgan-Kauffman. ISBN 1-55860-496-0.
- Ulrich Drepper (2006-08-20). "How To Write Shared Libraries". 4.0. Retrieved on 2007-06-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
- ELF relocation into non-relocatable objects by Julien Vanegue (2003-08-13)
- Embedded ELF debugging without ptrace by the ELFsh team (2005-08-01)
External links
- Elf library routines
- free ELF object file access library
- ELFIO: a C++ library for reading and generating files in the ELF binary format.
- FreeBSD Handbook — Binary formats
- Description of the ELF binary format
- elf(5) manual page
- NetBSD ELF FAQ
- Sun's Linker and Libraries Guide
- The ERESI project : reverse engineering on ELF-based operating systems


