Re: 2.5.59 vmlinux.lds.S change broke modules

From: Sam Ravnborg (sam@ravnborg.org)
Date: Sat Jan 18 2003 - 04:23:31 EST


On Sat, Jan 18, 2003 at 09:00:51AM +0100, Mike Galbraith wrote:
> At 01:55 PM 1/17/2003 +0100, Mikael Pettersson wrote:
>
> >Reverting 2.5.59's patch to arch/i386/vmlinux.lds.S cured the
> >problem and modules now load correctly for me.
>
> Hi,
>
> Putting . = ALIGN(64) back in front of __start___ksymtab = .
> (vmlinux.lds.h) fixed it here.

But that is just a way to hide the real problem.

With . = ALIGN(64);
you make sure that the linker does not do any alignment of .
when entering the section.
It is much better to let the linker do proper alignment, and not
to rely on a magic number in the .lds file.

Now consider if we decide to put in a new symbol with alignment 128 for
some reason. A little gcc magic is used to sepecy the alignment of
the symbol, but the resulting kernel oopses. Why?
Because the ALIGN() preceeding the section was not adjusted properly.
Only sane way is to move the labels inside the block, or at least let
them depend on the address of the section. The lables should not
be assigned the value of ., when we know the linker may adjust it.

The solution that Russell used for ARM is IMO the best way to do it.

The only issue remaining here is what the linker will do for an empty
section, as Eric points out. I have not investigated that.

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



This archive was generated by hypermail 2b29 : Thu Jan 23 2003 - 22:00:18 EST