From patchwork Wed Nov 15 21:34:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 10060401 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 5574F6056E for ; Wed, 15 Nov 2017 21:40:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45E3A2A2AE for ; Wed, 15 Nov 2017 21:40:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3AC0A29F30; Wed, 15 Nov 2017 21:40:50 +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 E50122A2AE for ; Wed, 15 Nov 2017 21:40:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759483AbdKOViW (ORCPT ); Wed, 15 Nov 2017 16:38:22 -0500 Received: from mail-io0-f195.google.com ([209.85.223.195]:43762 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759102AbdKOVex (ORCPT ); Wed, 15 Nov 2017 16:34:53 -0500 Received: by mail-io0-f195.google.com with SMTP id 189so3074869iow.10 for ; Wed, 15 Nov 2017 13:34:53 -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=J4a6XjdTftLUMnJbWFDNn61nLbuSomwTHle/6oFe2bI=; b=hKc82Van8inNUrTlYsUwS3QmOO6k5fiaa0MJTJNL6wVlBTfFxhQLnxkgUSGEwWLLXl 3CR7zADss6cvP31rHX9E0SL5C0XQvBp5n6HmaT9kU4gfC0ernZRQKCtB53mawtwhYFuP /2pQAikL+E8JWL0yG3MIghAokmcrgsAK5IwCUrnKHOqd8lMkkkU2Gi0HtKWBBPzBM4TK CASL0ROYf1Pb/2rjpI1NJLfDYFqI50ACouKCOxB6xMQY0djUaF4InbxW/+K5tKR+DDWc RR3xhXDLk3NQoIHxZrjIzRiPbrGjRjdVZJdeh1qI3OS6PxBAM3F8hxupzjGPCaEL6rjD bbPQ== 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=J4a6XjdTftLUMnJbWFDNn61nLbuSomwTHle/6oFe2bI=; b=CpHkhj6N498jUF6FyQehChjUlvmPxVzhqJGoTZMoJ5NdPjJdRmLyiF4b2CEFuPQ3qT qpSN+YfNb2MSpwNPk3mTpIB5OlOyCHSQ6J8gGmboDG4XJrVAasELzP02EZ5p/YcQ/A37 ZE3clgbMOLH1WO4Niedy7qhFv33kXKII3XJJjqtvhd7hVkpo1msqfZBmQNVPngXUiqwN ZAblB69YrKLsi+oQza3K0cd3MH0MBBcn3yucT83cOWCNff7VSvze9tyrPrwq/JYXEqlB fe24HHMXOm0ty52v/xNmJ5aX8SpgSKOOyGbVvSiAqyesPTLCWsBW9g+ClxXLOJOs+ws6 XdAw== X-Gm-Message-State: AJaThX75lEI513hMfkv9OU5fsGVzkXv4b/355lwGNhAWQFge4Rp4M2Tc QT3SweilLM9pP0eBmb8K9m6AKw== X-Google-Smtp-Source: AGs4zMb0kFRZzIRRPnFs3sts+Umqs6UbXh3NEpptmNx7EqoNFeK4F8T5T9NNJ5ELGdi3aWsn7MexJQ== X-Received: by 10.107.38.79 with SMTP id m76mr21054915iom.187.1510781692765; Wed, 15 Nov 2017 13:34:52 -0800 (PST) Received: from samitolvanen.mtv.corp.google.com ([100.98.112.14]) by smtp.gmail.com with ESMTPSA id 68sm9735197iov.2.2017.11.15.13.34.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Nov 2017 13:34:51 -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 Cc: Sami Tolvanen Subject: [PATCH v2 07/18] arm64: keep .altinstructions and .altinstr_replacement Date: Wed, 15 Nov 2017 13:34:17 -0800 Message-Id: <20171115213428.22559-8-samitolvanen@google.com> X-Mailer: git-send-email 2.15.0.448.gf294e3d99a-goog In-Reply-To: <20171115213428.22559-1-samitolvanen@google.com> References: <20171115213428.22559-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);