a common standard file format for executable files, object codeshared libraries, and core dumps.

Types

ELF files can have different types, such as:

  • EXEC (Executable file)
  • DYN (Shared object file), for libraries
  • REL (Relocatable file), before being linked into an executable file
  • CORE (Core dump file)

Relocatable Object Files

SectionsDescriptions
.textmachine code of the compiled program
.rodataformat strings or jump tables for switch
.dataInitialized global and static C variables
.bssUninitialized global and static C variables, plus global or static variables initialized to 0, Do not occupy space
.symtabsymbol table about functions and global variables that are defined and referenced in the program
.rel.textcontains relocation information for the .text section
.rel.datarelocation information for the .data section
.debugdebugging symbol table
.linemapping between line numbers in the C and machine code instructions in .text
.strtabstring table for symbol tables in .symtab and .debug