public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* how to export a symbol so that I can use it in a module
@ 2002-11-11 21:54 Folkert van Heusden
  2002-11-11 22:02 ` Ben Greear
  2002-11-11 22:02 ` Tomas Szepe
  0 siblings, 2 replies; 3+ messages in thread
From: Folkert van Heusden @ 2002-11-11 21:54 UTC (permalink / raw)
  To: linux-kernel

Hi,

I've added a function "create_tcp_port_number" to net/core/utils.c
like this:

int create_tcp_port_number(void)
{
/* blah blah */
}
EXPORT_SYMBOL(create_tcp_port_number);

in include/linux/net.h I added:
extern int create_tcp_port_number(void);

So, now in net/ipv6/tcp_ipv6.c I used this 'create_tcp_port_number'
function. I'm compiling the kernel with ipv6 as a module. And that's
where I get the problem. In the last stage, the makefile does a
depmod and then I get:
depmod: *** Unresolved symbols in /lib/modules/2.4.19/kernel/net/ipv6/ipv6.o
depmod:         create_tcp_port_number

I'm really out of ideas what can be the cause of this. It must be
something trivial, but I cannot find the solution. Anyone who can
help me?

Thank you.


Folkert van Heusden


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

* Re: how to export a symbol so that I can use it in a module
  2002-11-11 21:54 how to export a symbol so that I can use it in a module Folkert van Heusden
@ 2002-11-11 22:02 ` Ben Greear
  2002-11-11 22:02 ` Tomas Szepe
  1 sibling, 0 replies; 3+ messages in thread
From: Ben Greear @ 2002-11-11 22:02 UTC (permalink / raw)
  To: Folkert van Heusden; +Cc: linux-kernel

Folkert van Heusden wrote:
> Hi,
> 
> I've added a function "create_tcp_port_number" to net/core/utils.c
> like this:
> 
> int create_tcp_port_number(void)
> {
> /* blah blah */
> }
> EXPORT_SYMBOL(create_tcp_port_number);

Try putting the EXPORT_SYMBOL macro in net/netsyms.c

Ben


-- 
Ben Greear <greearb@candelatech.com>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear



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

* Re: how to export a symbol so that I can use it in a module
  2002-11-11 21:54 how to export a symbol so that I can use it in a module Folkert van Heusden
  2002-11-11 22:02 ` Ben Greear
@ 2002-11-11 22:02 ` Tomas Szepe
  1 sibling, 0 replies; 3+ messages in thread
From: Tomas Szepe @ 2002-11-11 22:02 UTC (permalink / raw)
  To: Folkert van Heusden; +Cc: linux-kernel

> I've added a function "create_tcp_port_number" to net/core/utils.c
> like this:
> 
> int create_tcp_port_number(void)
> {
> /* blah blah */
> }
> EXPORT_SYMBOL(create_tcp_port_number);
> 
> in include/linux/net.h I added:
> extern int create_tcp_port_number(void);
> 
> So, now in net/ipv6/tcp_ipv6.c I used this 'create_tcp_port_number'
> function. I'm compiling the kernel with ipv6 as a module. And that's
> where I get the problem. In the last stage, the makefile does a
> depmod and then I get:
> depmod: *** Unresolved symbols in /lib/modules/2.4.19/kernel/net/ipv6/ipv6.o
> depmod:         create_tcp_port_number
> 
> I'm really out of ideas what can be the cause of this. It must be
> something trivial, but I cannot find the solution. Anyone who can
> help me?

Make sure you're including <linux/module.h> into utils.c and that
utils.o is among export-objs in the makefile.

--
Tomas Szepe <szepe@pinerecords.com>

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

end of thread, other threads:[~2002-11-11 21:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-11 21:54 how to export a symbol so that I can use it in a module Folkert van Heusden
2002-11-11 22:02 ` Ben Greear
2002-11-11 22:02 ` Tomas Szepe

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