4.9.2.2 Clearing Objects
Those objects with static storage duration which are not assigned a value
must be cleared before the main()
function begins by the runtime startup
code, for example.
int output;
The runtime startup code will clear all the memory locations occupied by
uninitialized objects so they will contain zero before main()
is
executed.
The clearing of objects can be disabled using
-Wl,--no-data-init
; however, code that relies on objects containing
their initial value will fail.
Objects whose contents should be preserved over a Reset should be
qualified with __persistent
. Such objects are linked at a different area
of memory and are not altered by the runtime startup code.