I saw this in some website and was surprised with the result:
#include <stdio.h>
int main(void)
{
return 0;
}
When the above code is checked for memory in each sections using size
$ gcc memory-layout.c -o memory-layout
$ size memory-layout
text data bss dec hex filename
960 248 8 1216 4c0 memory-layout
Here,
without any global or static variables, the size of bss
is shown 8
. I didn't get for what this 8 bytes are used?