Re: Undefined symbols in 2.6.11-rc5-mm1

From: Kai Germaschewski
Date: Fri Mar 04 2005 - 14:27:14 EST


On Fri, 4 Mar 2005, Rusty Russell wrote:

> On Wed, 2005-03-02 at 15:00 +0100, Adrian Bunk wrote:
> > Why doesn't an EXPORT_SYMBOL create a reference?
>
> It does: EXPORT_SYMBOL(x) drops the address of "x", including
> __attribute_used__, in the __ksymtab section.

Well, the problem is that this is still an internal reference in the same
object file. So ld looks into the lib .a archive, determines that none of
the symbols in that object file are needed to resolve a reference and
drops the entire .o file. Doing so, it drops the __ksymtab section as
well, which otherwise would be used by the kernel to look up that symbol.

So it drops the reference and the referencee ;), which is normally fine --
no unresolved symbols occur. Unfortunately, the kernel really needs to
know the contents of the __ksymtab sections to correctly export those
symbols, but it doesn't reference it in any explicit way.

I don't think there's an easy fix, except for not putting such objects
into an archive/lib, but to link them directly.

--Kai



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