Multifile/Linkers/Data sections Flashcards
ELF Data Sections
.text, .rodata, .data, .bss, .symtab, lreltext, .debug, .strtab
.text
Machine code
.rodata
String literals, switch/jump table
.data
initialized globals and static locals
.bss
uninitialized globals and static locals
.symtab
linker symbol table
.reltext
relocated code
.debug
complete symbol table
-fno-common
prevents weak name conflicts from compiling
.strtab
NULL-terminated strings of names of symbols in .symtab section
(Linker stage) Resolution
Check to make sure each symbol has one def only
(Linker stage) Relocation
Resolve symbol addresses for aggregated sections of of executable
Object Files (ROFs)
Produced by assembler, can be combined by linker
(Multifile coding) Include Guard
Prevents multiple inclusions
(ELF_Symbols) int name
byte offset in .strtab where name is found