Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751767AbdCMSqU (ORCPT ); Mon, 13 Mar 2017 14:46:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43840 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751700AbdCMSqL (ORCPT ); Mon, 13 Mar 2017 14:46:11 -0400 Date: Mon, 13 Mar 2017 14:46:09 -0400 From: Jessica Yu To: David Daney Cc: Rusty Russell , Andrey Ryabinin , linux-kernel@vger.kernel.org, Andrew Morton Subject: Re: [PATCH] module: set .init_array alignment to 8 Message-ID: <20170313184609.GC8117@packer-debian-8-amd64.digitalocean.com> References: <20170308013108.13345-1-david.daney@cavium.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20170308013108.13345-1-david.daney@cavium.com> X-OS: Linux eisen.io 3.16.0-4-amd64 x86_64 User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 13 Mar 2017 18:46:11 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1270 Lines: 38 +++ David Daney [07/03/17 17:31 -0800]: >The proper idiom for aligning linker sections in modules is different >than for built-in sections. ". = ALIGN();" followed by a forced >output address of 0 does nothing, as forcing the address changes the >value of ".". > >Use output section alignment specifier instead. > >Fixes: 9ddf82521c86 ("kernel: add support for .init_array.* constructors") >Signed-off-by: David Daney Good catch, thanks. I've applied this to modules-next. Jessica >I noticed this when doing the __jump_table thing. Doesn't seem to >break a defconfig build, but otherwise untested. > > scripts/module-common.lds | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > >diff --git a/scripts/module-common.lds b/scripts/module-common.lds >index 9b6e246..d61b9e8 100644 >--- a/scripts/module-common.lds >+++ b/scripts/module-common.lds >@@ -20,8 +20,7 @@ SECTIONS { > __kcrctab_unused_gpl 0 : { *(SORT(___kcrctab_unused_gpl+*)) } > __kcrctab_gpl_future 0 : { *(SORT(___kcrctab_gpl_future+*)) } > >- . = ALIGN(8); >- .init_array 0 : { *(SORT(.init_array.*)) *(.init_array) } >+ .init_array 0 : ALIGN(8) { *(SORT(.init_array.*)) *(.init_array) } > > __jump_table 0 : ALIGN(8) { KEEP(*(__jump_table)) } > } >-- >2.9.3 >