From patchwork Fri Oct 10 09:25:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 38546 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C1639205D8 for ; Fri, 10 Oct 2014 09:28:03 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id w7sf1857302lbi.2 for ; Fri, 10 Oct 2014 02:28:01 -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:from:to:subject:date:message-id:cc :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=8Bk8mDjnH8r8eF8+vB/gGPYM4EXiWqUrH+Lk4/DACFc=; b=iXOk/dwDseXKmdfVImRW/UaLVO25ohZ81/su/YzvopPTU5flTVwNDf7Ez6wGl2YMMQ RRERMnadF6z8PbCKtJkg6gVKe4Pd1teDxqaKsRzvxi6x6BZWJKGkVWJe0U95sCwIZVl6 Gw55SH6jFFKtSsbGhclWwEOhYRMeWVImFyJblfjQGbZuKd8GEp7AECcT1qkNhjDy/Gm4 VEoDmgzvk9xed/mnBCR5GSxUF7by5/j4EVV2EpRiqsVNe/cqmu7daqAjUjre0XEftXye XLGWYC8SwYDpmRTgyZRdf/7emXkrIan57zs36plhmvMN1ghN/B3wO9sUfAt7wTyq7+LF V6AQ== X-Gm-Message-State: ALoCoQnEbAom+xsRgz/sqw3k5uATozX0SPG3Zf0a+LWZvNZIp5xpcF9oixQeKIuuH0dehwv8Bfps X-Received: by 10.180.8.197 with SMTP id t5mr799584wia.5.1412933281765; Fri, 10 Oct 2014 02:28:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.5.33 with SMTP id cj1ls240405lad.48.gmail; Fri, 10 Oct 2014 02:28:01 -0700 (PDT) X-Received: by 10.153.4.11 with SMTP id ca11mr3537902lad.24.1412933281476; Fri, 10 Oct 2014 02:28:01 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com [209.85.215.49]) by mx.google.com with ESMTPS id r1si8234523lar.58.2014.10.10.02.28.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Oct 2014 02:28:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id q1so2864535lam.36 for ; Fri, 10 Oct 2014 02:28:00 -0700 (PDT) X-Received: by 10.153.6.36 with SMTP id cr4mr3522380lad.40.1412933280280; Fri, 10 Oct 2014 02:28:00 -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.84.229 with SMTP id c5csp388684lbz; Fri, 10 Oct 2014 02:27:59 -0700 (PDT) X-Received: by 10.68.139.232 with SMTP id rb8mr3924705pbb.20.1412933278633; Fri, 10 Oct 2014 02:27:58 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id zy8si3171880pbc.39.2014.10.10.02.27.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Oct 2014 02:27:58 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XcWSY-0007VX-7i; Fri, 10 Oct 2014 09:26:02 +0000 Received: from mail-wi0-f181.google.com ([209.85.212.181]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XcWSS-0007IM-Td for linux-arm-kernel@lists.infradead.org; Fri, 10 Oct 2014 09:25:57 +0000 Received: by mail-wi0-f181.google.com with SMTP id hi2so1413060wib.8 for ; Fri, 10 Oct 2014 02:25:33 -0700 (PDT) X-Received: by 10.180.94.163 with SMTP id dd3mr3460581wib.31.1412933133846; Fri, 10 Oct 2014 02:25:33 -0700 (PDT) Received: from ards-macbook-pro.local (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id di1sm1951000wib.21.2014.10.10.02.25.32 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Oct 2014 02:25:33 -0700 (PDT) From: Ard Biesheuvel To: leif.lindholm@linaro.org, roy.franz@linaro.org, will.deacon@arm.com, mark.rutland@arm.com, matt.fleming@intel.com, linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, msalter@redhat.com Subject: [PATCH] arm64/efi: set PE/COFF section alignment to 4 KB Date: Fri, 10 Oct 2014 11:25:24 +0200 Message-Id: <1412933124-13018-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141010_022557_143501_4A43235F X-CRM114-Status: GOOD ( 10.29 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.181 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.212.181 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Ard Biesheuvel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org 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.49 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 Position independent AArch64 code needs to be linked and loaded at the same relative offset from a 4 KB boundary, or adrp/add and adrp/ldr pairs will not work correctly. (This is how PC relative symbol references with a 4 GB reach are emitted) We need to declare this in the PE/COFF header, otherwise the PE/COFF loader may load the Image and invoke the stub at an offset which violates this rule. Signed-off-by: Ard Biesheuvel Reviewed-by: Roy Franz --- arch/arm64/kernel/head.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index 0a6e4f924df8..5e83e5b8a9de 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S @@ -159,7 +159,7 @@ optional_header: extra_header_fields: .quad 0 // ImageBase - .long 0x20 // SectionAlignment + .long 0x1000 // SectionAlignment .long 0x8 // FileAlignment .short 0 // MajorOperatingSystemVersion .short 0 // MinorOperatingSystemVersion @@ -226,7 +226,7 @@ section_table: .short 0 // NumberOfRelocations (0 for executables) .short 0 // NumberOfLineNumbers (0 for executables) .long 0xe0500020 // Characteristics (section flags) - .align 5 + .align 12 #endif ENTRY(stext)