From patchwork Wed Nov 29 23:44:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 10083921 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AE2096020B for ; Wed, 29 Nov 2017 23:45:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FFCD29C84 for ; Wed, 29 Nov 2017 23:45:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93F8C29D57; Wed, 29 Nov 2017 23:45:55 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4288F29C84 for ; Wed, 29 Nov 2017 23:45:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752711AbdK2Xpl (ORCPT ); Wed, 29 Nov 2017 18:45:41 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:42915 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753252AbdK2XpA (ORCPT ); Wed, 29 Nov 2017 18:45:00 -0500 Received: by mail-pg0-f66.google.com with SMTP id e14so2203742pgr.9 for ; Wed, 29 Nov 2017 15:45:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CnwkSSWhfeGzNXASeyrtpl2IK99jdD4on9+ne+YHQDg=; b=JgRGG37ci8LbHAWVwuKHBIX3DuDKlsYQoWfO0fMtSW8TfqUCrnwW/QY6GU9rHQ88wj 30SV0QLMnZsBpJ27F8A26lxnn3dMSG+SP25f9Rb+opyk/rTh4gLwwFXjolRQbC4HPoKl PIe6bFpRQ5q8BEcRF+6l/oJosPAqq5M2w9q6fjh6q7WhYU/cin5xVVfXyTNg11UnCHOL GMegH51PiM1mtdOlAcDN5n5hj5sP0ujYun9D5Ud3rTf8lAZGKTWruVO9kz70SmR8bUi2 heuZqc1Z5uxCbusdZQ8YVFzG1kGmfbujdRvwSNEgsvKl4TUGAKqBdTtWie0j0sKl5yp7 yKuQ== 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; bh=CnwkSSWhfeGzNXASeyrtpl2IK99jdD4on9+ne+YHQDg=; b=c0nd5pc1TxVTZoLvewYvE3MP75KfK90rTcC4xzWGFVdRnmZwUh8PM3XNAa9knLSbMY pcLslKMmDBNOzcH83n8M6nVAVdBuD7Ofzbb/FCq4EYwW29xJ0X6qsuGo2HS4l0KZJTDd vV8QkpyInmU0IDFDBbIZ1rxhMr7OAUGDZVgP8mWacQnWvAl/xq5VHO4MNELColCs2yOV mU+0MfEWLGY0iHses5M56DNPEyM/fDZkY+kYC2XHQNxNURWYJ30jRy8dRtwyqv//HQZl iuC2EKbShO5nhCEzKedzRygHGPZSPohPFKMvoDhbPOQm3SNNzIuOOEUVvk6TzC3rAiVr pyUQ== X-Gm-Message-State: AJaThX4hUqg17HnWHOJ/Ekpz9r/DdO6izbfsmjAirJlpL0LcxrF3/nru psSBJ1wPRP0G10SfxrxA4DoE/g== X-Google-Smtp-Source: AGs4zMYGztAezKJw4GoA8AtL8XiPWryNdiSCzUMydIrXFuvQPnM2gYBmCBqXH2eyAL/WozJCX9vXVA== X-Received: by 10.99.3.88 with SMTP id 85mr566591pgd.111.1511999099487; Wed, 29 Nov 2017 15:44:59 -0800 (PST) Received: from samitolvanen.mtv.corp.google.com ([100.98.112.14]) by smtp.gmail.com with ESMTPSA id s14sm5326948pfe.36.2017.11.29.15.44.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Nov 2017 15:44:58 -0800 (PST) From: Sami Tolvanen To: Alex Matveev , Andi Kleen , Ard Biesheuvel , Greg Hackmann , Kees Cook , linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Rutland , Masahiro Yamada , Maxim Kuvyrkov , Michal Marek , Nick Desaulniers , Yury Norov , Matthias Kaehlcke , Nicholas Piggin Cc: Sami Tolvanen Subject: [PATCH 5/7] arm64: keep .altinstructions and .altinstr_replacement Date: Wed, 29 Nov 2017 15:44:40 -0800 Message-Id: <20171129234442.655-6-samitolvanen@google.com> X-Mailer: git-send-email 2.15.0.531.g2ccb3012c9-goog In-Reply-To: <20171129234442.655-1-samitolvanen@google.com> References: <20171129234442.655-1-samitolvanen@google.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make sure the linker doesn't remove .altinstructions or .altinstr_replacement when CONFIG_LD_DEAD_CODE_DATA_ELIMINATION is enabled. Signed-off-by: Sami Tolvanen --- arch/arm64/kernel/vmlinux.lds.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index 7da3e5c366a0..15479995869c 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -138,11 +138,11 @@ SECTIONS . = ALIGN(4); .altinstructions : { __alt_instructions = .; - *(.altinstructions) + KEEP(*(.altinstructions)) __alt_instructions_end = .; } .altinstr_replacement : { - *(.altinstr_replacement) + KEEP(*(.altinstr_replacement)) } . = ALIGN(PAGE_SIZE);