Closed mrquincle closed 2 years ago
Ah, it is easy to explain, we define _start
ourselves and don't use the (nano) newlib functions because of microapp size optimization.
You can see this in config.mk
. To include the nano newlib functions like malloc
, memset
, and _start
, you would write
--specs=nano.specs -Wl,-lc_nano
This wasn't the case. Only --specs=nano.specs
was written which doesn't include _start
on itself. Now, config.mk
contains --specs=nosys.specs -Wl,-lnosys
to better reflect the situation.
Implements
__libc_init_array
. Later on we might try to find out why this isn't done. For now this calls all constructors manually in main.c before main() is called.This fixes issues with globally defined constructors.