From patchwork Wed Jun 24 10:12:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 50262 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ABBFC228FC for ; Wed, 24 Jun 2015 10:13:16 +0000 (UTC) Received: by lagh6 with SMTP id h6sf9852200lag.0 for ; Wed, 24 Jun 2015 03:13:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:from:to:subject:precedence:reply-to:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :content-type:content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=dvwt7PsHV/eZuHvTwORFp8FpYOR3tzVamLyPQGp+Aes=; b=RhVYUpUzy5ntlT+lUF7KHw5so22wjTwc6g53E+KhW+jEkNkVaVW/gKkoXG5eLlIcYE k1F4ilLEgOmajSjCvWrO/umeDHv3dl52cJsJTO6UGuKctQQvzCqvvHgNUk+6crGY3D6b yyvnJMaz5z/BkOePXSBGvOwQLpV1JK/nD87sFq0TGgttn1VbJFHU6vuC8dsTov0pLQQY a4MinOjiHuqhVZnn9nwv7owiQ99JsgPfiIOjJ8t+yoPypcWtsLT3RQHL6npjqRCRXyoY PR4c1UNuPWP7DRAZuj4vX0GVIzDAJqmtfHEPT1C9vpF5vMnDKFe/h25TpYMwVwXIhyit qp9g== X-Gm-Message-State: ALoCoQmJ79YiSjY0DB33r9P/jGKrjBiBrB/mJXwkDaIuC5nFQoxBE3+wiuVYXFetc7/JjZA1w+4u X-Received: by 10.152.22.71 with SMTP id b7mr35468435laf.3.1435140795606; Wed, 24 Jun 2015 03:13:15 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.36 with SMTP id t4ls181256lal.99.gmail; Wed, 24 Jun 2015 03:13:15 -0700 (PDT) X-Received: by 10.112.24.233 with SMTP id x9mr40290752lbf.7.1435140795453; Wed, 24 Jun 2015 03:13:15 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id cy4si21635521lac.57.2015.06.24.03.13.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jun 2015 03:13:15 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by lagi2 with SMTP id i2so23041943lag.2 for ; Wed, 24 Jun 2015 03:13:15 -0700 (PDT) X-Received: by 10.112.155.197 with SMTP id vy5mr38868470lbb.29.1435140795337; Wed, 24 Jun 2015 03:13:15 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp3679451lbb; Wed, 24 Jun 2015 03:13:14 -0700 (PDT) X-Received: by 10.107.170.216 with SMTP id g85mr43649708ioj.31.1435140793807; Wed, 24 Jun 2015 03:13:13 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id g63si21305302ioj.58.2015.06.24.03.13.12 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 24 Jun 2015 03:13:13 -0700 (PDT) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Z7hfu-00059n-7W; Wed, 24 Jun 2015 10:12:58 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Z7hfs-00059h-GD for edk2-devel@lists.sourceforge.net; Wed, 24 Jun 2015 10:12:56 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of linaro.org designates 209.85.213.180 as permitted sender) client-ip=209.85.213.180; envelope-from=ard.biesheuvel@linaro.org; helo=mail-ig0-f180.google.com; Received: from mail-ig0-f180.google.com ([209.85.213.180]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1Z7hfr-0001mQ-B8 for edk2-devel@lists.sourceforge.net; Wed, 24 Jun 2015 10:12:56 +0000 Received: by igbqq3 with SMTP id qq3so110301146igb.0 for ; Wed, 24 Jun 2015 03:12:50 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.107.134.214 with SMTP id q83mr34684404ioi.91.1435140770058; Wed, 24 Jun 2015 03:12:50 -0700 (PDT) Received: by 10.36.138.69 with HTTP; Wed, 24 Jun 2015 03:12:50 -0700 (PDT) In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A111A851E1@shsmsx102.ccr.corp.intel.com> References: <1435047559-58044-1-git-send-email-yingke.d.liu@intel.com> <4A89E2EF3DFEDB4C8BFDE51014F606A111A85168@shsmsx102.ccr.corp.intel.com> <4A89E2EF3DFEDB4C8BFDE51014F606A111A851E1@shsmsx102.ccr.corp.intel.com> Date: Wed, 24 Jun 2015 12:12:50 +0200 Message-ID: From: Ard Biesheuvel To: "edk2-devel@lists.sourceforge.net" X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record -0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1Z7hfr-0001mQ-B8 Subject: Re: [edk2] [Patch 2/3] BaseTools: Update GenFw to support 4K alignment. X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 On 24 June 2015 at 10:26, Gao, Liming wrote: > Got your point. I agree with this change. We will include it in the patch and add you in Signed-off-by list. > OK, thanks. There is one additional issue though: when using alignment of > 4 KB, the GenFw tool may crash, since it tries to pad out the .reloc section up to section alignment, which may cover unmapped host memory. So something like below is needed, and MAX_COFF_ALIGNMENT needs to be set to some sensible but sufficiently high value. Since PE/COFF specifies 64 KB as the maximum file alignment, and GenFw uses mCoffAlignment for both SectionAlignment and FileAlignment, I suppose 64 KB would be appropriate here. """ """ diff --git a/BaseTools/Source/C/GenFw/ElfConvert.c b/BaseTools/Source/C/GenFw/ElfConvert.c index 1a84d3c28794..e315d913378d 100644 --- a/BaseTools/Source/C/GenFw/ElfConvert.c +++ b/BaseTools/Source/C/GenFw/ElfConvert.c @@ -96,11 +101,11 @@ CoffAddFixup( mCoffFile = realloc ( mCoffFile, - mCoffOffset + sizeof(EFI_IMAGE_BASE_RELOCATION) + 2*0x1000 + mCoffOffset + sizeof(EFI_IMAGE_BASE_RELOCATION) + 2 * MAX_COFF_ALIGNMENT ); memset ( mCoffFile + mCoffOffset, 0, - sizeof(EFI_IMAGE_BASE_RELOCATION) + 2*0x1000 + sizeof(EFI_IMAGE_BASE_RELOCATION) + 2 * MAX_COFF_ALIGNMENT ); mCoffBaseRel = (EFI_IMAGE_BASE_RELOCATION*)(mCoffFile + mCoffOffset);