wichtounet/thor-os

LD returned 1 exit status

CodeLongAndProsper90 opened this issue · 0 comments

I've run make qemu, and it builds the kernel, but not the programs.

collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:12: debug/readelf] Error 1
make[1]: Leaving directory '/home/scott/thor-os/programs/readelf'
cp: cannot stat 'shutdown/debug/shutdown': No such file or directory
cp: cannot stat 'dctor/debug/dctor': No such file or directory
cp: cannot stat 'uptime/debug/uptime': No such file or directory
cp: cannot stat 'ps/debug/ps': No such file or directory
cp: cannot stat 'writer/debug/writer': No such file or directory
====== Output truncated ===============
make: *** [Makefile:20: dist] Error 1

I have cded into programs/shutdown, and ran make, and got this output

[debug] Link (program) debug/shutdown
/home/scott/opt/cross/lib/gcc/x86_64-elf/9.2.0/crtbegin.o: in function `deregister_tm_clones':
crtstuff.c:(.text+0x1): relocation truncated to fit: R_X86_64_32 against symbol `__TMC_END__' defined in .dtors section in debug/shutdown
crtstuff.c:(.text+0x7): relocation truncated to fit: R_X86_64_32S against `.tm_clone_table'
crtstuff.c:(.text+0x18): relocation truncated to fit: R_X86_64_32 against `.tm_clone_table'
/home/scott/opt/cross/lib/gcc/x86_64-elf/9.2.0/crtbegin.o: in function `register_tm_clones':
crtstuff.c:(.text+0x31): relocation truncated to fit: R_X86_64_32 against symbol `__TMC_END__' defined in .dtors section in debug/shutdown
crtstuff.c:(.text+0x38): relocation truncated to fit: R_X86_64_32S against `.tm_clone_table'
crtstuff.c:(.text+0x5a): relocation truncated to fit: R_X86_64_32 against `.tm_clone_table'
/home/scott/opt/cross/lib/gcc/x86_64-elf/9.2.0/crtbegin.o: in function `__do_global_dtors_aux':
crtstuff.c:(.text+0x88): relocation truncated to fit: R_X86_64_32 against `.dtors'
crtstuff.c:(.text+0x8e): relocation truncated to fit: R_X86_64_32 against symbol `__DTOR_END__' defined in .dtors section in /home/scott/opt/cross/lib/gcc/x86_64-elf/9.2.0/crtend.o
crtstuff.c:(.text+0x95): relocation truncated to fit: R_X86_64_32S against `.dtors'
crtstuff.c:(.text+0xdb): relocation truncated to fit: R_X86_64_32 against `.eh_frame'
crtstuff.c:(.text+0xe0): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
make: *** [Makefile:12: debug/shutdown] Error 1

I am at a dead-end on how to solve this.
It seems to be unrelated to my local toolchain after googling the errors.

Thanks in advance.