kernel module and float
Roland Smith
rsmith at xs4all.nl
Mon Mar 3 18:31:16 UTC 2008
On Mon, Mar 03, 2008 at 01:47:32PM +0100, Jean-Yves Moulin wrote:
> Hello,
>
> I have a problem with gcc on amd64 platform. I need to do division and
> multiplication with float into a kernel module. This module compile, load
> and run without problem on i386 platform. I can compile it on amd64 but
> when I try to load it I have:
>
> link_elf_obj: symbol __mulsf3 undefined
>
> After some search, I found that __mulsf3 (and __divsf3...etc) are builtin
> function of gcc. In my assembly source result, I have a "call __mulsf3" but
> the function is defined nowhere.
>
> I'm working on amd64 6.3-RELEASE binaries and source tree.
>
>
> Is that normal ? Do I need to use something special in order to use float
> into kernel ? How can I solve this ?
Floating point arithmetic isn't used in the kernel for performance
reasons.[1] The kernel is compiled with -msoft-float which prevents gcc
from generating floating point instructions. In this case it uses
routines that are part of libgcc. As far as I can tell, the kernel isn't
linked with libgcc.
Roland
[1] http://www.onlamp.com/pub/a/bsd/2008/02/26/whats-new-in-freebsd-70.html?page=3
--
R.F.Smith http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-amd64/attachments/20080303/8497f3de/attachment.pgp
More information about the freebsd-amd64
mailing list