From patchwork Tue Nov 6 13:40:09 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: 10670435 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 210D415A6 for ; Tue, 6 Nov 2018 13:41:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DACB2A3D7 for ; Tue, 6 Nov 2018 13:41:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3C132A3E5; Tue, 6 Nov 2018 13:41:02 +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 B02D72A3D7 for ; Tue, 6 Nov 2018 13:41:02 +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:Cc: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:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Hu2ThfEnRRx1Fns11FOzLUawfzKfuN/OKb0Kvmd15V0=; b=PSX+2FI8mewhCx +kvJuol/OJwPtoQDtukLgPMR14f/zNPqTzzuEJd1iqx+wR4rKcXVWTwIFUs94fMYamJX5NEIscna/ M+nlndo5wNDMmCrAHVXuoK/JCRx08pHCaGbj6Qe6VHlqtE+Ui3f789UB98wejaSD19jOL+6CLwzpg 714yPljtfG398IQcwU3fhpqSKIoe5XWI4DEiHVslFH62ZaQ1aXJUgstK+vKieTvjVueWfu0hr9lmE rGzTc8Tv4ec9nnRcbOZ9bh/izWIy15iQOi4ysSlAkK5pOLnVUmEovyDZhhwbGCJd2ts9Ry+QlhjFK LWqfZRrpXhb6LFb15IOA==; 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 1gK1bB-00080f-FK; Tue, 06 Nov 2018 13:40:53 +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-0006sw-JJ for linux-arm-kernel@lists.infradead.org; Tue, 06 Nov 2018 13:40:28 +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:Cc:To:From:References: In-Reply-To:Reply-To: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=XcPKD+tHKP9BNW9mU+aXn5gFK9PCl/U9X9RkBSBYolg=; b=pV4iMWIO8xWzZIdk6ai/CyOUaQ GJzDYGVA2QnK+TUjECwlTEzl3+ssmh1oK/X+PdNhKzGuQWisW/+I/7BwVZU1LXoih96leWqXxDcaY 2VM/b6OUVswa7zw1mC06FkFxfDX4jpKaSegvvMGqdrwO2zjM1rjXa8T0ccqnaDP+FnJY=; Received: from e0022681537dd.dyn.armlinux.org.uk ([2002:4e20:1eda:1:222:68ff:fe15:37dd]:44126 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 1gK1aU-0000ZJ-9M; Tue, 06 Nov 2018 13:40:10 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1gK1aT-0000oL-Nn; Tue, 06 Nov 2018 13:40:09 +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 1/4] EFI stub: remove -fdata-sections MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 06 Nov 2018 13:40:09 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181106_054026_231274_2C11201B X-CRM114-Status: GOOD ( 10.96 ) 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: linux-efi@vger.kernel.org, Ard Biesheuvel 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 Remove -fdata-sections from the EFI stub build as this causes problems for the ARM decompressor code. Signed-off-by: Russell King Acked-by: Ard Biesheuvel --- drivers/firmware/efi/libstub/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile index c51627660dbb..98133d0577ab 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile @@ -15,7 +15,7 @@ cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ -O2 \ # disable the stackleak plugin cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) -fpie \ $(DISABLE_STACKLEAK_PLUGIN) -cflags-$(CONFIG_ARM) := $(subst -pg,,$(KBUILD_CFLAGS)) \ +cflags-$(CONFIG_ARM) := $(filter-out -pg -fdata-sections,$(KBUILD_CFLAGS)) \ -fno-builtin -fpic \ $(call cc-option,-mno-single-pic-base) 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 = .; \ From patchwork Tue Nov 6 13:40:20 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: 10670431 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 3982813BF for ; Tue, 6 Nov 2018 13:40:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 270EF2A167 for ; Tue, 6 Nov 2018 13:40:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 152CD2A3C5; Tue, 6 Nov 2018 13:40:31 +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 89C2A2A167 for ; Tue, 6 Nov 2018 13:40:30 +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=ru96KLuyabv18ucbpQhxOcva4IqGVMG+gMoBgr+ayvc=; b=e4EfUp23xr/9Lc 95c9OrChb6D28RhxJvSZk0+Q1vzTAH0UkITXO/wK8wzXn+zjFYnF8vSysiMyct1SNAfDzIEcBUFlc NltN/yCzkgtQLonuqjBRBVjz/ZWGJujsCIF5+Xy7b39SM6jz1ztgyYVvxQPS4BdVeoRZFe9gBcsVQ urCHiScMJXPouq0t5FRAH7herlZZIS7FpPtVNy3D1EsYkO9h/Dkb2jk2G7ssQ/CRCfrXeWGFYw2IG 3ftUJFmxSgSAJcvQZxd/P6uqLErjJW3jt3Iu6IFtqiM+6lIAstx4YI+45cI979/9sRsWyw2723E55 pP4C9YJ/fTiFR8WwZC9A==; 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 1gK1an-0007aY-Jp; Tue, 06 Nov 2018 13:40:29 +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-0007Yu-JN 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=FZ1RCUBnPUD71S308bYoSuEsiW59Kkjg1zD2+QpgbAk=; b=V/Q29Ki+TrQ+utON8vwK4W36FE zX5O2aOgqpt1vjcqS9KDYW+I1dKJzZkAvQB/XfQSNIIF3POhtmYsqfFl9QUdHCLuu7RXQrWVEj+id CHTtZj7iqD/O+CkiwmCfiHkO1am079AkgaMHKXAyYiZRdqS/3Mdr00+HbPu/zwliVjE0=; Received: from e0022681537dd.dyn.armlinux.org.uk ([2002:4e20:1eda:1:222:68ff:fe15:37dd]:44130 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 1gK1af-0000ZX-00; Tue, 06 Nov 2018 13:40:21 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1gK1ae-0000or-7R; Tue, 06 Nov 2018 13:40:20 +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 3/4] ARM: merge -fdata-sections BSS data to .bss section MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 06 Nov 2018 13:40:20 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181106_054026_228600_0ACED786 X-CRM114-Status: GOOD ( 12.10 ) 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 When building with -fdata-sections, the BSS data is placed into separate sections, so we need to ask the linker to group these together into the .bss output section, so that they're correctly placed. Signed-off-by: Russell King --- arch/arm/boot/compressed/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/compressed/vmlinux.lds.S b/arch/arm/boot/compressed/vmlinux.lds.S index 2b963d8e76dd..3b91bc3c606f 100644 --- a/arch/arm/boot/compressed/vmlinux.lds.S +++ b/arch/arm/boot/compressed/vmlinux.lds.S @@ -118,7 +118,7 @@ SECTIONS . = BSS_START; __bss_start = .; - .bss : { *(.bss) } + .bss : { *(.bss) *(.bss.*) } _end = .; . = ALIGN(8); /* the stack must be 64-bit aligned */ From patchwork Tue Nov 6 13:40:25 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: 10670437 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 8BE8713BF for ; Tue, 6 Nov 2018 13:41:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7BCC62A3D7 for ; Tue, 6 Nov 2018 13:41:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 706442A3E5; Tue, 6 Nov 2018 13:41:11 +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 1F3332A3D7 for ; Tue, 6 Nov 2018 13:41:11 +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=j3GS5jurY94k+S9LAzIN0JJ7L1Obqafl8PsWKGgTtEo=; b=KLHH3y+BiYuH6c 30ugxuQNx8Xx4aNF63foCqpjHmF9FDkLMstSLfD0p1DxeJqaYRz7jnxI407arT7wM5s2819IQ1kr2 FJ2GZ/FoHcraLgaWigpEEImaK39c+NAE1GrDh6B/q3w3wPFOfPO76/eFSWV33ZgMIUhULFLstF1GF cYqb3RHXVrIZGsoC08Y3dj/az1osZmbA1ARNQqntrRwSO/WqYuS1n5+RGVXs2RmVuVJLwWTyeH6Fm SHBeL7FB5FqY5b0/krJjCV0QWdheTOdJhhAVTHLbU5LTpPSKWxI7s6kFxzsduvqBWLAkwipOU8ON3 kBsoB932VzJ1nbSfR+8w==; 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 1gK1bP-0008G6-J7; Tue, 06 Nov 2018 13:41:07 +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 1gK1az-0007aQ-5A for linux-arm-kernel@lists.infradead.org; Tue, 06 Nov 2018 13:40:44 +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=sZqPSgQi4CFT/ndAgv/P630XSdCrU/lQK+XhCYrYTXY=; b=H3TrHO6PD6J26rgxcXLJq66G4U pSvXTzPhURsc7blff1pSgseJq8co0b8R3Y9Azxg5WmnFso87m+/8ypUcE5YvnzcEjxbC1C+JbGDdQ 2luuXKQuKk6qRzffXRxVmQOAFZWpk5+JeTNTnt6D2cOBpDptoI0YHbl7TSW6TmHlA2Fo=; Received: from e0022681537dd.dyn.armlinux.org.uk ([2002:4e20:1eda:1:222:68ff:fe15:37dd]:44132 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 1gK1ak-0000Zd-B2; Tue, 06 Nov 2018 13:40:26 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1gK1aj-0000p7-Ic; Tue, 06 Nov 2018 13:40:25 +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 4/4] ARM: enable LD_DEAD_CODE_DATA_ELIMINATION MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 06 Nov 2018 13:40:25 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181106_054041_415485_8F569C07 X-CRM114-Status: UNSURE ( 9.93 ) 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: , 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 Enable LD_DEAD_CODE_DATA_ELIMINATION, which allows functions that are not called to be eliminated from the final kernel image. Signed-off-by: Russell King --- arch/arm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 91be74d8df65..f7f65d0d5a05 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -82,6 +82,7 @@ config ARM select HAVE_KERNEL_XZ select HAVE_KPROBES if !XIP_KERNEL && !CPU_ENDIAN_BE32 && !CPU_V7M select HAVE_KRETPROBES if (HAVE_KPROBES) + select HAVE_LD_DEAD_CODE_DATA_ELIMINATION if !FUNCTION_TRACER select HAVE_MOD_ARCH_SPECIFIC select HAVE_NMI select HAVE_OPROFILE if (HAVE_PERF_EVENTS)