You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and .bss/.comm reserve space for uninitialized globals without storing bytes in the object file.
7
+
8
+
Special small-data sections (.sdata, .sbss, .sdata2, .sbss2) group frequently accessed or size‑limited globals to enable more
9
+
efficient addressing on some ABIs (for example, keeping them within a 16‑bit offset of a base register).
10
+
11
+
These sections let the linker combine object files, resolve symbol addresses, and produce an executable image with
12
+
correct memory layout and access permissions, which the loader then maps into memory at runtime.
13
+
14
+
What follows is a dedicated description of each type of program segment we will encounter in a program
15
+
compiled to target the PowerPC EABI architecture.
16
+
17
+
=== .comm (Common)
18
+
Contains uninitialized global variables. These symbols are shared across object files during linking.
19
+
20
+
=== .bss (Block Started By Symbol)
21
+
Contains uninitialized static variables and global variables. Takes no space in the object file but reserves space in memory when loaded.
22
+
23
+
=== .ctors ("Constructors")
24
+
Contains "constructor" function pointers that are executed before main(). Used for global object initialization in C++.
25
+
Note that these functions are *not* class/struct constructors, but are simply functions called prior to the program entry point being called,
26
+
which is typically the first function that is called.
27
+
7
28
=== .data
8
-
=== .rodata
9
-
=== .sbss
10
-
=== .sbss2
11
-
=== .sdata
29
+
Contains initialized static and global variables that can be modified during program execution.
30
+
31
+
=== .rodata (Read-Only Data)
32
+
Contains constant values like string literals and const variables that shouldn't be modified during execution.
33
+
34
+
=== .sbss (Small BSS)
35
+
Contains uninitialized static/global variables that are 8 bytes or smaller.
36
+
37
+
=== .sbss2 (Small BSS 2)
38
+
Contains static/global variables of size 8 bytes or smaller which are initialized to zero.
39
+
40
+
=== .sdata (Small Data)
41
+
Contains initialized static/global variables of size 8 bytes or smaller. .sdata will contain values that are explicitly non-zero.
42
+
12
43
=== .sdata2
13
-
=== .text
44
+
Contains initialized static/global variables of size 8 bytes or smaller optimized for read-only access, although it can contain writablev values.
45
+
46
+
=== .text
47
+
Contains the actual executable code (machine instructions) of the program. This section is typically read-only to prevent code modification during execution.
0 commit comments