Re: [PATCH 1/3] module: deal with alignment issues in built-in module versions

Dmitry Torokhov
2011-02-17T17:31:36Z

On Thu, Feb 17, 2011 at 09:24:58AM -0800, Linus Torvalds wrote:
> On Mon, Feb 7, 2011 at 4:02 PM, Dmitry Torokhov <dtor@vmware.com> wrote:
> >
> > Moreover, as DaveM said, we can't reliably put structures into
> > independent objects, put them into a special section, and then expect
> > array access over them (via the section boundaries) after linking the
> > objects together to just "work" due to variable alignment choices in
> > different situations.
>
> Why not?
>
> That's what we normally do. Just align the "__modver", and you should
> be all good. What's the problem?

>From what I understand __attribute__ ((aligned(x))) only guarantees
minimum alignment, not exact (gapless) alignment. GCC seems to lay out
pointers in the section without gaps on all arches that we have.

Thanks.

--
Dmitry