Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
For some reason, even though I specify directly in my linking script where some sections should be, linker moves them around and ends up with inccorect layout that can't be linked together.
I need those sections for smp ap processors, and if I declare them nobits, they end up in -2GB kernel space, completely unusable and kernel won't even link anymore:
entry.s:(.mp_entry+0x1): relocation truncated to fit: R_X86_64_32 against `.ap_data,'
utils/collections/array.o \
entry.s:(.mp_entry+0x11): relocation truncated to fit: R_X86_64_32 against `.ap_data,'
-ffreestanding -mno-red-zone -nostdlib -lgcc -lc -z max-page-size=0x1000 -O0 -L../kclib/usr/lib
entry.s:(.mp_entry+0x25): relocation truncated to fit: R_X86_64_32 against `.ap_stack,'
entry_o.o: In function `cpu_boot_continue':
entry.s:(.mp_entry+0x39): relocation truncated to fit: R_X86_64_32 against `.ap_data,'
It's generally better to summarise your problem in the thread than to link to a summary elsewhere.
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.