Can't get EXPORT_SYMBOL() to work

Malcolm Beattie (mbeattie@sable.ox.ac.uk)
Tue, 19 Oct 1999 12:16:02 +0100 (BST)


I can't seem to get EXPORT_SYMBOL() to export a global symbol when
adding source files to drivers/char in the kernel 2.2.5 source (as
shipped by Red Hat in the 2.2.5-15 RPM).

I have added an additional file in the drivers/char directory, updated
the Makefile and Config.in to add it to LX_OBJS and done a fresh
kernel rebuild (right from mrproper). That seems to compile everything
OK. I use EXPORT_SYMBOL() for each symbol I want to export just as
plenty of other source files in drivers/char seem to do. When I do an
nm on the resulting object file, the symbols appear, e.g.

# nm bufflink_kernel.o | grep bufflink_create
00000000 ? __kstrtab_bufflink_create
00000000 ? __ksymtab_bufflink_create
00000000 T bufflink_create

When I do an nm on the char.a produced by the entire directory, the
symbols also appear:

# nm char.a | grep bufflink_create
00000000 ? __kstrtab_bufflink_create
00000000 ? __ksymtab_bufflink_create
00000000 T bufflink_create

But when I do an nm on the resulting vmlinux, they don't:

# nm vmlinux | grep bufflink
#

The link step for vmlinux takes all the various .a files and the
various .o files and link them all togther, but the exported symbols
are gone. The only thing I can think of is that it may be that
because nothing else ever mentions the symbols that the linker
decides not to incorporate them. But surely there must be other
functions which the kernel makes available for modules only and
such like? Please can someone let me know how to get EXPORT_SYMBOL()
working? I can make the source available if anyone thinks it will
help but I'll be announcing what this all about soon anyway and don't
particularly want to duplicate it.

--Malcolm

-- 
Malcolm Beattie <mbeattie@sable.ox.ac.uk>
Unix Systems Programmer
Oxford University Computing Services

- 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/