Yeah it is.

Its weird. Im missing something I think..

If I compile my module as being linked with the kernel, ie static link 
everything works fine.
'cat /proc/kallsyms | grep dosomething' shows my function is there.... 

But compiling a module that uses that function generates an error post-process 
when generating the .ko file that it cant find
dosomething... 

extern int dosomething should do it no? (inside my module code)
Before ive seen modules complain about undefined symbols while inserting into 
kernel space, not at compile...


From: [email protected]
To: [email protected]; [email protected]
Date: Tue, 24 May 2011 13:51:30 +0200
Subject: Re: [Ltib] kernel function exporting to use in module?



Hi,   Are you sure, the file which has the function (dosomething) is included & 
compiled with the kernel? Regards,Giri     From: 
[email protected] 
[mailto:[email protected]] On Behalf Of Krzysztof 
Stankiewicz
Sent: Tuesday, May 24, 2011 9:47 AM
To: [email protected]
Subject: [Ltib] kernel function exporting to use in module? inside a kernel 
file I've added a new function

static int dosomething(int parm)
{
       return 1;

}

EXPORT_SYMBOL_NOVERS(dosomething);

(also tried EXPORT_SYMBOL and without static keyword)

then in my module which is also compiled by ltib i have

extern int dosomething(int parm);

and using it as

dosomething(1);

but when the whole thing compiles I get 
ERROR: "dosomething" [drivers\somefile.ko] undefined!

my questions is what am i doing wrong and how can i get it to try to link my 
module with that function when I inmod it?
_______________________________________________
LTIB home page: http://ltib.org

Ltib mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/ltib                                  
  
_______________________________________________
LTIB home page: http://ltib.org

Ltib mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/ltib

Reply via email to