Relative Content

Tag Archive for gcccompilationcompiler-constructionriscv

How to compile to RISC-V?

I’m writing the final stage for my compiler to riscv; however, I have run into a minor issue of figuring out what the start point of the program is. Are we guaranteed that the PC starts execution with the first instruction under .text? Some example code I’ve seen makes this assumption, but when I compile gcc to assembly, either I only see main (MacOS) or I see _start (Linux) but it is not at the start of .text.