/////
It spewed errors like this.
/tools/site/linux/riscv_toolchain/20170126/lib/gcc/riscv64-unknown-elf/6.1.0/../../../../riscv64-unknown-elf/lib/crt0.o: In function `.L0 ':
/export/tmp2/wroberts/build/riscv_tmp/riscv-tools/riscv-gnu-toolchain/build/src/newlib-gcc/libgloss/riscv/crt0.S:9: undefined reference to `_gp'
/export/tmp2/wroberts/build/riscv_tmp/riscv-tools/riscv-gnu-toolchain/build/src/newlib-gcc/libgloss/riscv/crt0.S:13: undefined reference to `_edata'
/export/tmp2/wroberts/build/riscv_tmp/riscv-tools/riscv-gnu-toolchain/build/src/newlib-gcc/libgloss/riscv/crt0.S:14: undefined reference to `_end'
collect2: error: ld returned 1 exit status
That was because my previous proc had "SECTIONS" tab in that.
Not knowing any better, I copied over sections from some link.ld file I found in risc-tests.
SECTIONS
{
/* text: test code section */
. = 0x80000000;
.text.init : { crt.o(.text) }
.tohost ALIGN(0x1000) : { *(.tohost) }
.text : { *(.text) }
/* data segment */
.data : { *(.data) }
.sdata : {
_gp = . + 0x800;
*(.srodata.cst16) *(.srodata.cst8) *(.srodata.cst4) *(.srodata.cst2) *(.srodata*)
*(.sdata .sdata.* .gnu.linkonce.s.*)
}
/* bss segment */
.sbss : {
*(.sbss .sbss.* .gnu.linkonce.sb.*)
*(.scommon)
}
.bss : { *(.bss) }
/* thread-local data segment */
.tdata :
{
_tls_data = .;
crt.o(.tdata.begin)
*(.tdata)
crt.o(.tdata.end)
}
.tbss :
{
*(.tbss)
crt.o(.tbss.end)
}
/* End of uninitalized data segement */
_end = .;
}
And then it returned
/tools/site/linux/riscv_toolchain/20170126/lib/gcc/riscv64-unknown-elf/6.1.0/../../../../riscv64-unknown-elf/bin/ld: cannot find crt.o
I am sorry I do not understand software very much to debug this quickly and hence I seek your help. Other PROCs usually come with all these infrastructures(linker files). Is there something which I can just adapt from?
Thanks in advance