Linking problem

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.
Post Reply
LongHorn

Linking problem

Post by LongHorn »

Linker ld puts the string at the beginning of the kernel and So the grub says not a mutiboot kernel. Tim's article says that -fwritable-strings as one way, it works perfectly for string's insidde main function and in case of strings in other functions the grub says an error. Also in that article it says that these errors won't occur if the main is called from an assembly routine but still it isn't working. I used Bkerndev article in osdever.net
i figured that it's something to do with compiling and linking. Any help
xenos

Re:Linking problem

Post by xenos »

Do you use a linker script? If you do so, you can tell ld to put strings and other data at the end of your executable, so the multiboot signature will be placed at the beginning and grub can find it.
paulbarker

Re:Linking problem

Post by paulbarker »

Make sure the file containing the multiboot header is given as the first argument to ld, or write a linker map to move it to the beginning of the image. Could you post the code for the multiboot header and the linker command line and possibly script you are using?
Post Reply