From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751884AbdJXJKL (ORCPT ); Tue, 24 Oct 2017 05:10:11 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:56796 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751372AbdJXJKH (ORCPT ); Tue, 24 Oct 2017 05:10:07 -0400 Date: Tue, 24 Oct 2017 10:09:54 +0100 From: Russell King - ARM Linux To: Ard Biesheuvel Cc: "linux-kernel@vger.kernel.org" , jeffy , Ingo Molnar , "linux-arm-kernel@lists.infradead.org" , Chris Zhong Subject: Re: [PATCH] ARM: Fix zImage file size not aligned with CONFIG_EFI_STUB enabled Message-ID: <20171024090953.GZ20805@n2100.armlinux.org.uk> References: <20171018050108.10352-1-jeffy.chen@rock-chips.com> <20171022124757.GL20805@n2100.armlinux.org.uk> <59ED6179.5020301@rock-chips.com> <20171023085006.GM20805@n2100.armlinux.org.uk> <59EDC34C.40109@rock-chips.com> <20171023105046.GT20805@n2100.armlinux.org.uk> <20171023114549.GU20805@n2100.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 24, 2017 at 09:09:52AM +0100, Ard Biesheuvel wrote: > The following patch appears to fix the issue as well: > > diff --git a/arch/arm/boot/compressed/vmlinux.lds.S > b/arch/arm/boot/compressed/vmlinux.lds.S > index 7a4c59154361..0e0f504e256e 100644 > --- a/arch/arm/boot/compressed/vmlinux.lds.S > +++ b/arch/arm/boot/compressed/vmlinux.lds.S > @@ -83,7 +83,9 @@ SECTIONS > __pecoff_data_rawsize = . - ADDR(.data); > #endif > > - _edata = .; > + .edata (NOLOAD) : { > + _edata = .; > + } > > _magic_sig = ZIMAGE_MAGIC(0x016f2818); > _magic_start = ZIMAGE_MAGIC(_start); > > because the NOLOAD triggers the linker to emit all PROGBITS sections > before _edata, including unknown ones. > > E.g., in my binary, it gives me > > 00798020 D __pecoff_data_end > 00798200 d __ksymtab_sort > 00798208 B __bss_start > 00798208 D _edata The question is: do we want to know when additional sections get emitted into the binary? You've already said that for EFI, you need the size of the binary to be a multiple of 512, so I guess the answer to that is "yes". -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up According to speedtest.net: 8.21Mbps down 510kbps up