Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp490942imm; Thu, 6 Sep 2018 05:54:33 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb+g4YU3OIJgb4ImsTZcpybLFnnwhPzJhQ7KKEPrhS2rH3kqSj/mPjy53pqFSAJwBX/wSOr X-Received: by 2002:a17:902:b688:: with SMTP id c8-v6mr2510551pls.114.1536238473108; Thu, 06 Sep 2018 05:54:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536238473; cv=none; d=google.com; s=arc-20160816; b=mtThZrlePzKKmDUWLsT4c8to3/5Cc5LNs3mMyoUEX9qAlS725Jqhb1EXlDuoxmRuoA /5VTgCG/TsEcAlwJtggw0ATGnOYBaYFpG2sATQdaSC+TiwdniymOt9Oe6/S/1qIUuO7c 1Djpeoi1tXhNJCnGGt76zZ+GVyLqMCYQAYNc5LmQfggbmehWhxps5ny5xILq8CXQYZUA yW8+uwnyzP+dIpZHTsTNzhRGS9xxvq9o/7XKM/UIhNFkFUOqqe2JbvCpL8Fmiu4+WDg7 OeKebY3VOUti77fS/78XGczpz//ZTHKJI6AVMXXvwFl11q3V5r68hrw5rna5IL0tNRwo AE6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:date:references:cc:to :subject:from; bh=q+leQF9T8KqeHilYCRaPK3LCksLVmZbdXsG0RLkr/1o=; b=T+GXSOZU1n60EhGFJdRAZE6/kkchTGFRrJ5gaZtx/Jb2Yck6QcD+ntHbiQHj7g5lHK ZSXL/6PO+ROdOMlXGyqN4LSfnyP8HrugMrrnSnVh+zDiiU6FCWmhXnH5adSu0kXu5Cqp o3ceqxW3VgRd4L/HKbyYI9eKOP76BY6PMY7eWXK0ZGLjYo2jzyjl1X/PjXFyppyLMi7q o5V3w0GJbG5NuAa4wNRbJipzgRIJZxqHMnG1aGE6Usn+Y+NRBCbsjjGZDBO4dF7kChfb Rd5n7yyCRxMaXIUAl6+izm76nBxfRUjC6V+peCBot8CqPFuYq3CjhqdjkZqSrmU2fN5l vUDw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q23-v6si5167936pgq.483.2018.09.06.05.54.17; Thu, 06 Sep 2018 05:54:33 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727776AbeIFPYh (ORCPT + 99 others); Thu, 6 Sep 2018 11:24:37 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:55616 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726349AbeIFPYh (ORCPT ); Thu, 6 Sep 2018 11:24:37 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w86AjTUX017025 for ; Thu, 6 Sep 2018 06:49:43 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2mb1ckuuu3-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 06 Sep 2018 06:49:43 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 6 Sep 2018 11:49:42 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 6 Sep 2018 11:49:39 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w86AnceM34865332 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 6 Sep 2018 10:49:38 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 31D6842041; Thu, 6 Sep 2018 13:49:32 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DFAA642049; Thu, 6 Sep 2018 13:49:31 +0100 (BST) Received: from [9.152.212.144] (unknown [9.152.212.144]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 6 Sep 2018 13:49:31 +0100 (BST) From: Peter Oberparleiter Subject: Re: linux-next: build warnings from the build of Linus' tree To: Masami Hiramatsu , Stephen Rothwell Cc: "Steven Rostedt (VMware)" , Linux-Next Mailing List , Linux Kernel Mailing List , arnd@arndb.de 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> Date: Thu, 6 Sep 2018 12:49:39 +0200 MIME-Version: 1.0 In-Reply-To: <20180828094341.d20d8fbcb9dca310d44df951@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 18090610-0016-0000-0000-000002013062 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18090610-0017-0000-0000-00003257D9F3 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-06_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809060111 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. -- >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) \ *(.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