Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1172903pxf; Fri, 12 Mar 2021 03:49:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7zFuiy6Pmz1HzpTI5iXjBi8uaQ22PxLNhyG8DlEfRq2ESDFHgkCR4Ca8m6vfqkLzFCG6C X-Received: by 2002:a05:6402:b2d:: with SMTP id bo13mr13500901edb.120.1615549748636; Fri, 12 Mar 2021 03:49:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615549748; cv=none; d=google.com; s=arc-20160816; b=r1DgBUOb1wuLxigYd3N2Q6MepfzwtBmZfoZJpMEcz7IhwjBL1QIE2iPGUBqKBqqEks TnCjnw5Ku34kEytoespmnpF4bQGIxOUquLJTvWAeiF/V9IpzzhKgLGK/A0zHHW2RkKY9 lZ6klgOacYUDJMHGvL8wni3rMmNv7CzbU7gZcopIFs7q61idMS9f8GjPBwA2vY3ll8a+ HbtEDrE/YRX7DgfGE7LtpRiJahB+j9PEX5YRdFtxHH6PRic+N9iwFol+puvBuSp/zVC+ 1VisE4liVgW09/0GPkW7Pt0lAK9f5crVFrIcPcgG9jLXpfUsYq42a/l7+9BOHGuf9rdU UyuA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=zvwk6LQbm50SbbywfGvJt3T6iIaL9G43b99pXzTCfhI=; b=d2UeebZeuc+0+nYtyvzo2fUqwQRVdXsSbLjmZfNLwPj7ZPbQeYjiV5sP74EEmRs+Ce pYluEiWbB0c+SJ3l0U4TffAs9d+3v56KRMzGqMb/0sQnokknUapX1Nb85Q9OeBxcZfu2 chIQAp2XM/O7RXa6GeSGVA1ZlYMl1mXbzOQN5syZxR8yhucLJh+c3v3fu347/eGyJiL6 YkSjme5yC13ir1Uu8+ulQm6W2gCmoy1i4mmvEZ6ivGuUewbohgyy55BCIL0tS3d/so/q nbVBd6MsOeXx4HvsbBXyWj7LxJJafBHzDvrHM9Uzij3g/9jFqv3dv+ix2y3rdmNBXoP8 eErA== 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 a7si4362484edb.607.2021.03.12.03.48.46; Fri, 12 Mar 2021 03:49:08 -0800 (PST) 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 S233217AbhCLJ4G (ORCPT + 99 others); Fri, 12 Mar 2021 04:56:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232909AbhCLJzr (ORCPT ); Fri, 12 Mar 2021 04:55:47 -0500 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09165C061762; Fri, 12 Mar 2021 01:55:47 -0800 (PST) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94) (envelope-from ) id 1lKeW2-00F7m8-UP; Fri, 12 Mar 2021 10:55:31 +0100 From: Johannes Berg To: linux-kernel@vger.kernel.org, linux-um@lists.infradead.org Cc: Jessica Yu , Alexander Viro , linux-fsdevel@vger.kernel.org, Johannes Berg Subject: [PATCH 6/6] um: fix CONFIG_GCOV for modules Date: Fri, 12 Mar 2021 10:55:26 +0100 Message-Id: <20210312104627.54210a33e4c0.I9807ad0ea6ee21a81f86d367f3b61e5f24f8b30b@changeid> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210312095526.197739-1-johannes@sipsolutions.net> References: <20210312095526.197739-1-johannes@sipsolutions.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johannes Berg At least with current toolchain versions, gcov (as enabled by CONFIG_GCOV) requires init and exit handlers to run. For modules, this wasn't done properly, so use the new support for CONFIG_MODULE_DESTRUCTORS as well as CONFIG_CONSTRUCTORS to have gcov init and exit called appropriately. Signed-off-by: Johannes Berg --- arch/um/Kconfig.debug | 2 ++ arch/um/kernel/process.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/um/Kconfig.debug b/arch/um/Kconfig.debug index ca040b4e86e5..74b27b11cb44 100644 --- a/arch/um/Kconfig.debug +++ b/arch/um/Kconfig.debug @@ -17,6 +17,8 @@ config GCOV_BASE bool "Enable gcov support (selectively)" depends on DEBUG_INFO depends on !KCOV && !GCOV_KERNEL + select CONSTRUCTORS + select WANT_MODULE_DESTRUCTORS help This option allows developers to retrieve coverage data from a UML session, stored to disk just like with a regular userspace binary, diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index c5011064b5dd..33f895a95ff8 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c @@ -240,6 +240,8 @@ void do_uml_exitcalls(void) call = &__uml_exitcall_end; while (--call >= &__uml_exitcall_begin) (*call)(); + + run_all_module_destructors(); } char *uml_strdup(const char *string) -- 2.29.2