From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Subject: Re: [PATCH 1/3] module: deal with alignment issues in built-in module versions Date: Thu, 17 Feb 2011 09:31:36 -0800 Message-ID: <20110217173136.GA28486@dtor-ws.eng.vmware.com> References: <1297123347-2170-1-git-send-email-dtor@vmware.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Linus Torvalds Cc: LKML , David Miller , Geert Uytterhoeven , Rusty Russell , Linux/m68k , Linux-Arch List-Id: linux-arch.vger.kernel.org On Thu, Feb 17, 2011 at 09:24:58AM -0800, Linus Torvalds wrote: > On Mon, Feb 7, 2011 at 4:02 PM, Dmitry Torokhov 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [65.115.85.73] ([65.115.85.73]:50279 "EHLO smtp-outbound-2.vmware.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751599Ab1BQRcc (ORCPT ); Thu, 17 Feb 2011 12:32:32 -0500 Date: Thu, 17 Feb 2011 09:31:36 -0800 From: Dmitry Torokhov Subject: Re: [PATCH 1/3] module: deal with alignment issues in built-in module versions Message-ID: <20110217173136.GA28486@dtor-ws.eng.vmware.com> References: <1297123347-2170-1-git-send-email-dtor@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: To: Linus Torvalds Cc: LKML , David Miller , Geert Uytterhoeven , Rusty Russell , Linux/m68k , Linux-Arch Message-ID: <20110217173136.lKiLrdVyZ5Da2M1-5lKVZpW5lBhNbBFxeTOZ2lb6dis@z> On Thu, Feb 17, 2011 at 09:24:58AM -0800, Linus Torvalds wrote: > On Mon, Feb 7, 2011 at 4:02 PM, Dmitry Torokhov 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