Costs Nothing On Disk

int g_init = 7;
int g_zero = 0;
static int s_uninit;
char big[4 * 1024 * 1024];

int main(void) {
    static int counter = 0;
    int local = 3;
    int *p = malloc(sizeof(int));
    return local + *p;
}

The compiled executable on disk is about 20 KB. Which of these objects live in the BSS, the region between edata and end?

A

s_uninit, big, and local: the BSS holds everything the compiler was not given a value for.

B

g_zero, s_uninit, counter, and big

C

s_uninit and big only: writing = 0 explicitly forces a slot in the initialized data segment.

D

g_init, g_zero, s_uninit, counter, and big: every object with static storage duration is in the BSS.