* question about module and undeinfed symbols.
@ 2004-11-14 18:42 Sylvain
2004-11-14 18:48 ` Jan Engelhardt
0 siblings, 1 reply; 4+ messages in thread
From: Sylvain @ 2004-11-14 18:42 UTC (permalink / raw)
To: linux-kernel
Hello,
I have a problem of undefined symbol, that prevents me from loading
the module I wrote.
The function that is "undifined", is actually defined within the
kernel code, and I wanted it to be exported with "export_symbol"
macro. After re-compiling, the variable is actually presents in
/proc/kallsyms. (but with type == 't' -> section text, but not
global according to proc file..)
if I tried to compile a module using this variable, i got a warning
"undefined symbol", and for this reason, the module refuses to be
loaded with "insmod".
What I dont understand is the following:
The fonction printk, is also undifened and exported with the same
macro "export_symbol". but compilation doesnt complain about it!!
Am I missing a step somewhere?!
Thanks for any help,
sylvain
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: question about module and undeinfed symbols.
2004-11-14 18:42 question about module and undeinfed symbols Sylvain
@ 2004-11-14 18:48 ` Jan Engelhardt
2004-11-14 20:02 ` Sylvain
0 siblings, 1 reply; 4+ messages in thread
From: Jan Engelhardt @ 2004-11-14 18:48 UTC (permalink / raw)
To: Sylvain; +Cc: linux-kernel
>The fonction printk, is also undifened and exported with the same
>macro "export_symbol". but compilation doesnt complain about it!!
#include <linux/kernel.h>
>Am I missing a step somewhere?!
Jan Engelhardt
--
Gesellschaft für Wissenschaftliche Datenverarbeitung
Am Fassberg, 37077 Göttingen, www.gwdg.de
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: question about module and undeinfed symbols.
2004-11-14 18:48 ` Jan Engelhardt
@ 2004-11-14 20:02 ` Sylvain
2004-11-14 20:44 ` Jan Engelhardt
0 siblings, 1 reply; 4+ messages in thread
From: Sylvain @ 2004-11-14 20:02 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: linux-kernel
Hi Jan,
thanks you for you response, unfortunatly it appears not to work better :/
I think the problem is isolated, I notices that System.map doesnt
contain same information for my function:
there is the line "c010d480 T myFunction"
but no entry: __ksymtab_myFunction nor __kstrtab_myFunction,
A warning appear during kernel compilation, on the line:
EXPORT_SYMBOL(myFunction):
warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL'
parameter names (without types) in function declaration
data definition has no type of storage classe
seems to me really weird :/
Sylvain
On Sun, 14 Nov 2004 19:48:37 +0100 (MET), Jan Engelhardt
<jengelh@linux01.gwdg.de> wrote:
>
> >The fonction printk, is also undifened and exported with the same
> >macro "export_symbol". but compilation doesnt complain about it!!
>
> #include <linux/kernel.h>
>
> >Am I missing a step somewhere?!
>
>
> Jan Engelhardt
> --
> Gesellschaft für Wissenschaftliche Datenverarbeitung
> Am Fassberg, 37077 Göttingen, www.gwdg.de
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: question about module and undeinfed symbols.
2004-11-14 20:02 ` Sylvain
@ 2004-11-14 20:44 ` Jan Engelhardt
0 siblings, 0 replies; 4+ messages in thread
From: Jan Engelhardt @ 2004-11-14 20:44 UTC (permalink / raw)
To: Sylvain; +Cc: linux-kernel
>A warning appear during kernel compilation, on the line:
>EXPORT_SYMBOL(myFunction):
That should have been a semicolon (;) not a colon (:).
To access a symbol in the "kernel" (i.e. bzImage) from a module, it needs to be
exported via the already-mentioned EXPORT_SYMBOL(). From kernel to kernel,
there is nothing needed.
>warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL'
#include <linux/module.h> to get the EXPORT_SYMBOLs and stuff.
>parameter names (without types) in function declaration
>data definition has no type of storage classe
>
>> #include <linux/kernel.h>
I mean, it's not done with ONE include file. Even for simple modules (like
http://linux01.org:2222/f/oops_ko.tbz2) you already need a handful of includes.
And "small" (~400 lines) modules like my kernel-based tty logger interface
already takes 16 lines o' include.
Jan Engelhardt
--
Gesellschaft für Wissenschaftliche Datenverarbeitung
Am Fassberg, 37077 Göttingen, www.gwdg.de
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-11-14 20:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-14 18:42 question about module and undeinfed symbols Sylvain
2004-11-14 18:48 ` Jan Engelhardt
2004-11-14 20:02 ` Sylvain
2004-11-14 20:44 ` Jan Engelhardt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox