sksp2024-mcu/libucw/maint/abi-check-exports
2024-09-14 21:50:33 +02:00

20 lines
396 B
Perl
Executable file

#!/usr/bin/perl
# Check symbols exported by a library
# (c) 2014 Martin Mares <mj@ucw.cz>
use common::sense;
my $lib = $ARGV[0] or die "Usage: $0 <library>\n";
open my $f, '-|', 'nm', $lib or die;
while (<$f>) {
chomp;
next if /^\s/;
my ($addr, $type, $sym) = split /\s+/;
if ($sym =~ m{^(ucw|ucwlib)_}) {
next
}
if ($type =~ m{[A-Z]}) {
print "$sym ($type)\n";
}
}
close $f or die;