I realize this question may get asked a lot in this forum but I haven't
been able to find a post that I understand enough to help me with my
problem.

I have a module 'tt_mod.o' that compiles fine but when I insmod it into
the kernel it, I get unresolved symbols:

tt_mod.o: unresolved symbol __udivdi3
tt_mod.o: unresolved symbol __umoddi3

My makefile for making the module looks like:
---------------------
...
KLIBS = -L/usr/lib -lm -lc
LIBGCC = -L$(shell $(CC) -print-libgcc-file-name)

tt_mod.o: tt_mod_temp.o hd_fusion.o ie_io_fusion.o
        $(LD) -r -static tt_mod_temp.o hd_fusion.o ie_io_fusion.o -o tt_mod.o 
$(LIBGCC) $(KLIBS)
        chmod ugo+r tt_mod.o

tt_mod_temp.o: tt_mod.c tt_shared.h hd_fusion.o hd_fusion.h ie_io_fusion.o 
ie_io_fusion.h
        $(CC) $(KFLAGS) $(KINCLUDE) -c tt_mod.c -o tt_mod_temp.o
        chmod ugo+r tt_mod_temp.o

hd_fusion.o: hd_fusion.c hd_fusion.h ie_io_fusion.o ie_io_fusion.h utility_fusion.h 
hapdev_fusion.h
        $(CC) $(KFLAGS) $(INCLUDE) -c hd_fusion.c -o hd_fusion.o

ie_io_fusion.o: ie_io_fusion.c ie_io_fusion.h
        $(CC) $(KFLAGS) $(INCLUDE) -c ie_io_fusion.c -o ie_io_fusion.o
...
--------------------
I've found that the problem has something to do with hd_fusion.o. If I
remove it from the project, everything is fine.

>From reading former posts, I understand that these unresolved symbols are
often caused by using math functions that we're not supposed to use in the
kernel. hd_fusion.o only does a few cases of division and in each case,
it's with floats. Is that not allowed? I've tried to use the extra linking
flags when making hd_fusion.o and I get these comments (but it still makes
it):

gcc: -lm: linker input file unused since linking not done
gcc: -lc: linker input file unused since linking not done

Also, as a seperate problem, when I compile hd_fusion.c I get a warning
that an implicit declaration of function `kmalloc' exists. Are we allowed
to use malloc in the kernel? I'd rather because kmalloc is defined in
rlt_cpp.h and when I include that file, it redefines a whole bunch of
stuff (like NULL) and nothing is happy. What is rtl_cpp.h used for anyway?
It's name implies that it has something to do with C++ functions for rtl
but I'm writing everything in C.

Finally, where is the best documentation on the header files located in
the /include directory for rtlinux?

Thanks in advance,
Tim

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/

Reply via email to