public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: "gprocida+abigail at google dot com" <sourceware-bugzilla@sourceware.org>
To: libabigail@sourceware.org
Subject: [Bug default/27554] abidw emits unreachable types and declarations
Date: Tue, 16 Mar 2021 17:17:46 +0000	[thread overview]
Message-ID: <bug-27554-9487-f0lxS6Hluq@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27554-9487@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=27554

--- Comment #2 from Giuliano Procida <gprocida+abigail at google dot com> ---
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=$(wc -c <"$f")
  pruned=$(wc -c </tmp/pruned.xml)
  bytes=$(($orig-$pruned))
  echo "$f ($bytes smaller)"
  if [ -s /tmp/pruned.xml ]; then
    abidiff --harmless "$f" /tmp/pruned.xml || echo "$f has different pruned
ABI"
  else
    echo "$f has empty pruned ABI"
  fi
done | less

If you consider unreachable types in the ABI to be a bug, then there are plenty
of existing examples here already.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

      parent reply	other threads:[~2021-03-16 17:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09 23:22 [Bug default/27554] New: " gprocida+abigail at google dot com
2021-03-09 23:30 ` [Bug default/27554] " gprocida+abigail at google dot com
2021-03-16 17:17 ` gprocida+abigail at google dot com [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-27554-9487-f0lxS6Hluq@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).