Page 1 of 1

ld: cannot find entry symbol

Posted: Wed Mar 05, 2008 8:39 pm
by cmwslw
Hello everyone! I'm just getting started with OS dev. So far, I've had success with assembly only code (babysteps), but when I attempt a mixed language kernel (barebones C), I have problems. The compiling works fine, and generates good .o files, but when I try to link with

Code: Select all

ld -T linker.ld -o kernel.bin loader.o kernel.o
it outputs

Code: Select all

ld: warning: cannot find entry symbol _loader; defaulting to 00100000
Apparently ld can't access loader.o properly. I'm pretty sure what I typed into the command prompt is wrong, because Barebones didn't mention anything about the link command. Any suggestions?

I would be glad to update the tutorial once I get this figured out to prevent further confusion.

Thanks in advance! :wink:

Posted: Wed Mar 05, 2008 8:58 pm
by 01000101
the linker is looking for the entrypoint and isnt finding it in the C file. It shouldnt be an issue though overall. You will notice that if you included an assembly file with the label 'start' in the linker setup, it will go away.

Posted: Thu Mar 06, 2008 12:31 am
by Hangin10
I had that same issue. I looks really wierd. Replace "_loader" with "_main" in the link file ENTRY statement, and the error will go away and everything will still work fine. (as long as you link the loader.o first, I think)