Re: About kernel module programming

From: Steve Dodd (steved@loth.demon.co.uk)
Date: Sun Apr 16 2000 - 06:32:43 EST


On Sun, Apr 16, 2000 at 04:10:06PM +0800, ÄåªáµÓ¤l wrote:

> From: "ÄåªáµÓ¤l"
> <chenyp@brahms.ice.cycu.edu.tw>

[mutters about non-us-ascii characters in rfc822 headers]

> To: <Undisclosed-Recipient:;>

And that sure as hell confused me when I tried to do "group reply" ;-)

[..]
> I wrote a kernel module.(for test how to call the kernel function in the
> kernel module)
> This module call register_tcf_proto_ops() kernel function in the
> init_module().
> when I load this module, it appears the following error message.
> "test.o: unresolved symbol register_tcf_proto_ops"
> Why??

First guess would be that your kernel was compiled with CONFIG_MODVERSIONS,
but you didn't define MODVERSIONS when building your module. When I'm doing
quick hacks outside the kernel source tree, I just copy the CFLAGS the kernel
tree uses when building modules. For me this is:

LINUX_SRC_DIR=../linux-2.3
CFLAGS = -D__KERNEL__ -I$(LINUX_SRC_DIR)/include -Wall -Wstrict-prototypes \
        -O2 -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 \
        -DCPU=686 -march=i686 -fno-strict-aliasing -DMODULE -DMODVERSIONS \
        -include $(LINUX_SRC_DIR)/include/linux/modversions.h

I was look at a certain vendor's (who shall remain nameless *cough* DPT
*cough*) driver source yesterday, and they really bogged up the MODVERSIONS
thing.

-- 
Our problems are mostly behind us.  What we have to do now is
fight the solutions.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:08 EST