]> mj.ucw.cz Git - libucw.git/blob - tools/check-exports
Tools: It's 2014 now :)
[libucw.git] / tools / check-exports
1 #!/usr/bin/perl
2 # Check symbols exported by a library
3 # (c) 2014 Martin Mares <mj@ucw.cz>
4
5 use common::sense;
6
7 my $lib = $ARGV[0] or die "Usage: $0 <library>\n";
8 open my $f, '-|', 'nm', $lib or die;
9 while (<$f>) {
10         chomp;
11         next if /^\s/;
12         my ($addr, $type, $sym) = split /\s+/;
13         if ($sym =~ m{^(ucw|ucwlib)_}) {
14                 next
15         }
16         if ($type =~ m{[A-Z]}) {
17                 print "$sym ($type)\n";
18         }
19 }
20 close $f or die;