Post

ELF Files

Section Name Description Example in C Code
.text Contains the executable instructions of the program. It includes the main entry point and other functions or code segments. void main() { ... }
.data Holds initialized global and static variables. This section is typically read-write, allowing modifications to the data during program execution. int global_var = 10;
static int global_var = 10;    
.bss Stands for “Block Started by Symbol.” It stores uninitialized global and static variables. The section doesn’t consume space in the file but gets allocated in memory during program execution. static int uninitialized_var;
int uninitialized_var;    
.rodata Read-only data section, which contains constants and other read-only data such as string literals. This section is typically mapped as read-only in memory. const char* const_message = "Hello, World!";
.got Global Offset Table (GOT) contains entries for resolving global symbols and function calls. It is used during dynamic linking to determine the memory addresses of symbols or functions. N/A (Does not have a direct representation in C code)
.plt Procedure Linkage Table (PLT) holds a series of stubs or trampolines for function calls. These stubs help in resolving symbols during dynamic linking by jumping to the appropriate entry in the GOT. N/A (Does not have a direct representation in C code)
.rel.text Relocation entries specific to the .text section, containing information on addresses that need to be updated when the code is loaded at a different base address. N/A (Does not have a direct representation in C code)
.rel.data Relocation entries specific to the .data section, containing information on addresses that need to be updated when the data section is loaded at a different base address. N/A (Does not have a direct representation in C code)
.debug Contains debugging information, such as symbol tables, line numbers, and debugging symbols, used by debuggers and other development tools. N/A (Does not have a direct representation in C code)
.dynamic Stores dynamic linking information, including shared libraries dependencies, symbol tables, and relocation entries. It is used by the dynamic linker/loader at runtime. N/A (Does not have a direct representation in C code)
.symtab Symbol table containing information about various symbols defined or referenced in the program, such as function and variable names, their memory addresses, and other attributes. N/A (Does not have a direct representation in C code)
.strtab String table that holds the null-terminated strings referenced by entries in the symbol table. Each entry in the symbol table refers to an offset within this section. N/A (Does not have a direct representation in C code)
.shstrtab Section header string table, which contains names of all the sections in the ELF file. It allows easy lookup and identification of sections by their names. N/A (Does not have a direct representation in C code)
.note Contains optional notes or auxiliary information, such as file version details or build-specific information. N/A (Does not have a direct representation in C code)
.comment Optional section that may store additional comments or annotations related to the program or object file. N/A (Does not have a direct representation in C code)
.interp Specifies the program interpreter, which is responsible for loading and executing the program. N/A (Does not have a direct representation in C code)
.dynstr String table holding null-terminated strings used by the dynamic linker/loader, such as library names or function names required for dynamic linking. N/A (Does not have a direct representation in C code)
.dynsym Symbol table containing dynamic symbol entries that are used for dynamic linking. It holds information about symbols defined in shared libraries used by the program. N/A (Does not have a direct representation in C code)
.dynstrtab String table used by the dynamic linker/loader, similar to .dynstr, but for symbol table entries. N/A (Does not have a direct representation in C code)
.rela.text Relocation entries with addend for the .text section, used in systems that require explicit addends for relocations. N/A (Does not have a direct representation in C code)
.rela.data Relocation entries with addend for the .data section, used in systems that require explicit addends for relocations. N/A (Does not have a direct representation in C code)

undefined

This post is licensed under CC BY 4.0 by the author.