* question about libc.a libgcc.a
@ 2001-07-27 18:55 Hai Xu
2001-07-27 19:12 ` Richard B. Johnson
2001-07-27 20:02 ` Russell King
0 siblings, 2 replies; 3+ messages in thread
From: Hai Xu @ 2001-07-27 18:55 UTC (permalink / raw)
To: linux-kernel
Dear all,
I am focus on a device driver. I compile it to a model.o and try to insmod
it to kernel. But when do so, I will get:
unresolved symbol: __udividi3
unresolved symbol: __umoddi3
As someone tell me, I have to link the libgcc.a to my model.o. I did it but
I when I try to insmod the model.o, I will get segamentation fault.
The following are my link libraries.
#LIBS =
$(MATLAB_ROOT)/rtw/c/lib/$(ARCH)/lrtwLib.a -L/usr/lib/gcc-lib/i386-redhat-li
nux/2.96 -lgcc -L/usr/lib -lm -lc $(EXT_LIB) $(S_FUNCTIONS_LIB)
$(INSTRUMENT_LIBS)
Please give me some ideas about it.
Thanks in advance
Hai Xu
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: question about libc.a libgcc.a
2001-07-27 18:55 question about libc.a libgcc.a Hai Xu
@ 2001-07-27 19:12 ` Richard B. Johnson
2001-07-27 20:02 ` Russell King
1 sibling, 0 replies; 3+ messages in thread
From: Richard B. Johnson @ 2001-07-27 19:12 UTC (permalink / raw)
To: Hai Xu; +Cc: linux-kernel
On Fri, 27 Jul 2001, Hai Xu wrote:
> Dear all,
>
> I am focus on a device driver. I compile it to a model.o and try to insmod
> it to kernel. But when do so, I will get:
>
> unresolved symbol: __udividi3
> unresolved symbol: __umoddi3
>
> As someone tell me, I have to link the libgcc.a to my model.o. I did it but
> I when I try to insmod the model.o, I will get segamentation fault.
>
[SNIPPED...]
You have some 64-bit divisions in your code. Make them shifts.
Everything in drivers will be powers-of-two (except some dumb
printk()s, where somebody tried to make decimals), so shifts
should work fine. If you have some offending decimal math, fix
it to display kbytes, megabytes, or gigabytes before you do
do integer decimal conversion. That way you never have to do
64-bit math.
Don't link in the 'C' runtime library.
Cheers,
Dick Johnson
Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).
I was going to compile a list of innovations that could be
attributed to Microsoft. Once I realized that Ctrl-Alt-Del
was handled in the BIOS, I found that there aren't any.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: question about libc.a libgcc.a
2001-07-27 18:55 question about libc.a libgcc.a Hai Xu
2001-07-27 19:12 ` Richard B. Johnson
@ 2001-07-27 20:02 ` Russell King
1 sibling, 0 replies; 3+ messages in thread
From: Russell King @ 2001-07-27 20:02 UTC (permalink / raw)
To: Hai Xu; +Cc: linux-kernel
On Fri, Jul 27, 2001 at 02:55:59PM -0400, Hai Xu wrote:
> The following are my link libraries.
> #LIBS =
> $(MATLAB_ROOT)/rtw/c/lib/$(ARCH)/lrtwLib.a -L/usr/lib/gcc-lib/i386-redhat-li
> nux/2.96 -lgcc -L/usr/lib -lm -lc $(EXT_LIB) $(S_FUNCTIONS_LIB)
> $(INSTRUMENT_LIBS)
Umm, if you're linking a kernel module, you can't:
1. link libm
2. link libc
3. use floating point in kernel
--
Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-07-27 20:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-07-27 18:55 question about libc.a libgcc.a Hai Xu
2001-07-27 19:12 ` Richard B. Johnson
2001-07-27 20:02 ` Russell King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox