From patchwork Tue Nov 6 13:40:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 10670433 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 E52E413BF for ; Tue, 6 Nov 2018 13:40:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D334A2A167 for ; Tue, 6 Nov 2018 13:40:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5A6A2A3C5; Tue, 6 Nov 2018 13:40:39 +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 64C332A167 for ; Tue, 6 Nov 2018 13:40:39 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:To :From:References:In-Reply-To:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=moQfjpfU8bDUocE3NZrAG+BCj5Zal+/wR7qu0Gg52mc=; b=fnEcUjVxc/NX1i dn9xG22LXVZ9j0LVh3qQf/fb1J8p37LK9vVZo4fqbMj/Ga91DrNkjZQRIgZVwTp87mEgcOpzZ2P5n 8fY6hnfvpFKpCGZ/39gAZ2T7rNiyWM8ElHy4Pt1nJ7KkIArQh5mS0s9fqwLxwzYg92gbHFUMFJ8Zy TKpbVX+NsMGlfyn+Wz0HKw3CYW1N/NWJkUiAZGayb2B8qLzfib7fD6lTyO81quI65jhZNVnx03HIk nXVRXWFgOu9irsd+PDXKwEW/iQpaDPCk52BkqGP/ING781UZLakWLNTJWPGgnwmQ8aj3lcieDoZhr b0AcsuopF4rLxqCEQyhw==; 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 1gK1au-0007if-LO; Tue, 06 Nov 2018 13:40:36 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gK1aj-0007Y5-JH for linux-arm-kernel@lists.infradead.org; Tue, 06 Nov 2018 13:40:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:To:From:References:In-Reply-To :Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/fUR206LdGZyzY+YwaKFTRZCY3mmYI4kULYuSGVc8rE=; b=nilcmdlxOiNHB3ZpTSgRxr4NWJ 32D4zVVqwkT+Pxwa9senzN0jva2L0rGFlRKjqh1TRROJ9C9PROCdj+PftSCdCGv+i2mpxdp79hZBS qjN8/TKGMXAYn9hxClTWUSOn/ZyhdpIcDgVf8+1RduzVVNClbsu6faO09KPVFpUuF75I=; Received: from e0022681537dd.dyn.armlinux.org.uk ([2002:4e20:1eda:1:222:68ff:fe15:37dd]:44128 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1gK1aZ-0000ZR-PY; Tue, 06 Nov 2018 13:40:15 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1gK1aY-0000ob-RQ; Tue, 06 Nov 2018 13:40:15 +0000 In-Reply-To: <20181106133935.GB30658@n2100.armlinux.org.uk> References: <20181106133935.GB30658@n2100.armlinux.org.uk> From: Russell King To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/4] ARM: mark critical data with KEEP() MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 06 Nov 2018 13:40:14 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181106_054026_227452_2E21D89A X-CRM114-Status: GOOD ( 10.68 ) 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: , 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 In order for GC sections to work correctly, we need to instruct the linker to emit all input sections for entry paths and some linker built tables. Ensure that the vectors, tag table, CPU table, machine platform table, and exception tables are kept. Signed-off-by: Russell King --- arch/arm/kernel/vmlinux.lds.S | 10 +++++----- arch/arm/kernel/vmlinux.lds.h | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index 23150c0f0f4d..3da8db076761 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -73,7 +73,7 @@ SECTIONS . = ALIGN(4); __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { __start___ex_table = .; - ARM_MMU_KEEP(*(__ex_table)) + ARM_MMU_KEEP(KEEP(*(__ex_table))) __stop___ex_table = .; } @@ -100,24 +100,24 @@ SECTIONS } .init.arch.info : { __arch_info_begin = .; - *(.arch.info.init) + KEEP(*(.arch.info.init)) __arch_info_end = .; } .init.tagtable : { __tagtable_begin = .; - *(.taglist.init) + KEEP(*(.taglist.init)) __tagtable_end = .; } #ifdef CONFIG_SMP_ON_UP .init.smpalt : { __smpalt_begin = .; - *(.alt.smp.init) + KEEP(*(.alt.smp.init)) __smpalt_end = .; } #endif .init.pv_table : { __pv_table_begin = .; - *(.pv_table) + KEEP(*(.pv_table)) __pv_table_end = .; } diff --git a/arch/arm/kernel/vmlinux.lds.h b/arch/arm/kernel/vmlinux.lds.h index 8247bc15addc..a83d017f531c 100644 --- a/arch/arm/kernel/vmlinux.lds.h +++ b/arch/arm/kernel/vmlinux.lds.h @@ -28,22 +28,22 @@ #define PROC_INFO \ . = ALIGN(4); \ __proc_info_begin = .; \ - *(.proc.info.init) \ + KEEP(*(.proc.info.init)) \ __proc_info_end = .; #define HYPERVISOR_TEXT \ __hyp_text_start = .; \ - *(.hyp.text) \ + KEEP(*(.hyp.text)) \ __hyp_text_end = .; #define IDMAP_TEXT \ ALIGN_FUNCTION(); \ __idmap_text_start = .; \ - *(.idmap.text) \ + KEEP(*(.idmap.text)) \ __idmap_text_end = .; \ . = ALIGN(PAGE_SIZE); \ __hyp_idmap_text_start = .; \ - *(.hyp.idmap.text) \ + KEEP(*(.hyp.idmap.text)) \ __hyp_idmap_text_end = .; #define ARM_DISCARD \ @@ -64,7 +64,7 @@ #define ARM_TEXT \ IDMAP_TEXT \ __entry_text_start = .; \ - *(.entry.text) \ + KEEP(*(.entry.text)) \ __entry_text_end = .; \ IRQENTRY_TEXT \ SOFTIRQENTRY_TEXT \ @@ -86,12 +86,12 @@ . = ALIGN(8); \ .ARM.unwind_idx : { \ __start_unwind_idx = .; \ - *(.ARM.exidx*) \ + KEEP(*(.ARM.exidx*)) \ __stop_unwind_idx = .; \ } \ .ARM.unwind_tab : { \ __start_unwind_tab = .; \ - *(.ARM.extab*) \ + KEEP(*(.ARM.extab*)) \ __stop_unwind_tab = .; \ } @@ -102,14 +102,14 @@ #define ARM_VECTORS \ __vectors_start = .; \ .vectors 0xffff0000 : AT(__vectors_start) { \ - *(.vectors) \ + KEEP(*(.vectors)) \ } \ . = __vectors_start + SIZEOF(.vectors); \ __vectors_end = .; \ \ __stubs_start = .; \ .stubs ADDR(.vectors) + 0x1000 : AT(__stubs_start) { \ - *(.stubs) \ + KEEP(*(.stubs)) \ } \ . = __stubs_start + SIZEOF(.stubs); \ __stubs_end = .; \