I'm learning about memory layout in C, I used the size command on a file compiled using gcc from the following C code
#include <stdio.h>
int main(){
return 0;
}
Did the same but added an uninitialized int before the main function
int x;
int main ...
the output of the size command is the same
I understand that uninitialized variables goes to bss section in memory, so it's supposed to give me a different bss size with the second code ( 8 + 4 = 12 bytes ) so why the results are the same?
and what is initially stored in the data and bss sections ( their initial size is respectively 512 and 8 bytes) ?
