Does kernel(module) link agaist to libgcc.a?
clouds.yan at gmail.com
Sat Sep 3 10:58:28 EDT 2011
I was asked to use floating point in kernel module, and it results in
many undefined reference to functions begin with __aeabi. When I supply
libgcc.a, there remains only one undefined reference to 'raise'. After
consulting Google I found many people confront this problem when
building u-boot with gcc, it seems libgcc.a need user space C runtim
So I tried to fix it by supply this symbol,but insmod failed due to that
kernel cannot handle its relocation type. After change some code in
kernel it finally worked.
I thought it all caused by soft-float library in libgcc.a, but then I
noticed functions referencing to 'raise' is actually emitted for divide
operation. I wrote a test module involved only complex integer
divide(which cannot be optimized by gcc) and the 'raise' problem raised
So it seems we do not use libgcc.a when building kernel (module), does
that mean we can only use those simpy divide operations (which can be
traslated to other instructions by gcc without referencing to library
functions) in kernel(module)?
By the way, if I have to use soft-float library in kernel space anyway,
though sounds bad, it should work, right? Does anyone do that before?
More information about the linux-arm-toolchain