An ELF (Executable and Linkable Format) executable is a file format primarily used on Linux and other Unix-based systems to represent executables, shared libraries, and object files. It replaces older formats such as a.out and COFF.
An ELF file consists of multiple sections and segments, organized into three main parts:
The ELF Header
The Section Table
.text → contains the program's executable code..data → contains initialized data (global variables)..bss → contains uninitialized data..rodata → contains read-only data (constants, string literals).The Program Header Table
.text for executable code, .data for program data)..o): An intermediate file before linking..so - Shared Object): A dynamic library that can be loaded by other programs.readelf, objdump, gdb, and strace.In summary, an ELF file is the Linux/Unix equivalent of a Windows .exe file, designed with a flexible and powerful structure for loading and executing programs.