Most likely these variables are declared at file scope, giving them static storage duration.
All variables with static storage duration are, for optimization purposes, sorted in two categories by the compiler/linker: initialized to 0 or initialized to something else. Variables initialized to zero are placed in a memory segment usually referred to as .bss
, while those who are initialized to another value are placed in .data
.
The reason for this is that .bss
variables can be initialized much faster if the are allocated in adjacent memory. Basically they would be initialized with a single memset
. Also, it will reduce the amount of ROM needed. Releated question with details.
EDIT
The reason .bss variables end up under uninitialized is likely because there is a rule in the C language (C11 6.7.9/10) stating that all static storage duration variables that aren't initialized explicitly by the programmer (they are "uninitialized"), shall be initialized to zero