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.
Change your compile line to "-fno-leading-underscores" instead of "-fleading-underscores". All C functions will have been compiled with a leading underscore, so to access them properly from asm you would have had to add one there, too, e.g. "global _kmain; call _kmain". The easiest way is to change the flag.
Did anyone try: ld -T linker.ld -o kernel.bin kernel.o loader.o
rather than : ld -T linker.ld -o loader.o kernel.o
with this I get the same error
may be it will be useful for someone from Google