Data segments

Immediately above the text segment is the data segment, which is the place where the process holds the program's global and static variables (data).

Actually, it's not one mapping (segment); the data segment consists of three distinct mappings. In order from the low address, it consists of: the initialized data segment, the uninitialized data segment, and the heap segment.

We understand that, in a C program, uninitialized global and static variables are automatically initialized to zero. What about initialized globals? The initialized data segment is the region of address space where explicitly initialized global and static variables are stored.

The uninitialized data segment is the region of address space where, of course, ...

Get Hands-On System Programming with Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.