Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2556379pxj; Mon, 10 May 2021 05:52:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQSMEcPNkV/NrV1XAvZ5LFPVlhWWa+FO3yyW+UcyLSItEGBeGSMGZ9FHMTNlxOjpaz9vzl X-Received: by 2002:a50:fc0b:: with SMTP id i11mr30128429edr.259.1620651143650; Mon, 10 May 2021 05:52:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620651143; cv=none; d=google.com; s=arc-20160816; b=mgGhu8wsyUw6LVIj6yRWx6YfcJ8zfFvLQDrhh4WHv2SmMah0TAHMBVeMebnp1g+pgs GA1x3olsqGgiqVHYii9YIkLGX57S/hxNvkAQ8D471QNp2cwr0BoXtuOMT2oT8Y5hfBxv f7FGm9k9EfEOU+WdB+2rTJ2+22SjtRN2MggslUop3QZ+59kJtBhy7u1r2+62RXWEdB7+ nN/5gSW06OUceaFnou2Wk7hbbZAgRK2NiKKp5c4la+qTJQQiw0CAAv70txSC9U0x/Z8B AkhBKLJp+jffWsadntMPjm+DVugykyodz3k74JHy4Ewd/PlcyzwwqAqRimOCVDkr/A60 s5tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=umGVzPzq67CsadvZ5xCt1jTR35tGk1ZAEclNNalJ4zU=; b=ooyBz0MAn9s46l5ASxRaQin2vQ2/hiL85jDm/Jw7jmdDjp3PI/G5PyBFIwEfBMwRVO /JeHOhvO4Gm/hf7WEHpkRzRJXVRNB5xpWqvx25uq55nTY/FAnzXR92otKxGAZfTj4Z78 jDmV7bmkxrO5cjRcWRZfk0m0Z6ZXFGrEpwJv1iURYuzthj3dVa0lkYck+5RB1jrVbrJQ LTzF4h0xQzjnxbS/cPERIISSSAexEs5L91M3/HuMbKApgFlAdcEWymkjQJjWWHGHDO76 56nlmft7QLSb7DAspwSicFVEH7VtRNxBpow1o8V+2D8GxHZXyPt5ajsY0/0znx3Fyt4X i+pw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kz18si12580322ejc.598.2021.05.10.05.51.59; Mon, 10 May 2021 05:52:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349522AbhEJMtm (ORCPT + 99 others); Mon, 10 May 2021 08:49:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234249AbhEJLjP (ORCPT ); Mon, 10 May 2021 07:39:15 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2C87C06138B; Mon, 10 May 2021 04:38:01 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2) (envelope-from ) id 1lg4EU-006y0Y-BN; Mon, 10 May 2021 13:37:54 +0200 Message-ID: <2a46ca787df9a44c8b4fbc17ab6b69247ab38400.camel@sipsolutions.net> Subject: Re: [PATCH v2] init/gcov: allow CONFIG_CONSTRUCTORS on UML to fix module gcov From: Johannes Berg To: Lambert , Peter Oberparleiter Cc: Andrew Morton , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Jessica Yu , linux-um@lists.infradead.org, "Lambert." Date: Mon, 10 May 2021 13:37:53 +0200 In-Reply-To: References: <20210120172041.c246a2cac2fb.I1358f584b76f1898373adfed77f4462c8705b736@changeid> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > Hi Johannes and Peter, sorry to bother but I have one question > on this change. The do_ctors() won’t be executed for UML > because *the constructors have already been called for ELF*. > > *__ctors_start* and *__ctors_end* symbols. See link: > https://elixir.bootlin.com/linux/v5.12.2/source/include/asm-generic/vmlinux.lds.h#L676 > > In my environment, UML+GCC 10, I can't find __gcov_init executed > before kernel starts. So I did some trace and found glibc > __libc_csu_init > will only execute constructors between *__init_array_start*and > *__init_array_end*. > Which means if do_ctors() is not executed for UML, no elsewhere will > the constructors be executed. > > Shall we remove the *!defined(CONFIG_UML)* for GCC, or I just missed > some steps to make the GCOV work for UML? No, that doesn't seem like the right solution. Perhaps then with that toolchain (or configuration thereof) we need to provide __init_array_start/end labels? Or ... maybe that actually just needs to be removed, so that the toolchain gets to choose? Hmm. Pretty sure it worked for me, I think also with gcc 10, but not sure exactly where I tested. johannes