ELF – Executable and Linkable Format
FreeStandard file format for executables, object code, and shared libraries
About ELF – Executable and Linkable Format
ELF (Executable and Linkable Format) is a common standard file format for executable files, relocatable code (object .o files), shared libraries, and core dumps. It is part of the ABI (Application Binary Interface) specification. By design, ELF is flexible, extensible, cross-platform, and CPU architecture ISA independent. The format supports loading at any memory address, with automatic symbol adjustment. It includes an ELF header (52 or 64 bytes for 32 or 64-bit), a program header table (for executable view) describing memory segments, and a section header table (for linking view) describing sections. Sections hold data like instructions, symbols, and relocation info; segments are mapped into memory. Tools like readelf, objdump, nm, file, elfdump, and elfutils can inspect and manipulate ELF files. The format is widely used in Unix-like systems, including Linux and BSD.
Key Features
Pros & Cons
- Cross-platform and CPU independent, making it a universal binary format
- Flexible and extensible design accommodating various use cases
- Well-documented standard with official ABI specifications
- Supports both executable and linking views for efficient processing
- Widely adopted with many robust analysis and manipulation tools
- Complex structure requiring understanding of headers, sections, and segments
- No fixed ordering of sections/segments (only ELF header at fixed position)
- Relies on external dynamic linkers and resolving dependencies at runtime