From patchwork Mon Nov 5 19:43:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 10669081 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D36E15A6 for ; Mon, 5 Nov 2018 20:19:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FF5C29E67 for ; Mon, 5 Nov 2018 20:19:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 511ED29E6A; Mon, 5 Nov 2018 20:19:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 02A0829E67 for ; Mon, 5 Nov 2018 20:19:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=v8HNEAD14JMeww6mJLZpedFAXRiUJAf72Mrfh0vAXJE=; b=FnIfW7SSVxUgmF wXxzyGPeCR/8BVYroBvfOyNccCbZAkYHWtGSJkYWUh7biv1GBuVGg47gQXIYgt1YyYKopGanstalo sZ68E5FTZRnRzuM88NbbHIP1QZQyJBAhnbRxFqBrxjcqIeqns/3qnu9oZ5y+P/UuWkxwSbRQE1KrX ytLHWVAilwChVN9j95Je87aOL8RBhHfJ57FYCT8qxRV5774B1s1Yo4IoaVW5On2JqC62NZvo5P9aQ 6qKnzYo+QxgoiZcmbqXgMj5KNVH4i/UKgPVbeY/ql0Sx6p2OKYSz9wmP4N3XBAmHj9t9118tDwqce PYwP92oa7mAvKywguG0Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJlLV-0003yw-9j; Mon, 05 Nov 2018 20:19:37 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJkmi-0008OG-MA for linux-arm-kernel@lists.infradead.org; Mon, 05 Nov 2018 19:44:23 +0000 Received: by mail-wm1-x344.google.com with SMTP id r63-v6so9585769wma.4 for ; Mon, 05 Nov 2018 11:43:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qz51bdv/HHnrSGyy6uFm2oY+i4ALh13Ft4T3uuUX5n0=; b=V5LuassT7mG5IPEGSZ7am7mp38K+nAnbYxYZh2OqG1yeJu+ofAN0ltMNMV/oxaiUn2 mCkxdcA3rK4fHx4hp8TbMxLTe+v6Fzy1GJyxwhRmEQ3c3R8byEHCa6ydJrDHixSkq5ml ypdt04tb6NL/fMN2rfAO+uKCkIm+yz8KUU34Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qz51bdv/HHnrSGyy6uFm2oY+i4ALh13Ft4T3uuUX5n0=; b=WrV38DgMYC1sdYS4alT0yTDPLXQGmsJSfP6k0SWUlX+VrHrfMVLzQew5bgRtgcq4vb W/BIYehugP8J7Xpwk09/xW9uB7k7K4llGWHw20ywQtVqXjdQ674/uGQvI7F2V1Lx7DLo hVJHkalqyuwRkrTzJ9cPLHynt3LGBvaAG1flhwskla649MyGKk0uPyS1Gm23JQaDm5es ag9KhGr//qmWcpGGOlx1UJf2YaCXzu8UH8Po0F7jQV3IWuY5wHzr0XpfXCZeE20fXlgR WUGX8BRjeVz/OmeGavlupUdcGlS8sfWPm8m72odYndryL5q23tfx6mY1ZGMSsKcrKzEc Q0dg== X-Gm-Message-State: AGRZ1gKVbUoKz46LX3ip/zvyGkZp9kM22JsDRXvFCKsluXvNHAMQQys7 ZegxIUlbm0pWjE8cNSgMNWh4Kd0uZsQ= X-Google-Smtp-Source: AJdET5ft7HN/hy1TfiCrrylt/9Cn1+LyQ3TylBJTlLVl/7xUYznUWQGBIA3/P1/pX3+zrqgurKMDPg== X-Received: by 2002:a1c:930d:: with SMTP id v13-v6mr2711939wmd.26.1541447006108; Mon, 05 Nov 2018 11:43:26 -0800 (PST) Received: from harold.home ([2a01:cb1d:112:6f00:3117:2b29:5ef7:a9e5]) by smtp.gmail.com with ESMTPSA id x197-v6sm45518322wme.15.2018.11.05.11.43.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 11:43:25 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 1/2] ARM: compressed: put zImage header and EFI header in dedicated section Date: Mon, 5 Nov 2018 20:43:20 +0100 Message-Id: <20181105194321.26657-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181105194321.26657-1-ard.biesheuvel@linaro.org> References: <20181105194321.26657-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181105_114359_682734_3DCF7A8A X-CRM114-Status: GOOD ( 14.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nicolas.pitre@linaro.org, linux@armlinux.org.uk, Ard Biesheuvel Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP To align the PE/COFF and the ELF headers of the decompressor binary, put the zImage header and the EFI header in a separate .header section, and emit it at the start of the Image. This change is necessary for UEFI based debug tooling to be able to use the vmlinux ELF binary, since it gets confused if the PE/COFF .text section and the ELF .text section live at different offsets. Signed-off-by: Ard Biesheuvel --- arch/arm/boot/compressed/head.S | 4 +++- arch/arm/boot/compressed/vmlinux.lds.S | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index 6c7ccb428c07..261128840596 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -143,7 +143,7 @@ #endif .endm - .section ".start", #alloc, #execinstr + .section ".header", #alloc, #execinstr /* * sort out different calling conventions */ @@ -176,6 +176,8 @@ start: .word _magic_table @ additional data table __EFI_HEADER + + .section ".start", #alloc, #execinstr 1: ARM_BE8( setend be ) @ go BE8 if compiled for BE8 AR_CLASS( mrs r9, cpsr ) diff --git a/arch/arm/boot/compressed/vmlinux.lds.S b/arch/arm/boot/compressed/vmlinux.lds.S index 2b963d8e76dd..94738ca5405a 100644 --- a/arch/arm/boot/compressed/vmlinux.lds.S +++ b/arch/arm/boot/compressed/vmlinux.lds.S @@ -34,8 +34,11 @@ SECTIONS . = TEXT_START; _text = .; - .text : { + .header : { _start = .; + *(.header) + } + .text : { *(.start) *(.text) *(.text.*)