On Tue, Jul 21, 2009 at 1:07 PM, er krishna <erkrishna@xxxxxxxxx> wrote:
Surely, the issue looks like you are not doing a #include<module.h>
Add it to fs/dropcache.c
You get this error in that case.
Regards,
Sandeep.
“To learn is to change. Education is a process that changes the learner.”
On Tue, Jul 21, 2009 at 12:45 PM, Siddu <siddu.sjce@xxxxxxxxx> wrote:On Tue, Jul 21, 2009 at 11:13 AM, er krishna <erkrishna@xxxxxxxxx> wrote:
I am again repeating the steps, i found something interested, when I am doing make after making EXPORT_SYMBOL entries in fs/drop_caches.c ( during kernel compilation); I am getting following warning messages for each of the exported function from this file only, the messages are:
data definition has no type or storage class
type defaults to 'int' in declaration of 'EXPORT_SYMBOL'
parameter names (without types) in function declaration
Although these are the warning messages, but why it is coming from fs/drop_caches file only. The function which I have exported from fs/buffer.c and block/genhd.c are easily exported and there is no warning messages against any exported function from other than fs/drop_caches.cCould you tell what other functions were you able to export successfully from buffer.c and genhd.c
[root@CENTOS2 linux-2.6.26]# grep myfunction System.map
c0175a00 T myfunction
c0177cad T myfunction2
c02ac3a5 T myfunction3
c063e178 r __ksymtab_myfunction2
c063ea30 r __ksymtab_myfunction3
c06492da r __kstrtab_myfunction2
c064b00c r __kstrtab_myfunction3
[root@CENTOS2 linux-2.6.26]#
Check it out myfunctio2 & myfunction3 I am able 2 export from fs/buffer.c and block/genhd.c but I am not able to export any of the function from fs/dropcacahe.c
& whenever I do make after doing the entry in dropcache.c I am always getting following error message :
[root@CENTOS2 linux-2.6.26]# cat kk
fs/drop_caches.c:85: warning: data definition has no type or storage class
fs/drop_caches.c:85: warning: type defaults to ‘int’ in declaration of ‘EXPORT_SYMBOL’
fs/drop_caches.c:85: warning: parameter names (without types) in function declaration
fs/drop_caches.c:86: warning: data definition has no type or storage class
fs/drop_caches.c:86: warning: type defaults to ‘int’ in declaration of ‘EXPORT_SYMBOL’
fs/drop_caches.c:86: warning: parameter names (without types) in function declaration
fs/drop_caches.c:87: warning: data definition has no type or storage class
fs/drop_caches.c:87: warning: type defaults to ‘int’ in declaration of ‘EXPORT_SYMBOL’
fs/drop_caches.c:87: warning: parameter names (without types) in function declaration
fs/drop_caches.c:88: warning: data definition has no type or storage class
fs/drop_caches.c:88: warning: type defaults to ‘int’ in declaration of ‘EXPORT_SYMBOL’
fs/drop_caches.c:88: warning: parameter names (without types) in function declaration
fs/drop_caches.c:89: warning: data definition has no type or storage class
fs/drop_caches.c:89: warning: type defaults to ‘int’ in declaration of ‘EXPORT_SYMBOL’
fs/drop_caches.c:89: warning: parameter names (without types) in function declaration
make[2]: *** Deleting file `fs/configfs/inode.o'
make[2]: *** [fs/configfs/inode.o] Interrupt
make[1]: *** [fs/configfs] Interrupt
make: *** [fs] Interrupt
[root@CENTOS2 linux-2.6.26]#
Surely, the issue looks like you are not doing a #include<module.h>
Add it to fs/dropcache.c
You get this error in that case.
So, these are the two clues, can anybody help me out.
Peter , I have tried with extern optaion also , but the results are same.
Thanks & Best regards,
Krishna
Regards,
Sandeep.
“To learn is to change. Education is a process that changes the learner.”
On Tue, Jul 21, 2009 at 10:30 AM, Mulyadi Santosa <mulyadi.santosa@xxxxxxxxx> wrote:
On Mon, Jul 20, 2009 at 9:40 PM, er krishna<erkrishna@xxxxxxxxx> wrote:Upper case T, according to "man nm" means it's a global symbol. In
> I have exported three functions from fs/dropcaches.c by making their
> function declaration in linux/mm.h, compiled the corresponding 2.6.26
> kernel & got their entries in System.map file as follows:
>
>
> c0174d98 T drop_slab
> c0174db2 T drop_pagecache
> c0174ea7 T drop_caches_sysctl_handler
other word, other function located in separate object file could
reference it. OK, seems you do correctly here in exporting symbol
What do you mean by the above paragraph?
> These entries are quite different from the actual exported functions from
> other files, it has only T option.
Mylyadi, Actually when we do compilation, there are warning messages and when i do insmod there is error and in dmesg it shows that the above symbols are not resolved (it means there is a linking error) , I have exported some other function from other file and checked all those entries in /proc/kallsyms and in System.map file. These are different in nature. Thats why I asked ?
Please paste the relevant portion of /proc/kallsym and System.map so that all of us can see in what way they differ
As I have declared their definition in linux/mm.h, I dont think that i have to do extern in my module coz i have included linux/mm.h after making proper declaration of these functions. But let me check with extern once more.
And as far as I can see here, they are warning messages so there's a
chance the final kernel module can be successfully build. What happen
if you do "insmod -f"? Does it work as expected?
I will let you know after repeating the above steps, coz I am once again compiling the kernel.
--Other than that, as Peter has suggested, are you sure you have
declared drop_slab() etc as "extern" function in your module?
--
Regards,
~Sid~
http://sidsenclave.blogspot.com