Quiz Entry - updated: 2026.07.14
Where are symbols placed in ELF sections based on their type?
Functions go to .text; initialized globals to .data (or .bss if their value is zero); uninitialized globals to .bss (or legacy COMMON); externals stay undefined.
| Symbol Type | COMMON Section? | ELF Section | Condition |
|---|---|---|---|
| Functions | - | .text | Always |
| Initialized globals | No (default/-fno-common) | .data | value != 0 |
| Initialized globals | No | .bss | value == 0 |
| Uninitialized globals | Yes (-fcommon, GCC <10) | COMMON | Tentative definition |
| External | - | UNDEFINED | Defined elsewhere |
Local symbols:
- Appear only in relocatable object files
- Stripped from executable and shared object files
staticvariables go to .data or .bss based on initialization
COMMON section:
- Historical feature for uninitialized global variables
- Final linkage not known at compile time
- Disabled by default since GCC 10 (-fno-common)
Go deeper:
Weak symbol (Wikipedia) — why uninitialized globals behave as "weak"/COMMON, and what
-fno-commonchanges.