[uClinux-dev] floating point problem

JinSoo Kim people at micro-web.co.kr
Wed Mar 26 20:14:34 EST 2003


Hi,

Thanks very much for your help, Ramana.
I tried your second option, adding libgcc.a library.
But there was a problem when loading the module.
The error message is...

"Unhandled fault: external abort on linefetch (F4) at 0x00000001
fault-common.c(97): start_code=0xfc0040, start_stack=0xfbff88)
pid 82: failed 7"

The module was loaded but the module initialization failed.
I simplified my problem by making the simple code as possible as I can.
Here is the simple code and Makefile which make the error message when
loaded into the kernel.

Is the link option I used to add libgcc.a right in the Makefile?
How to resolve this problem? Any advice will be much helpful.
Thanks in advance...

================ hello_init.c =======================
#include <linux/kernel.h>
#include <linux/module.h>

int init_module(void) { printk("<1>Hello, world\n"); return 0; }

void float_init_test(void)
{
 float a[3] = { 1.0, 2.0, 3.0 };
 int b[3];
 
 b[0] = (int) a[0];
 printk("%d\n", (int) b[0]);
}
=================================================

================ hello_clean.c ========================
#include <linux/kernel.h>
#include <linux/module.h>

void cleanup_module(void) { printk("<1>Goodbye cruel world\n"); }
=================================================

================Makefile============================
ROOTDIR =/home/$(WHOAMI)/uClinux
KERNELDIR = $(ROOTDIR)/linux-2.4.x
include $(ROOTDIR)/.config
include $(KERNELDIR)/.config
include $(ROOTDIR)/config.arch

CFLAGS += -Wall -D__KERNEL__ -DMODULE -I$(KERNELDIR)/include

# Prepend modversions.h if we're running with versioning.
ifdef CONFIG_MODVERSIONS
 CFLAGS += -DMODVERSIONS -include $(KERNELDIR)/include/linux/modversions.h
endif

OBJS = hello.o

all: $(OBJS)
 cp $(OBJS) $(ROOTDIR)/romfs
 
hello.o: hello_init.o hello_clean.o
 $(LD) -r $^ -o $@ -L/usr/local/lib/gcc-lib/arm-elf/2.95.3 -lgcc

clean:
 rm -f *.o *~ core
=================================================

----- Original Message ----- 
From: "Ramana Radhakrishnan" <ramana.radhakrishnan at codito.com>
To: <uclinux-dev at uclinux.org>
Sent: Wednesday, March 26, 2003 7:00 PM
Subject: Re: [uClinux-dev] floating point problem


> hi,
> I guess floating point support is not there in the arm hardware. so it 
> might have to be emulated.so gcc would generate code to call a function 
> that casts your single float to a single integer.This call would be 
> automatically generated by gcc. So that is the reason for your error. To 
> avoid this problem 2 options. either avoid using floating points in kernel 
> modules. or
> link the same against libgcc.a. This function would be defined there. 
> regards
> Ramana
> -- 
> God made machine language - The rest is the work of man
> ---------------------------------------------------------------------------- 
>  --
> Ramana Radhakrishnan Codito Technologies
> 
> 
> On Wed, 26 Mar 2003 17:59:12 +0900, JinSoo Kim <people at micro-web.co.kr> 
> wrote:
> 
> > Hi everybody,
> >
> > I have a floating point problem.
> > My target system information is as follow.
> >
> > compiler: arm-elf-20011219 binary version
> > kernel: uClinux 20020701 version
> > cpu: samsung's s3c4510
> >
> > My problem is that when I load the device drvier module
> > with 'insmod' command there occurs an error,
> >
> > "insmod: unresolved symbol __fixsfsi".
> >
> > The device driver module contains a test function, float_init_test.
> > The function is a minimal function which makes the problem and
> > I made it for the explanation.
> >
> > void float_init_test(void)
> > {
> > float a[3] = { 1.0, 2.0, 3.0 };
> > int b[3];
> > b[0] = (int) a[0];
> > printk("%d\n", (int) b[0]);
> > }
> >
> > The function is not called anywhere. It is just defined.
> > If I remove the function definition the problem disapears.
> > If I link the loadable module into the kernel statically in kernel 
> > compile time,
> > the problem disapears too.
> >
> > How can I overcome this problem?
> > Any advice will be much helpful.
> > Help me~~~
> >
> > Best Regards,
> > JinSoo Kim
> >
> > ---------------------------------------
> > Director & CTO
> > MicroWeb Co., Ltd.
> >
> > TEL: 82-42-862-6212
> > FAX: 82-42-862-6202
> > E-mail: people at micro-web.co.kr
> > homepage: http://www.micro-web.co.kr
> > ---------------------------------------
> >
> >
> 
> 
> 
> 
> _______________________________________________
> uClinux-dev mailing list
> uClinux-dev at uclinux.org
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by uclinux-dev at uclinux.org
> 



More information about the uClinux-dev mailing list