From patchwork Thu Nov 30 23:39:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 10085801 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 E5105602BC for ; Thu, 30 Nov 2017 23:40:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D71DA2A425 for ; Thu, 30 Nov 2017 23:40:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CBBF32A426; Thu, 30 Nov 2017 23:40:47 +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 7F9C22A423 for ; Thu, 30 Nov 2017 23:40:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751740AbdK3Xkd (ORCPT ); Thu, 30 Nov 2017 18:40:33 -0500 Received: from mail-it0-f67.google.com ([209.85.214.67]:42625 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750890AbdK3XjN (ORCPT ); Thu, 30 Nov 2017 18:39:13 -0500 Received: by mail-it0-f67.google.com with SMTP id p139so522505itb.1 for ; Thu, 30 Nov 2017 15:39:13 -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=X2C3Kj445Hgs2TIxnFf0dzQnNDJbXNMWYFw8Mz4kw1NHhmCHQh9efktR2nRueYgWnH P5PXjRDbCt2HG3NkPQ5qHEFiXYVhchqr8bBaH95Ic7eezz1lSg5KzGHSVqwOePluNzG0 ztQuLsgunJi4sGA9eUJgbt5VzGuZ+mtC+34kyIuJuY6BDwuGUAxniU0i8FXsEh2eYY83 nIn+PmDmtSVkq48E7TNbC6+BziRJ561Csx/DRiIAbpWBrSnnMG83/Fsg3OsN8UP47a2Z CEzdf4qz8ZCB56JHQcnMBrMQtnMkn+fNFofV2azkBIMNSOLnpp4JmVOoSRss24uMw8sm mfSA== 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=BhF/+21Tn+Tjl1aJx7TdC+nUHKe1D+6HK8L0WqMTNaRHq7mIGXE7qtA/um/U/Ac05I Oye1VwDobdYI2uC4tRiYmdiTI+O+7TssLNQgD511y4gxDCj9iLAi+5PNFV18E3E5XDt5 1kCdhx5bP3xM9QdMhUHJiq6AqutI4FAdTa5BqAJOQv0wWGfk+2gsfoPAsKwkTIPqRSXE LqfdB1kVGQVaok6LpaKo30b//ds2hER77tnWjm1DWcv+9llKEMRrAnMoT/j09hmbZeHm Mt25vhcGYnUS/dHfmvyr8acvIVnoj617Q7BgujDO93P11ox647A0w9Y+zTOErV3oQyEz jIsg== X-Gm-Message-State: AJaThX64LQllSGwYzKMNc3dt0H0PZCJMgEUY75BgI27ZAuxScLjXzlVM pKKJsTEs1R5suX2VFDuvS930jQ== X-Google-Smtp-Source: AGs4zMaXWd4c2ASmIXF7if1R0phX1uHuXPU+Y13xxBroyZXb4IS+d1k6beHK0byOG4ftYiLbaaTChQ== X-Received: by 10.36.61.79 with SMTP id n76mr6063773itn.143.1512085152543; Thu, 30 Nov 2017 15:39:12 -0800 (PST) Received: from samitolvanen.mtv.corp.google.com ([100.98.112.14]) by smtp.gmail.com with ESMTPSA id h73sm2896676itb.21.2017.11.30.15.39.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Nov 2017 15:39:11 -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 v2 2/7] arm64: keep .altinstructions and .altinstr_replacement Date: Thu, 30 Nov 2017 15:39:00 -0800 Message-Id: <20171130233905.130602-3-samitolvanen@google.com> X-Mailer: git-send-email 2.15.0.531.g2ccb3012c9-goog In-Reply-To: <20171130233905.130602-1-samitolvanen@google.com> References: <20171129234442.655-1-samitolvanen@google.com> <20171130233905.130602-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);