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: 10083941 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 6AAF960353 for ; Wed, 29 Nov 2017 23:47:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B1DD29C84 for ; Wed, 29 Nov 2017 23:47:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E63F29D55; Wed, 29 Nov 2017 23:47:17 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 42CE929C84 for ; Wed, 29 Nov 2017 23:47:16 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=pPLEs7l5l16hPK+DUhPfCyUNPuaaqnzIvPknYy83jaI=; b=SPB1wMuacOJlGqrtb/EJO8CwuW o4FzArQBbKRenpgkwz0jYHvvX4CDmMFI2K9V9qklYWb3lUNgngkJlun4drzKJl15cxQkOIB4JVTRr nBfZm8359t64wGodSrDtu6kCjjdAGvSijtKw2ichmGpmtgm9sej8fzX8hZM/gms8O5GIhgBs7xFQX fPVsSBfo8QeZzkmWJPplxp/IK4jBvB5XM6BmjHHly0euy4H7qURxSsyRKC5XxkGQxvtV00WHg8I30 e8/SQznAIPjfa3cEOfiiSjip+tMmKOzO88wOMwTqL0hWDWuSYxx/ozs4wVcKfBA7csIuDjo4mQNiv dbD4hphA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eKC4R-0006bc-JN; Wed, 29 Nov 2017 23:47:15 +0000 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eKC2a-0003aY-UX for linux-arm-kernel@lists.infradead.org; Wed, 29 Nov 2017 23:45:34 +0000 Received: by mail-pg0-x241.google.com with SMTP id k134so2212133pga.3 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=pNTpLsjM6wXNaFQxnuT4YNEhVLM1P3TTiR/mTzgpVsgCMYaUBkVv2D2JORIl5IIOIR o/g0xF/lNy2u52Aj6YN2SE5S2pquTEyxJOu/FwvhMDDB5oDJntOjOVPCIJjZtNSGTyz0 1W/2XCRkVPPgiss+JPr6T2704SKTahk15jIGzN+MjWkzvm4H4dJ0LKb/9I4SydRbmgcl 3B7azfYg3DndV4Nk6h+G1CAg7yHpTYECFVnVuRyDMCwwixSyuzm7rBjVCA0Pja+U6+PC 4KWlZGmB15k2bbDITPbu7Nwo0e2WulK5cH0R5mJ/SaXysDPjAHAqfs8PKUZYK82g7bsa v0lQ== X-Gm-Message-State: AJaThX6FhcYZwL2c7A8cKjcVI4x+6KYNRWzpsVwtKa72cuvKZN5GM6SM 1GSIII3KYARKlsNqpdznJdon1A== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171129_154521_450646_D769C4BB X-CRM114-Status: UNSURE ( 9.77 ) X-CRM114-Notice: Please train this message. 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: Sami Tolvanen MIME-Version: 1.0 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 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);