Page 1 of 1

ld ? under win2000

Posted: Sat Dec 07, 2002 7:36 am
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!!!

Re:ld ? under win2000

Posted: Sat Dec 07, 2002 10:13 am
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?

Re:ld ? under win2000

Posted: Sat Dec 07, 2002 10:48 am
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 :(

Re:ld ? under win2000

Posted: Sun Dec 08, 2002 5:19 am
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.

Re:ld ? under win2000

Posted: Sun Dec 08, 2002 8:18 am
by charisma
asm("jmp _initk") did the trick. :).
Its working now.
Thanx for ur replies Tim.