The data segment has divided into two parts
1. Initialized data segment
2. Uninitialized data segment or BSS segment the BSS names after ancient assembler operator stands for "Block Started by Symbol".
The uninitialized global and static variables stored into the BSS segment which are initialized to 0 by the kernel. And initialized global and static variables are stored into the initialized data segment.
Ex.
#include<stdio.h>
int q;
int main()
{
printf("%d", q);
return 0;
}
compile:
gcc test.c
size ./a.out
it shows:
text data bss dec hex filename
999 252 12 1263 4ef ./a.out
Now declare one more uninitialized global variable
int p;
and now after compiling the above program, we run the same
size ./a.out
its shows
text data bss dec hex filename
999 252 16 1267 4f3 ./a.out
notice the difference between the bss partition got increased by 4 byte by adding one more uninitialized global variable.