From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBF9CC6778D for ; Tue, 11 Sep 2018 14:12:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8419720881 for ; Tue, 11 Sep 2018 14:12:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="TdhrL5fa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8419720881 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727870AbeIKTM0 (ORCPT ); Tue, 11 Sep 2018 15:12:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:58100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727332AbeIKTMZ (ORCPT ); Tue, 11 Sep 2018 15:12:25 -0400 Received: from devbox (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 316F42087F; Tue, 11 Sep 2018 14:12:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536675174; bh=gTe1iMOPu593mM02rGdDf4ypmzYMtTDYtv17nmGUKe4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TdhrL5fa7Wo6zU5D7QIm3715WUymd4gx8F0JdyMFwgOA16zZO9LExfmGP3MZqfK52 qtg7FT2Ku6Mh5kzgwoa1Qaqp0nAV/Ty+B3RwbHq2GyZfYPjrVz7vcu+LkynXSWh+GP pxt6cmfsdA2YGvxGX1p5T1QEVLXAwWW68Hu3JV3c= Date: Tue, 11 Sep 2018 23:12:51 +0900 From: Masami Hiramatsu To: Russell King Cc: Nicolas Pitre , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stephen Rothwell , Steven Rostedt , Linux-Next Mailing List , Arnd Bergmann , Peter Oberparleiter , Masami Hiramatsu Subject: Re: [PATCH] ARM: linker script: GCOV kernel may refers data in __exit Message-Id: <20180911231251.ee101eec63dceceed8243ad5@kernel.org> In-Reply-To: <153580549235.10130.1495077983569784123.stgit@devbox> References: <20180901185017.0a81bc3e61f5d021664f13f3@kernel.org> <153580549235.10130.1495077983569784123.stgit@devbox> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Please drop it, since Peter's patch fixes this problem better way. https://lkml.org/lkml/2018/9/6/403 Thank you, On Sat, 1 Sep 2018 21:38:13 +0900 Masami Hiramatsu wrote: > GCOV kernel embeds counters in the kernel for each line > and a part of that embed in __exit text. So we need to > keep the __exit text if CONFIG_GCOV_KERNEL=y. > > Without this patch, if we discards __exit text (e.g. > disables CONFIG_GENERIC_BUG, CONFIG_JUMP_LABEL and > CONFIG_SMP_ON_UP) but enables CONFIG_GCOV_PROFILE_FTRACE, > ld will error like below on ARM. > > `.text.exit' referenced in section `.ARM.exidx.text.exit' of > kernel/trace/trace_clock.o: defined in discarded section `.text.exit' > of kernel/trace/trace_clock.o > > To fix this issue, we keep __exit when CONFIG_GCOV_KERNEL=y. > > The reason why not depending CONFIG_GCOV_PROFILE_X, is > that the Documentation/dev-tools/gcov.rst says that the > developer can enable gcov profile on a file or a directory > by customizing Makefile, and that will only depend on > CONFIG_GCOV_KERNEL. > > Signed-off-by: Masami Hiramatsu > Reported-by: Arnd Bergmann > --- > arch/arm/kernel/vmlinux.lds.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/kernel/vmlinux.lds.h b/arch/arm/kernel/vmlinux.lds.h > index ae5fdff18406..baaacee9f5ce 100644 > --- a/arch/arm/kernel/vmlinux.lds.h > +++ b/arch/arm/kernel/vmlinux.lds.h > @@ -9,7 +9,8 @@ > #endif > > #if (defined(CONFIG_SMP_ON_UP) && !defined(CONFIG_DEBUG_SPINLOCK)) || \ > - defined(CONFIG_GENERIC_BUG) || defined(CONFIG_JUMP_LABEL) > + defined(CONFIG_GENERIC_BUG) || defined(CONFIG_JUMP_LABEL) || \ > + defined(CONFIG_GCOV_KERNEL) > #define ARM_EXIT_KEEP(x) x > #define ARM_EXIT_DISCARD(x) > #else > -- Masami Hiramatsu