I attached an example of Arduino Zero varients [1] (it is directly from Atmel's SDK.) It is quite straightforward to see what happends before main(). In embedded system, you can even change it easily if you want.
In this example, the stack pointer is updated at very first point after powering up the device [2]. And the undersocre-prefixed variables are defined in its linker script. [3]
I attached an example of Arduino Zero varients [1] (it is directly from Atmel's SDK.) It is quite straightforward to see what happends before main(). In embedded system, you can even change it easily if you want.
In this example, the stack pointer is updated at very first point after powering up the device [2]. And the undersocre-prefixed variables are defined in its linker script. [3]
[1]: https://github.com/arduino/ArduinoCore-samd/blob/master/boot...
[2]: https://github.com/arduino/ArduinoCore-samd/blob/master/boot...
[3]: https://github.com/arduino/ArduinoCore-samd/blob/master/boot...