public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: libabigail@sourceware.org
Subject: How to drop all non-global/defined function declarations?
Date: Sun, 5 Apr 2020 22:08:18 +0200	[thread overview]
Message-ID: <20200405200818.GA16021@wildebeest.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 2089 bytes --]

Hi,

This is somewhat similar to my previous struggle with dropping
unused/opaque types from the abi xml file. My ultimate goal is to
generate an abi xml file that contains just the variables, functions
and types defined/exported by my library. I like to check these into
our git repo and so like to keep them as small as possible and not
have them change for variable, type or function changes that are
internal only and won't be used when checking for abi changes.

Attached is an extension of the previous example, now extended with an
internal function libfoo_frob which isn't exported, but only used
internally. The actual exported functions have been added to a symbol
version file.

When generating the abidw xml file both the internal function and
functions used by the library (free and malloc in this case) are
included. The four exported functions (create_foo, destroy_foo,
get_foo and set_foo) do have corresponding elf-symbols in the abi xml
file.

Ideally I'll simply drop any function declaration that doesn't have a
corresponding global elf-symbol. But the suppression format doesn't
seem to support that.

I am able to drop the internal libfoo_frob internal function using:

[suppress_function]
  file_name_not_regexp = foo.h
  drop = yes

But for some reason that doesn't drop the malloc and free function
declarations.

Also this shouldn't actually work according to the suppress_function
drop documentation:

  Please note that for this property to be effective, the enclosing
  suppression specification must have at least one of the following
  properties specified: name_regexp, name, name_regexp,
  source_location_not_in or source_location_not_regexp.

It doesn't list file_name_not_regexp (and source_location_* isn't
documentated as a suppress_function property). I assume that is a
typo, but now I am confused which properties do/don't work with drop.

Is it a bug that malloc and free aren't dropped in this example?
And/Or can we get a way to drop any non-exported function declaration
(any that doesn't have a corresponding global elf-symbol)?

Thanks,

Mark

[-- Attachment #2: foolib.tar.gz --]
[-- Type: application/gzip, Size: 15923 bytes --]

             reply	other threads:[~2020-04-05 20:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-05 20:08 Mark Wielaard [this message]
2020-04-07  9:38 ` Dodji Seketeli
2020-04-08 15:02   ` Mark Wielaard
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=20200405200818.GA16021@wildebeest.org \
    --to=mark@klomp.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).