Hi Robert,

              The code works well on i386 box kernel-2.6.32.9,but i have 
problem on ARM omap , kernel-2.6.32.9 when I do nm m3.ko   it show's ( U rday_3)


  cat /proc/kallsyms | grep rday_3

    bf011094 D rday_3 [m2]
 
   but when i do insmod it gives me unresolved symbol

   this bit strange,Can please share some idea on this.

Regards,
Hemanth




--- On Fri, 10/12/10, Robert P. J. Day <rpj...@crashcourse.ca> wrote:

From: Robert P. J. Day <rpj...@crashcourse.ca>
Subject: Re: EXPORT_SYMBOL
To: "Hemanth Kumar" <hemw...@yahoo.co.in>
Cc: kernelnewbies@nl.linux.org
Date: Friday, 10 December, 2010, 7:46 PM

On Fri, 10 Dec 2010, Hemanth Kumar wrote:

> Hi All,
>
>             I was working with the example from
> http://ldn.linuxfoundation.org/article/kernel-symbols-whats-available-your-module-what-isnt

  that stuff is a bit dated but, still, it should work.
  
>   I am getting the error unresolved symbol rday_3, ARCH=arm omap 
> kernel=2.3.32.9
>  
>   insmod m2.ko
>   then
>   insmod m3.ko
>   unresolved symbol rday_3
>
>   then i did cat /proc/kallsyms | grep rday_3
>    i can see the rday_3 in that file,But still I am unable to insmod the m3.ko

  can you list the full line out of /proc/kallsyms, so we can see the
symbol type?
     
>     Can anybody please share some idea on this,Is anything there that's need 
> to be enabled in config file in
> kernel,Below is the code
>
>  file m2.c
>
>  #include <linux/module.h>
>  #include <linux/init.h>
>  #include <linux/kernel.h>
>   static int rday_1 = 1;
>   int rday_2 = 2;
>   int rday_3 = 3;
>   EXPORT_SYMBOL(rday_3);
>    static int __init hi(void)
>  {
>      printk(KERN_INFO "module m2 being loaded.\n");
>      return 0;
>  }
>   static void __exit bye(void)
>  {
>      printk(KERN_INFO "module m2 being unloaded.\n");
>  }
>   module_init(hi);
>   module_exit(bye);
>   MODULE_AUTHOR("Robert P. J. Day");
>   MODULE_LICENSE("GPL");
>   MODULE_DESCRIPTION("Let's try some exporting.");

  AFAICT, that should be fine and the symbol "rday_3" should be
exported to be globally visible.  so far, so good, and you claim that
it's listed in /proc/kallsyms.

>   file m3.c
> #include <linux/module.h>
>  #include <linux/init.h>
>  #include <linux/kernel.h>
>
>   extern int rday_3;
>    static int __init m3hi(void)
>  {
>      printk(KERN_INFO "module m2 being loaded = %d\n",rday_3);
>      return 0;
>  }
>   static void __exit m3bye(void)
>  {
>
>     printk(KERN_INFO "module m2 being unloaded.\n");
>  }
>   module_init(m3hi);
>   module_exit(m3bye);
>   MODULE_AUTHOR("Robert P. J. Day");
>   MODULE_LICENSE("GPL");
>   MODULE_DESCRIPTION("Let's try some exporting.");

  if "rday_3" was exported properly, i don't see why it shouldn't be
visible when this module is loaded.  anyone else have some thoughts on
this?  this clearly worked in the past.

rday

-- 

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

Reply via email to