From patchwork Fri Aug 5 12:12:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 656187 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3s5QtW1HLrz9snm for ; Fri, 5 Aug 2016 22:22:43 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=hr61ob+K; dkim-atps=neutral Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3s5QtV6qX5zDrQY for ; Fri, 5 Aug 2016 22:22:42 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=hr61ob+K; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pa0-x243.google.com (mail-pa0-x243.google.com [IPv6:2607:f8b0:400e:c03::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3s5QgV2pwMzDqCb for ; Fri, 5 Aug 2016 22:13:10 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=hr61ob+K; dkim-atps=neutral Received: by mail-pa0-x243.google.com with SMTP id cf3so19184904pad.2 for ; Fri, 05 Aug 2016 05:13:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=r3beFnfRwLi6HX5T8X/PTEDWwOt33IubTd24qxYrIug=; b=hr61ob+KFslUQZ7P/CxC6NbQtwtQKpS7DiDBocRbLMVzqp5TExciP+JUG8U3sSbFrM WsDqmHqn8TFvZdXDR7JhY2jjXoBPUxNabOJ0T0K1XqHI3of0cglir+0Hp/EOlD/bkmQW nPZ0GJrU75c4tJokJeCvUQQQNh2p4NDKdI6zr4TFH5iv+8b3Bc8d8i99s1hB2tpHi9At 5//OyLYk6TkKiGKcl7m69w6tDI/VbtluHwijNrU9Q/1gcwBkKksk1mfWWMfoEzdBo3ib 6hrlqIbS3nwuMKdAgTNtP3T2zB2rwGfHQO7WnMb9RVlPra0EiFzzRh5+eEcriwzAg+ut V/3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=r3beFnfRwLi6HX5T8X/PTEDWwOt33IubTd24qxYrIug=; b=Y4dFLCcLxdIJ4WgQM5hzlh7uGHBs84cpDiiPJRHUhbf9cGT4na/NTvyiJKBuLgjpv2 QoqRBXECXXjPugMbhkey1zzhYaWgslsapPhMqmsgT35paNntUO9ONwHfswE/RnHIT53j Z97/V7ZqklRacheuandn/skQ6O4PxCioZK8/O0q/CGzozraue2ODtsXosDM3aDblWjXU I74JU+7uRdWGW8f9dxYQ/bJZde2a6UVDdr3bNwnHe4nPtoQP4+4PSYgzYgKAGBo1SpRA 0t18j2Kk3lBQerLUdGboFncxP7cRgt5+spwmhhN1XVx6tzZRmOtb3Vi4q3miqZDdudXA 4kXw== X-Gm-Message-State: AEkoousqxYeQ1trUB3L6mI+m+M4mfdlfe882afg9cBtNNTm82L0aaV4IHY3eUmJ79fQa0g== X-Received: by 10.66.236.39 with SMTP id ur7mr133808070pac.6.1470399186594; Fri, 05 Aug 2016 05:13:06 -0700 (PDT) Received: from roar.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id m65sm27669685pfg.79.2016.08.05.05.13.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Aug 2016 05:13:06 -0700 (PDT) From: Nicholas Piggin To: linux-kbuild@vger.kernel.org Subject: [PATCH 5/5] powerpc/64: use linker dce Date: Fri, 5 Aug 2016 22:12:03 +1000 Message-Id: <1470399123-8455-6-git-send-email-npiggin@gmail.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1470399123-8455-1-git-send-email-npiggin@gmail.com> References: <1470399123-8455-1-git-send-email-npiggin@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, Stephen Rothwell , Arnd Bergmann , Nicolas Pitre , Alan Modra , Nicholas Piggin , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" --- arch/powerpc/kernel/Makefile | 3 +++ arch/powerpc/kernel/vmlinux.lds.S | 2 +- arch/powerpc/platforms/Kconfig.cputype | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index 2da380f..b356e59 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile @@ -4,7 +4,10 @@ CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' +ccflags-y += -fno-function-sections -fno-data-sections + subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror +subdir-ccflags-y += -fno-function-sections -fno-data-sections ifeq ($(CONFIG_PPC64),y) CFLAGS_prom_init.o += $(NO_MINIMAL_TOC) diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index 2dd91f7..c157b8d 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S @@ -50,7 +50,7 @@ SECTIONS HEAD_TEXT _text = .; /* careful! __ftr_alt_* sections need to be close to .text */ - *(.text .fixup __ftr_alt_* .ref.text) + *(.text .text.* .fixup __ftr_alt_* .ref.text) SCHED_TEXT LOCK_TEXT KPROBES_TEXT diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index 3c77091..6afeb9d 100644 --- a/arch/powerpc/platforms/Kconfig.cputype +++ b/arch/powerpc/platforms/Kconfig.cputype @@ -3,6 +3,7 @@ config PPC64 default n select HAVE_VIRT_CPU_ACCOUNTING select THIN_ARCHIVES + select LINKER_DCE select ZLIB_DEFLATE help This option selects whether a 32-bit or a 64-bit kernel