LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 01-15-2009, 09:19 AM   #1
sucheta
LQ Newbie
 
Registered: Jan 2009
Posts: 2

Rep: Reputation: 0
Question export symbol problem in 2.6.27


Hi,

I am facing a poblem with export_symbol - can't access "my_name_hello" defined in hello.c from hello_user.c (in a different dir). The symbol "my_name_hello" is not present in the version table generated for hello_user.c.

The code is :-


(a) In parent/driver/hello.c

#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_ALERT */

#define EXPORT_SYMTAB

MODULE_VERSION("4.0.301");

asmlinkage int my_name_hello = 2;
asmlinkage int first_int_hello(void);

int first_int_hello(void)
{
return 1;
}

int init_module(void)
{
printk("<1>Hello world 1.\n");
printk("hello: my_name at %p\n", &my_name_hello);
return 0;
}

void cleanup_module(void)
{
printk(KERN_ALERT "Goodbye world 1.\n");
}

EXPORT_SYMBOL(my_name_hello);
EXPORT_SYMBOL(first_int_hello);


(b) In parent/user/hello_user.c

#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_ALERT */

MODULE_VERSION("4.0.301");
extern int my_name_hello;
int init_module(void)
{
printk("HELLO_USER --- Using exported sym, my_name = %p\n",
&my_name_hello);
return 0;
}

void cleanup_module(void)
{
printk(KERN_ALERT "Goodbye world 3.\n");
}


Tried following solutions :-
(a) /sbin/depmod -a in Makefile - didn't work
(b) don't want to copy Module.symvers in dir parent/driver into parent/user - as it will introduce dependency.
(c) --force-modversion with modprobe is also not working.
(d) export_objs not working. Or, please specify how to use it. May be I was using in a wrong way.
(e) don't know how to use KBUILD_EXTRA_SYMBOLS. Tried it but didn't work.

Any one please help. Searching it for many days.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to export http_proxy when username contains an @ symbol? Funkster Linux - Networking 6 11-19-2008 03:38 AM
./firefox-bin :symbol lookup error:/lib/libgthread-2.0.so.0: undefined symbol: arulupsaras Linux - General 1 11-08-2008 04:48 AM
symbol lookup error: /usr/lib/libgtk-x11.2.0.so.0: undefined symbol:... IamI Slackware 17 02-29-2008 11:10 AM
howto forcing ld to export external symbol? kkk139 Programming 1 07-17-2007 12:10 AM
export symbol from module to kernel dogalmity Programming 0 06-05-2006 04:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 05:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration