public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Dodji Seketeli <dodji@seketeli.org>
Cc: libabigail@sourceware.org
Subject: Re: How to drop all non-global/defined function declarations?
Date: Wed, 08 Apr 2020 17:02:37 +0200	[thread overview]
Message-ID: <46b50532fef132b14a8ee37089616f328d0af210.camel@klomp.org> (raw)
In-Reply-To: <86d08jprem.fsf@seketeli.org>

Hi Dodji,

On Tue, 2020-04-07 at 11:38 +0200, Dodji Seketeli wrote:
> From what I see, just invoking abidw on libfoo.so (without any
> suppression specification) captures only the exported functions (which
> have global function symbol in the binary) of the binary, that is:
> create_foo, destroy_foo, get_foo and set_foo as well as free and malloc.

Why are free and malloc included? They are explicitly marked as
undefined in the symbol table and the xml abi definition doesn't
include an elf-function-symbol for them?

> The libfoo_frob function which is not exported (doesn't have a global
> ELF symbol) is not captured.

You are right, for my example, but I see internal, not exported,
symbols in my actual library libelf, an example being __libelf_seterrno
which is definitely LOCAL. Will try to come up with a smaller
reproducer. But you can simply try by running libdw on libelf.so.
__libelf_seterrno will be included if you have debuginfo installed (but
not without debuginfo).

> > But for some reason that doesn't drop the malloc and free function
> > declarations.
> 
> Right.  At the moment, there is no way to filter out a function that is
> actually exported by the binary like this.  I guess the original idea
> was to prevent users from accidentally missing a potential ABI
> incomptable change due to the toolchain or something like that.  Also,
> because those toolchain-generated functions usually don't come with
> debug info, including them in the abixml file doesn't take much space.
> 
> But as usual, if you argue that this is would be a useful feature, then
> we can add an option to handle this usecase.  We just need to discuss
> the details of that option, I guess.

I think them being undefined in the symbol table make them unexported.
They are just there to show the library consumes that symbol. That is
also an abi issue, but not one I am interested in. Users of my library
should assume that my library makes sure such symbols will be resolved
(by having the correct DT_NEEDED entries), but they cannot use that
information themselves to rely on those symbols being there.

The main issue is that they are really noise. They don't come with an
argument list or a real return type. And they make the xml abi file
harder to compare (visually).

My goal here is to have an xml abi file checked into git. Then when we
update the abi, it should be accompanied by a change in the xml abi
file. The smaller and more concise we can make the xml abi file the
clearer it is what we are exactly changing that impacts the abi.

Thanks,

Mark

  reply	other threads:[~2020-04-08 15:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-05 20:08 Mark Wielaard
2020-04-07  9:38 ` Dodji Seketeli
2020-04-08 15:02   ` Mark Wielaard [this message]
2020-04-10  8:48     ` Dodji Seketeli
2020-04-13  1:39       ` Mark Wielaard
2020-04-13  1:40         ` [PATCH] Add --drop-undefined-syms to abidw Mark Wielaard
2020-04-15 12:48           ` Dodji Seketeli

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=46b50532fef132b14a8ee37089616f328d0af210.camel@klomp.org \
    --to=mark@klomp.org \
    --cc=dodji@seketeli.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).