public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* difficulty with symbol export
@ 2002-04-29 12:35 V. Guruprasad
  2002-04-29 14:55 ` Kai Germaschewski
  0 siblings, 1 reply; 3+ messages in thread
From: V. Guruprasad @ 2002-04-29 12:35 UTC (permalink / raw)
  To: linux-kernel


Hi all,


Just playing with the kernel code, I added a silly function

	struct file_operations *get_socket_fileops ()
	{
		return &socket_file_ops;
	}

at the bottom of net/socket.c, and

	EXPORT_SYMBOL(get_socket_fileops);

into net/netsyms.c, expecting to be able to call this function
from a loadable module and to printk the function addresses
from the file_operations struct.

However, on rebooting into this modified kernel, my test module
fails to load, saying

	foo.o: unresolved symbol get_socket_fileops

even though the symbol looks exported in vmlinux (nm) and
in /boot/System.map:

	c020ca90 T get_socket_fileops
	0c2b52bf ? __kstrtab_get_socket_fileops
	0c2ba358 ? __ksymtab_get_socket_fileops

which looks exactly like sock_create, which the module *is*
able to address.

Any pointers?


thanks,
-prasad.

------------------------
V. Guruprasad ('prasad'),
http://www.columbia.edu/~vg96

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: difficulty with symbol export
  2002-04-29 12:35 difficulty with symbol export V. Guruprasad
@ 2002-04-29 14:55 ` Kai Germaschewski
  2002-04-29 15:14   ` V. Guruprasad
  0 siblings, 1 reply; 3+ messages in thread
From: Kai Germaschewski @ 2002-04-29 14:55 UTC (permalink / raw)
  To: V. Guruprasad; +Cc: linux-kernel

On Mon, 29 Apr 2002, V. Guruprasad wrote:

> at the bottom of net/socket.c, and
> 
> 	EXPORT_SYMBOL(get_socket_fileops);
> 
> into net/netsyms.c, expecting to be able to call this function
> from a loadable module and to printk the function addresses
> from the file_operations struct.
> 
> However, on rebooting into this modified kernel, my test module
> fails to load, saying
> 
> 	foo.o: unresolved symbol get_socket_fileops

Basically, you're doing the right thing - what output does

	grep get_socket_fileops /proc/ksyms

show?

Do you have CONFIG_MODVERSIONS turned on in your kernel config? If so,
you probably want to save your .config, make distclean and rebuild from 
scratch - that will likely fix the problem.

--Kai



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: difficulty with symbol export
  2002-04-29 14:55 ` Kai Germaschewski
@ 2002-04-29 15:14   ` V. Guruprasad
  0 siblings, 0 replies; 3+ messages in thread
From: V. Guruprasad @ 2002-04-29 15:14 UTC (permalink / raw)
  To: Kai Germaschewski; +Cc: linux-kernel


On Mon 2002.04.29, Kai Germaschewski wrote:

> Do you have CONFIG_MODVERSIONS turned on in your kernel config? If so,
> you probably want to save your .config, make distclean and rebuild from 
> scratch - that will likely fix the problem.

Thanks, that solved it. Evidently, a 'make dep' was required which makes
#defines in include/linux/modules/netsyms.ver

thanks,
-p.

------------------------
V. Guruprasad ('prasad'),
http://www.columbia.edu/~vg96

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-04-29 15:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-29 12:35 difficulty with symbol export V. Guruprasad
2002-04-29 14:55 ` Kai Germaschewski
2002-04-29 15:14   ` V. Guruprasad

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox