[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Kernel module complying and unresolved symbol(s)



Hi all,

I am trying to test the RTAI Linux kernel extensions. I managed to get
the kernel and modules build (I owe a great thank you to Martin
Andersson for his 2.4.26 patch) and run the built kernel on the board.
All modules load and RTAI is "mounted". But when I try to load the user
(kernel) module I get:

/var/testsuite/kern/latency # insmod latency_rt.o
Using latency_rt.o
insmod: unresolved symbol __fixunsdfsi
insmod: unresolved symbol __Mul
insmod: unresolved symbol __muldi3

This particular module was build as show in buildlog-1.txt

I found that all three symbols are part of libgcc.a and that module was
complied with cris-axis-elf-gcc.

Next I changed the compiler from cris-gcc to cris-axis-linux-gnu-gcc.
The result was that I got:
 
cris-ld: liblatency_rt.a(liblatency_rt_a-latency-module.o): uses non-prefixed symbols, but writing file with _-prefixed symbols
Bad value: failed to merge target specific data of file liblatency_rt.a(liblatency_rt_a-latency-module.o)

at link time. So I added -Wa,--underscore to the flags and the module 
built. (see buildlog-2.txt)

But when I tried to insmod the module it reported:

/var/ttt/modules # insmod latency_rt.o
Using latency_rt.o
insmod: unresolved symbol __fixunsdfsi

I found with google that this function converts double to unsigned int.

So my questions are:
--------------------

-Am I complying the kernel module with wrong switches or the switches are OK, but
I need to add (rip from libgcc) __fixunsdfsi function to the lib section of arch/cris?
(And when I am at it, I can all so add __Mul and __muldi3[all most all other arch have 
this one]) (As I understand this problem I need to add the missing FP instructions/functions)

-Do I understand correctly that the difference between non-prefixed and prefixed symbols
is that non-prefixed symbols are static and prefixed are dynamic - they are going to be
assigned at load time? 

-If so then the kernel module should be compiled with prefixed symbols, right?

-Also when complying kernel module I should never use -mlinux, correct?

-When I do file <kernel-module.o> i get:
rtai_hal.o: ELF 32-bit LSB relocatable, version 1 (SYSV), not stripped
but when I do the same on user-module.o i get:
latency_rt.o: ELF 32-bit LSB relocatable, version 1 MathCoPro/FPU/MAU Required (SYSV), not stripped
Can someone explain this please?

Thank you.

		Regards Simon

if cris-gcc -DHAVE_CONFIG_H -I. -I/stuff1/delo/playground/RealTime/rtai-3.1-test5/rtai-testsuite/kern/latency -I../../..  -D__KERNEL__ -I/stuff1/delo/playground/RealTime/linux-2.4.26/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fno-leading-underscore -fomit-frame-pointer -pipe -DMODULE -DEXPORT_SYMTAB -Wall -D__IN_RTAI__ -D__linux__ -I/stuff1/delo/playground/RealTime/rtai-3.1-test5/rtai-core/include -I../../../rtai-core/include    -MT liblatency_rt_a-latency-module.o -MD -MP -MF ".deps/liblatency_rt_a-latency-module.Tpo" \
  -c -o liblatency_rt_a-latency-module.o `test -f 'latency-module.c' || echo '/stuff1/delo/playground/RealTime/rtai-3.1-test5/rtai-testsuite/kern/latency/'`latency-module.c; \
then mv -f ".deps/liblatency_rt_a-latency-module.Tpo" ".deps/liblatency_rt_a-latency-module.Po"; \
else rm -f ".deps/liblatency_rt_a-latency-module.Tpo"; exit 1; \
fi
rm -f liblatency_rt.a
cris-ar cru liblatency_rt.a liblatency_rt_a-latency-module.o
cris-ranlib liblatency_rt.a
cris-ld --whole-archive liblatency_rt.a -r -o latency_rt.o

tuff1/delo/playground/RealTime/rtai-test5/rtai-testsuite/kern/latency'
if cris-axis-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/stuff1/delo/playground/RealTime/rtai-3.1-test5/rtai-testsuite/kern/latency -I../../..  -D__KERNEL__ -I/stuff1/delo/playground/RealTime/linux-2.4.26/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -Wa,--underscore -DMODULE -DEXPORT_SYMTAB -D__IN_RTAI__ -D__linux__ -I/stuff1/delo/playground/RealTime/rtai-3.1-test5/rtai-core/include -I../../../rtai-core/include    -MT liblatency_rt_a-latency-module.o -MD -MP -MF ".deps/liblatency_rt_a-latency-module.Tpo" \
  -c -o liblatency_rt_a-latency-module.o `test -f 'latency-module.c' || echo '/stuff1/delo/playground/RealTime/rtai-3.1-test5/rtai-testsuite/kern/latency/'`latency-module.c; \
then mv -f ".deps/liblatency_rt_a-latency-module.Tpo" ".deps/liblatency_rt_a-latency-module.Po"; \
else rm -f ".deps/liblatency_rt_a-latency-module.Tpo"; exit 1; \
fi
rm -f liblatency_rt.a
cris-ar cru liblatency_rt.a liblatency_rt_a-latency-module.o
cris-ranlib liblatency_rt.a
cris-ld --whole-archive liblatency_rt.a -r -o latency_rt.o