EXPORT_SYMBOL problem, in networking code

Bart De Schuymer (bart.de.schuymer@pandora.be)
Sun, 28 Jul 2002 15:11:40 +0200


Hello,

I use a function pointer called broute_decision that is default set to NULL,
but can be initialized by another kernel module.
The definition of the function pointer is situated in net/bridge/br_input.c,
this file contains the right EXPORT_SYMBOL(broute_decision); line.

When compiling the kernel with the both the bridge and my code as a module, I
get the following error after "make modules_install":

depmod: *** Unresolved symbols in
/lib/modules/2.4.18/kernel/net/bridge/netfilter/ebtable_broute.o
depmod: broute_decision_Rsmp_b3a20e56

using objdump gives:
#>objdump --disassemble -j __ksymtab net/bridge/br_input.o'
net/bridge/br_input.o: file format elf32-i386
Disassembly of section __ksymtab:
00000000 <__ksymtab_broute_decision_Rsmp_b3a20e56

#>objdump --disassemble -j __ksymtab net/bridge/bridge.o'
net/bridge/bridge.o: file format elf32-i386

So, although br_input.o has the symbol in its table, bridge.o doesn't.
My difficulties come, AFAIK, from the fact that the bridge module is composed
out of multiple c-files, here is (an excerpt of) the bridge Makefile:

O_TARGET := bridge.o
# the follwing line is added by me
export-objs := br_input.o
obj-y := br.o br_device.o br_fdb.o br_forward.o br_if.o br_input.o \
br_ioctl.o br_notify.o br_stp.o br_stp_bpdu.o \
br_stp_if.o br_stp_timer.o
obj-m := $(O_TARGET)

When compiling the same kernel, but with the bridge and my code built into the
kernel (not as modules), everything compiles and it works fine.

I have a "solution" by defining broute_decision in net/core/dev.c and doing
the EXPORT_SYMBOL in net/netsyms.c. This works. But broute_decision is not
used in net/core/dev.c, so I would like the definition to be in
net/bridge/br_input.c.

How do I get this to work?
Please CC me as I'm not subscribed to the list.
I can provide the compilable code (using net/core/dev.c) and the
non-compilable code (using net/bridge/br_input.c) if necessary.

-- 
cheers,
Bart

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