Re: Undefined symbols in 2.6.11-rc5-mm1

From: Adrian Bunk
Date: Fri Mar 04 2005 - 15:51:48 EST


On Fri, Mar 04, 2005 at 02:11:13PM -0500, Kai Germaschewski wrote:
> 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.

Silly question:
What's the advantage of lib-y compared to obj-y?

> --Kai

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

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