Hi,
I just created my OS with support for loading ELF64 files to run. In Debian 64 i try to compile sample "hello world" programm writen in C. I have writen linker script like this:
Did a quick google search for the error and it brings up numerous posts for the osdev forum, people have solved the problem by compiling with "-mcmodel=size" depending on where you've relocated your kernel too, hope this helps.
-mcmodel=small
Generate code for the small code model: the program and its symbols must be linked in the lower 2 GB of the address space. Pointers are 64 bits. Programs can be statically or dynamically linked. This is the default code model.
-mcmodel=kernel
Generate code for the kernel code model. The kernel runs in the negative 2 GB of the address space. This model has to be used for Linux kernel code.
-mcmodel=medium
Generate code for the medium model: The program is linked in the lower 2 GB of the address space but symbols can be located anywhere in the address space. Programs can be statically or dynamically linked, but building of shared libraries are not supported with the medium model.
-mcmodel=large
Generate code for the large model: This model makes no assumptions about addresses and sizes of sections. Currently GCC does not implement this model.
"I think it may be time for some guru meditation"
"Barbarians don't do advanced wizardry"
-mcmodel=large
Generate code for the large model: This model makes no assumptions about addresses and sizes of sections. Currently GCC does not implement this model.
Those must be old news. GCC implements -mcmodel=large for quite some time.
If something looks overcomplicated, most likely it is.