This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Problem Loading a Module Compiled with GCC 3.4.2
- From: Ajitpal Singh <meetajitpal at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 12 Jan 2006 17:59:24 +0530
- Subject: Problem Loading a Module Compiled with GCC 3.4.2
Hi All,
I have a kernel module which uses a function from a library file( .lib).
This function takes as a paramater a character pointer of string
buffer and simply prints that string.
This library file has been created by me using ld.
a) When I compile the module and link it with the libary file using
GCC Version 3.4.2(Supplied with Fedora Core 3,Kernel Version is 2.6.9)
and insmod it
I get a Kernel OOPS.
b) But if I compile the module with GCC 3.2.2 (Supplied with RedHat 9)
everything works fine and the module loads successfully.
c) If I create an ARCHIVE( .a) file using AR and link it with the
module using GCC Version 3.4.2 the module is again successfully
loaded.
Summarising the scenarios in the following table.
GCCVERSION | LIB/ARCHIVE | LOADS
SUCCESSFULLY
1. 3.4.2(With FC 3) | Created a Library File | NO
(Get a Kernel
OOPs)
and linked with the module.
2. 3.4.2(With FC 3) | Created an Archive file | YES
and linked with the module
3. 3.2.2(With Redhat 9) | Created a Library File | YES
and linked with the module.
FC is Fedora Core
Kindly could you please tell what could be the problem.
Best Regards,
Ajitpal Singh