From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CA9FB3858CDB; Thu, 1 Jun 2023 08:16:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA9FB3858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685607413; bh=8VfsVf6oqaaxTTAJC26wDhfvkIEeGADfj63da7mXRcI=; h=From:To:Subject:Date:From; b=XKppCtw1PhN2DBiDNHVOUqOFGvBgWyaT8gjlkBaRv65cYte8lyi2+bGFfg48/Eie5 8pbyZjD/IH+iQwslHyBVERFsl7kOcwDlFNklo8/pFZ/PvQEvs/RXSvYWzvW1od/sse o/pjIzgcUGc9IB4p4Z8mo8RzOJeO+bmBwPVFczmg= From: "rc452860 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/110072] New: __gcov_dump cannot generate gcda for so files opened with dlopen when gcc version is later than 5.1.0 Date: Thu, 01 Jun 2023 08:16:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.8.5 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rc452860 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110072 Bug ID: 110072 Summary: __gcov_dump cannot generate gcda for so files opened with dlopen when gcc version is later than 5.1.0 Product: gcc Version: 4.8.5 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: rc452860 at gmail dot com Target Milestone: --- Created attachment 55229 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D55229&action=3Dedit example When the version of gcc is lower than 5.1.0, __gcov_dump cannot generate gc= da files for the so files opened by dlopen. See attachment for sample project. After comparing the different versions of GCC code, I found that gcc before 5.1.0 stored counter data in gcov_list, while later versions of GCC stored = it in __gcov_master. The two versions are defined as follows: gcc4.8.5 in libgcc/libgcov.c ``` /* Chain of per-object gcov structures. */ static struct gcov_info *gcov_list; ``` gcc8.5.0 in libgcc/libgcov-driver.c ``` /* Exactly one of these will be live in the process image. */ struct gcov_master __gcov_master =3D=20 {GCOV_VERSION, 0}; ```=