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.
This instruction requires the R_X86_64_32S relocation. You need to either choose a position-independent way of getting that address or stop trying to make your kernel position-independent.
Why are you trying to make your kernel position-independent?
This instruction requires the R_X86_64_32S relocation. You need to either choose a position-independent way of getting that address or stop trying to make your kernel position-independent.
Why are you trying to make your kernel position-independent?
stivale.c:16:(.text+0x1): relocation truncated to fit: R_X86_64_32 against `.rodata'
string.c:16:(.text+0x269): relocation truncated to fit: R_X86_64_32 against `.rodata.str1.1'
stivale2.c:72:(.text+0x179): relocation truncated to fit: R_X86_64_32 against `.rodata.str1.1'
and many, many more errors
I don't know why is doing this, I mean, nothing here it's wrong
void (*term_write)(const char *string, size_t length) = (void *)term_str_tag->term_write;
term_write("Unable to get memory map!", 25); <----- line 72 in stivale2.c
You must put that into a separate function rather than inline assembler, because you need to get at the return address. There is no need to load CS before the other segments, so you can do it last, and as code address you can just use the return address.