wichtounet/thor-os

Linker problems

Closed this issue · 0 comments

I've got the kernel, boot-loader to compile, however, the accessory programs aren't linking right. I did some research, leading to problems with the .COMMON section being larger that 2G.o
Output of make | tail -n35:

true
cd bootloader; make stage1.bin
make[1]: Entering directory '/home/scott/thor-os/bootloader'
make[1]: 'stage1.bin' is up to date.
make[1]: Leaving directory '/home/scott/thor-os/bootloader'
cd bootloader; make stage2.bin
make[1]: Entering directory '/home/scott/thor-os/bootloader'
make[1]: 'stage2.bin' is up to date.
make[1]: Leaving directory '/home/scott/thor-os/bootloader'
cd init; make
make[1]: Entering directory '/home/scott/thor-os/init'
make[1]: Nothing to be done for 'default'.
make[1]: Leaving directory '/home/scott/thor-os/init'
cd kernel; make
make[1]: Entering directory '/home/scott/thor-os/kernel'
make[1]: Nothing to be done for 'default'.
make[1]: Leaving directory '/home/scott/thor-os/kernel'
cd tlib; make
make[1]: Entering directory '/home/scott/thor-os/tlib'
make[1]: Nothing to be done for 'default'.
make[1]: Leaving directory '/home/scott/thor-os/tlib'
cd programs/; make dist
make[1]: Entering directory '/home/scott/thor-os/programs'
true
cd ../tlib; make
make[2]: Entering directory '/home/scott/thor-os/tlib'
make[2]: Nothing to be done for 'default'.
make[2]: Leaving directory '/home/scott/thor-os/tlib'
echo -e "\x1b[31;01m[debug]\x1b[0m Build all programs"
[debug] Build all programs
cd shutdown; make; cd ..; cd dctor; make; cd ..; cd uptime; make; cd ..; cd ps; make; cd ..; cd writer; make; cd ..; cd touch; make; cd ..; cd rm; make; cd ..; cd ping; make; cd ..; cd df; make; cd ..; cd mkfs; make; cd ..; cd longtwo; make; cd ..; cd odin; make; cd ..; cd free; make; cd ..; cd long; make; cd ..; cd cpuid; make; cd ..; cd ls; make; cd ..; cd cat; make; cd ..; cd mkdir; make; cd ..; cd loop; make; cd ..; cd date; make; cd ..; cd lspci; make; cd ..; cd ifconfig; make; cd ..; cd reboot; make; cd ..; cd nslookup; make; cd ..; cd mount; make; cd ..; cd which; make; cd ..; cd args; make; cd ..; cd keyboard; make; cd ..; cd rand; make; cd ..; cd nc; make; cd ..; cd longone; make; cd ..; cd wget; make; cd ..; cd alpha; make; cd ..; cd stat; make; cd ..; cd bench; make; cd ..; cd tsh; make; cd ..; cd divzero; make; cd ..; cd lse820; make; cd ..; cd readelf; make; cd ..;
make[2]: Entering directory '/home/scott/thor-os/programs/shutdown'
[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[2]: *** [Makefile:12: debug/shutdown] Error 1
make[2]: Leaving directory '/home/scott/thor-os/programs/shutdown'
make[2]: Entering directory '/home/scott/thor-os/programs/dctor'
make[2]: *** [Makefile:11: debug/dctor] Broken pipe
make: *** [Makefile:21: programs] Error 141

Thanks.