public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* How to drop all non-global/defined function declarations?
@ 2020-04-05 20:08 Mark Wielaard
  2020-04-07  9:38 ` Dodji Seketeli
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Wielaard @ 2020-04-05 20:08 UTC (permalink / raw)
  To: libabigail

[-- 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 --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-04-15 12:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-05 20:08 How to drop all non-global/defined function declarations? Mark Wielaard
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

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).