What Is .elf
Content on WhatAnswers is provided "as is" for informational purposes. While we strive for accuracy, we make no guarantees. Content is AI-assisted and should not be used as professional advice.
Last updated: April 10, 2026
Key Facts
- ELF was introduced in 1989 as part of Unix System V Release 4 (SVR4) and became the standard executable format for all Unix-like systems including Linux
- ELF files support 60+ processor architectures including x86, x86-64, ARM, MIPS, PowerPC, RISC-V, and s390, making it highly portable across hardware platforms
- An ELF file structure consists of an ELF header (52-64 bytes), program headers, sections, and section headers, with the magic number 0x7F 'ELF' marking every valid file
- Modern Linux distributions exclusively use ELF as the native executable format, with billions of ELF binaries deployed across servers, desktops, embedded systems, and mobile devices
- ELF supports five primary file types: ET_NONE (unknown), ET_REL (object files), ET_EXEC (executable files), ET_DYN (shared objects and PIE executables), and ET_CORE (core dumps)
Overview
ELF (Executable and Linkable Format) is the standard binary file format for executable files, object code, shared libraries, and core dumps in Unix and Linux systems. Introduced in 1989 with Unix System V Release 4 (SVR4), ELF became the universal standard replacing earlier formats like a.out and COFF, establishing itself as the foundational format for compiled programs across all modern Unix-like operating systems.
Every Linux executable, shared library (.so), and kernel module uses the ELF format internally. When you run a program on Linux, the operating system kernel reads the ELF file's headers and structure to determine how to load it into memory, allocate resources, and execute it. The format's flexibility supports multiple processor architectures—from Intel x86 to ARM processors to mainframe s390 systems—making it one of the most successful binary formats in computing history with billions of deployed instances.
How It Works
An ELF file begins with a standardized header containing metadata about the binary:
- Magic Number: Every ELF file starts with the bytes 0x7F followed by the ASCII characters 'E', 'L', 'F' (0x7F454C46), allowing the operating system to instantly identify the file type and prevent execution of corrupted or invalid binaries.
- ELF Header Structure: The header contains the file class (32-bit or 64-bit), data encoding (little-endian or big-endian), ELF version, OS/ABI identification, file type (executable, shared object, object file, or core dump), machine type (processor architecture), entry point address, and offsets to program and section headers.
- Program Headers: These describe how the kernel should load the binary into memory, specifying segments, their memory addresses, sizes, permissions (read, write, execute), and alignment requirements for proper execution.
- Sections: The binary contains named sections like .text (executable code), .data (initialized data), .bss (uninitialized data), .symtab (symbol table), and .strtab (string table), each serving specific purposes during linking and execution.
- Section Headers: These provide a table of all sections in the file, their types, sizes, offsets, and flags, essential for linking, debugging, and binary analysis tools to understand the file structure.
- Symbol Tables and Relocations: ELF includes symbol tables mapping function and variable names to their addresses, and relocation entries allowing the dynamic linker to resolve external references when loading shared libraries.
Key Comparisons
| File Format | Introduction Year | Architecture Support | Modern Usage |
|---|---|---|---|
| ELF | 1989 (SVR4) | 60+ architectures | Universal standard in Linux, BSD, Unix systems |
| a.out | 1970s (early Unix) | Limited (primarily x86) | Obsolete, replaced by ELF in 1989 |
| COFF | 1980s (System V) | Multiple architectures | Legacy format, replaced by ELF; used in Windows (modified) |
| Mach-O | 1985 (NeXTSTEP) | x86, ARM, PowerPC | Standard in macOS and iOS systems |
| PE/COFF | 1993 (Windows NT) | x86, x86-64, ARM | Standard in Windows executables (.exe, .dll) |
Why It Matters
- Universal Compatibility: ELF's support for 60+ processor architectures enables a single compiled binary format to be adopted across diverse hardware platforms, from supercomputers to ARM-based smartphones, significantly reducing software development complexity.
- Efficient Execution: The structured format allows operating systems to quickly parse file headers and load binaries efficiently, with memory-mapped file support and position-independent code enabling faster startup times and reduced memory overhead.
- Dynamic Linking and Libraries: ELF's design enables sophisticated dynamic linking mechanisms, allowing programs to load shared libraries (.so files) at runtime, reducing executable sizes and enabling system-wide library updates without recompiling all dependent programs.
- Debugging and Analysis: The comprehensive symbol tables, section information, and debugging data (DWARF format) embedded in ELF files enable powerful debugging tools like GDB, disassemblers, and static analysis tools to inspect and understand compiled programs.
- Security and Integrity: ELF supports code signing, permission flags, and address space layout randomization (ASLR), providing foundations for modern security features like control flow integrity and privilege separation.
The ELF format remains fundamental to Linux and Unix systems after 35+ years, proving essential for billions of software installations worldwide. From embedded Linux devices to cloud servers running data centers, every compiled program relies on ELF's robust design. Its continued evolution—supporting new architectures, security features, and optimization techniques—ensures ELF will remain the standard executable format for decades to come.
More What Is in Daily Life
Also in Daily Life
More "What Is" Questions
Trending on WhatAnswers
Browse by Topic
Browse by Question Type
Sources
Missing an answer?
Suggest a question and we'll generate an answer for it.