$linuxjunkies
>

ELF section

also: ELF segment, binary section

A discrete portion of an ELF binary file that contains specific types of data, such as executable code, symbol tables, or debugging information. Each section has metadata describing its purpose, size, and location in the file.

An ELF (Executable and Linkable Format) section is a named, contiguous block of data within an ELF file—whether a compiled program, shared library, or object file. Common sections include .text (executable machine code), .data (initialized global variables), .bss (uninitialized data), .symtab (symbol table), and .strtab (string table).

Sections are organized by a section header table that appears near the end of an ELF file, listing each section's name, type, flags, virtual address, file offset, and size. The linker uses sections to combine object files into executables or libraries, and debuggers read special sections like .debug_info to provide source-level debugging.

You can inspect sections in a binary using readelf -S or objdump -h. For example, readelf -S /bin/ls displays all sections in the ls command, revealing the layout of code, data, and metadata.

Related terms