ld ? under win2000

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
charisma

ld ? under win2000

Post by charisma »

i am trying to convert my obj kernel file into raw format using ld. This file has an externel referece to a boot asm file in starting of the code(kernel.c) which is asm("jmp initk"). i use the below command to do it

ld -Ttext=0x1000 -o kernel kernel.o -e 0x0

This works fine under my linux box. But when it comes to my windoze box(i use djgpp). It returns the error
<error>
kernel.o(.text+0x1):kernel.c: undefined reference to `initk'
</error>
Is there any way in windows that i can avoid ld from checking external references like it does in linux??

Please help!!!
Tim

Re:ld ? under win2000

Post by Tim »

charisma wrote:Is there any way in windows that i can avoid ld from checking external references like it does in linux??
Maybe. But the obvious way to solve this would be to link in the file that contains initk, no?
charisma

Re:ld ? under win2000

Post by charisma »

i tried to do that also. i compiled the asm file using nasm and tried all the possible supported format, but i get the unrecognized file format error from ld :(
Tim

Re:ld ? under win2000

Post by Tim »

In that case, make sure that NASM is outputting the right file format (you probably want to use -f coff if you're using DJGPP). Then you can put both .o files on the ld command line and link.
charisma

Re:ld ? under win2000

Post by charisma »

asm("jmp _initk") did the trick. :).
Its working now.
Thanx for ur replies Tim.
Post Reply