riscv32-elf-gcc是现成提供的编译工具链,gdb attach之后没有symbols:
$ gdb riscv32-elf-gcc ~/a.c
…
Reading symbols from riscv32-elf-gcc…
(No debugging symbols found in riscv32-elf-gcc)
update了一下系统可以编译了,现在编译一个空.c文件已经没有段错误了:
$ ./riscv32-elf-gcc ~/a.c
/home/renxiuhu/opt/risc-v/nds32le-elf-mculib-v5f/bin/../lib/gcc/riscv32-elf/10.4.0/../../../../riscv32-elf/bin/ld: /home/renxiuhu/opt/risc-v/nds32le-elf-mculib-v5f/bin/../lib/gcc/riscv32-elf/10.4.0/../../../../riscv32-elf/lib/crt0.o: in function .L0 ': (.text+0x52): undefined reference to main'
collect2: error: ld returned 1 exit status