Re: Can't get EXPORT_SYMBOL() to work

Alan Cox (alan@lxorguk.ukuu.org.uk)
Tue, 19 Oct 1999 13:32:17 +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).

It works fine. You've hit linker intelligence

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

Note it is a .a file.

> 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

Bingo. Which is why a lot of the export symbol stuff is clustered
into foo_sym.c files in 2.2.x. The foo_sym is arranged to always be
compiled in and it sucks in the other stuff

Alan

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