Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp763762imm; Thu, 6 Sep 2018 09:44:14 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbThXuw8IfNbjhMooLeSBBw7c3J41fceS6rFM8jPa9pvBp6bDOQ777uNClJ952gS4/S0OBa X-Received: by 2002:a63:9809:: with SMTP id q9-v6mr3665378pgd.58.1536252254751; Thu, 06 Sep 2018 09:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536252254; cv=none; d=google.com; s=arc-20160816; b=VM1W+cKrTM4j3uSwVF9KjEqC8pQDXLjmNtxKJ4kkMNUJm+BK8h1i3MiBcg7D+sDGZF 7UeT4TFuqGEKxhe5PDGEg+dWdWzhZCZuneXImEvHpl9rTOWnsnAOSn9Ns/qgy9+6QCIl AsG8sNEZEKuDfKZKyuNQGo6acQbi0bR/iz7C75xjYhA9zNF/rTBG9xAYzx+IqSzChdGk /B0mMHLvVkqGt0DqyMpUIeg0hLgsl7VE8B0llVn0ApcYmIwl+unxS5pzPf/v0L1K1MP/ 3K2rXf6XcRrwFxHTzkk9z2ts3yAfBoVxak/odeLmXmRQbVCIup5qSksYe2tSlrLX0ndy Q7AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=lh9TdX+fgjQj/YYKksYZ3NDA/VloJ/px708AZmqjcng=; b=Mw/BuyxfLlLBEE7ZianUqyRBzKTfj4bbDf/LgU7ErNfvcLkpTVcUPluzmpLYkFa8xj vrz7zowXgoKVEUMNjNVcjcSWtihfJjkGdQRBPEvr2BLTZOST9NixsI+pU8s8pYMU/5tR kv9j3a5OlhVqDGuYVmSQyVlAAo3ToQpgX48CmHCdiGiPUVsTwsGg5v1ZQeRYbtpvW8rd d2uUFrAnaniPTf/eNxCYycQDwFXvQUMfN4bxHFjef05p11r53puNx5eD8AxdTVv+S41F WoViHc4OCxV9UoRYibDwAM/Y7mh33OFuqMBQmcX79KVJA2Nz7XPLnUDI46qoX96WFXsS ZSSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Phqyw20W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i9-v6si5429393pgk.403.2018.09.06.09.43.58; Thu, 06 Sep 2018 09:44:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Phqyw20W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728319AbeIFVSd (ORCPT + 99 others); Thu, 6 Sep 2018 17:18:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:50898 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726506AbeIFVSc (ORCPT ); Thu, 6 Sep 2018 17:18:32 -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 25C2C2075E; Thu, 6 Sep 2018 16:42:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536252133; bh=yVfZRj6s3Ocx/ZUVRKkgqqz3B30dUDlWuFYXukNvwYI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Phqyw20WJ6tHLf58+zkmO99piizq6alZHhJ+AeKSEfkmPttBXmtxJWVt4ePae43QM xBsZ+x517UairVhW7crd3OyfHJHzIJA72zkPkjpnD4/l/ZB3XTR68r2ikGRXekMEAf MhJ9L9dxNjeIRX5Ib2Iu6K+L1LGRlxyzL68tvx7w= Date: Fri, 7 Sep 2018 01:42:09 +0900 From: Masami Hiramatsu To: Peter Oberparleiter Cc: Stephen Rothwell , "Steven Rostedt (VMware)" , Linux-Next Mailing List , Linux Kernel Mailing List , arnd@arndb.de Subject: Re: linux-next: build warnings from the build of Linus' tree Message-Id: <20180907014209.49e2940f74615a1e4f544ffd@kernel.org> In-Reply-To: References: <20180824133206.4218c2e5@canb.auug.org.au> <20180824172053.20fa197294f51496dcec5605@kernel.org> <20180824204756.e787765461975cd1e27502dc@kernel.org> <20180824224211.2934d7c0@canb.auug.org.au> <20180826171058.e07f99e6e03f7497e5a46ed3@kernel.org> <20180828072333.36af4d5d@canb.auug.org.au> <20180828094341.d20d8fbcb9dca310d44df951@kernel.org> 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 On Thu, 6 Sep 2018 12:49:39 +0200 Peter Oberparleiter wrote: > On 28.08.2018 02:43, Masami Hiramatsu wrote: > > I recently added a gcov profiling for ftrace, following Documentation/dev-tools/gcov.rst. > > 6b7dca401cb1 ("tracing: Allow gcov profiling on only ftrace subsystem") > > > > and it caused may orphan section warnings/errors on arm and powerpc64. > > We also found same error happens when CONFIG_GCOV_PROFILE_ALL=y. > > So I guess GCOV kernel subsystem broken in some environment. > > I can confirm that these issues are unrelated to your commit which only > made the existing problems visible by enabling gcov-kernel profiling for > allyesconfig builds. Both problems already exist in v4.18 and likely > earlier versions. > > Problem 1: link failure on arm > (https://lkml.org/lkml/2018/8/24/345) > > The root cause appears to be that the arm linker script only partially > discards unneeded sections generated by the compiler when gcov-kernel > profiling is enabled. > > Problem 2: linker warnings on powerpc > (https://lkml.org/lkml/2018/8/24/72) > > CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y adds compiler flag > -fdata-sections. This option causes GCC to create separate data sections > for data objects, including those generated by GCC internally for gcov > profiling. Since the name of these internal data objects starts with a . > (.LPBX0, .LPBX1), the resulting section name starts with "data..". As > section names starting with "data.." are used for specific purposes in > the Linux kernel, the linker script does not automatically handle them, > resulting in the "orphan section" linker warnings. Good catch! I didn't know that option. > > I've attached a quick fix that should address both problems. I'd > appreciate if this patch could get some testing before I post proper fix > patches. Hmm, I'm still not able to reproduce it on powerpc cross build even with CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y ... So, sorry I couldn't test this patch. > > -- >8 -- > diff --git a/arch/arm/kernel/vmlinux.lds.h b/arch/arm/kernel/vmlinux.lds.h > index ae5fdff18406..2ca33277a28b 100644 > --- a/arch/arm/kernel/vmlinux.lds.h > +++ b/arch/arm/kernel/vmlinux.lds.h > @@ -48,6 +48,7 @@ > > #define ARM_DISCARD \ > *(.ARM.exidx.exit.text) \ > + *(.ARM.exidx.text.exit) \ BTW, why would we need this? Thanks, > *(.ARM.extab.exit.text) \ > ARM_CPU_DISCARD(*(.ARM.exidx.cpuexit.text)) \ > ARM_CPU_DISCARD(*(.ARM.extab.cpuexit.text)) \ > diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h > index 7b75ff6e2fce..5cf3b90c5592 100644 > --- a/include/asm-generic/vmlinux.lds.h > +++ b/include/asm-generic/vmlinux.lds.h > @@ -68,7 +68,7 @@ > */ > #ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION > #define TEXT_MAIN .text .text.[0-9a-zA-Z_]* > -#define DATA_MAIN .data .data.[0-9a-zA-Z_]* > +#define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data..LPBX* > #define SDATA_MAIN .sdata .sdata.[0-9a-zA-Z_]* > #define RODATA_MAIN .rodata .rodata.[0-9a-zA-Z_]* > #define BSS_MAIN .bss .bss.[0-9a-zA-Z_]* > @@ -613,7 +613,7 @@ > > #define EXIT_DATA \ > *(.exit.data .exit.data.*) \ > - *(.fini_array) \ > + *(.fini_array .fini_array.*) \ > *(.dtors) \ > MEM_DISCARD(exit.data*) \ > MEM_DISCARD(exit.rodata*) > -- > Peter Oberparleiter > Linux on Z Development - IBM Germany > -- Masami Hiramatsu