From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8083E385480F; Tue, 16 Mar 2021 17:17:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8083E385480F From: "gprocida+abigail at google dot com" To: libabigail@sourceware.org Subject: [Bug default/27554] abidw emits unreachable types and declarations Date: Tue, 16 Mar 2021 17:17:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: libabigail X-Bugzilla-Component: default X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gprocida+abigail at google dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dodji at redhat dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Mar 2021 17:17:46 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27554 --- Comment #2 from Giuliano Procida -= -- I've uploaded a script that finds the "reachable" parts of an ABI. https://sourceware.org/pipermail/libabigail/2021q1/003263.html A reachable XML element satisfies one of the following: * it is an ELF library dependency * it is an ELF symbol * it is a declaration referring to an ELF symbol * it is a type referred to by some reachable element * it is the naming typedef of a reachable anonymous class/struct * it is contained in a reachable XML element * it contains a reachable XML element Unreachable XML elements are removed by the script as are certain empty elements and blank lines. The script can be run on existing tests. I did the following: find tests -name '*.abi' -or -name '*.xml' | while read f; do scripts/abiprune.pl <"$f" >/tmp/pruned.xml orig=3D$(wc -c <"$f") pruned=3D$(wc -c