If you are using a 64-bit target that puts DRAM at 0x80000000, then you need a toolchain that uses the medany code model. If you aren't using any precompiled libraries, then -mcmodel=medany will work. But if you need libgcc, libc, etc also compiled using medany code model, then you need to configure a toolchain that uses medany by default. I do see C library errors, so it looks like you do need a medany toolchain. You can do this with riscv-gnu-toolchain by using --with-cmodel=medany when configuring the toolchain before building it.
There is an old blog post by Palmer Dabbelt that talks about code models
You might be interested in other parts of this same blog series. Part 2 talks about the relocation truncated to fit linker error.
Jim