I'm currently trying to use the GCC toolchain for RISC-V but i'm running into a few problems.
It looks like the stack pointer doesn't get initialized properly. I know i should initialize it myself, but i can't figure out where. I'm using the default linker script altered with the correct memory addresses and in this script a constant _gp gets set. This constant is used in the default startup code to initialize the gp register.
Unfortunately this doesn't set the sp register. How can i set up the stack pointer without using my own start up code?