Re: EXPORT_SYMBOL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
========================================================================

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux