-
Notifications
You must be signed in to change notification settings - Fork 104
Data sections
Robin Avery edited this page Aug 12, 2025
·
4 revisions
| Name | Description | Symbol size |
const? |
Initialized? | Usage |
|---|---|---|---|---|---|
.text |
Code | Any | All code goes here | ||
.data |
General writable data | > 8 bytes | ❌ | ✔️ | String literals, mutable structs with an initial value |
.sdata |
Small data | ≤ 8 bytes | ❌ | ✔️ | Small (0-7 characters) string literals, global counter variables that are initialized |
.rodata |
Read-only data | > 8 bytes | ✔️ | ✔️ | Immutable structs, often happens with Vec3
|
.sdata2 |
Small read-only data | ≤ 8 bytes | ✔️ | ✔️ | Float literals, numeric constants |
.bss |
Block starting symbol | > 8 bytes | ❌ | ❌ | Structs and arrays that get their values at runtime (often from .dat files on disc) |
.sbss |
Small block starting symbol | ≤ 8 bytes | ❌ | ❌ | Uninitialized global counter variables, variable pointers |