use warnings;
my $Directory = $ARGV[0];
my $Symbol = $ARGV[1];
opendir DIR,$Directory;
my @files = readdir DIR;
closedir DIR;
@objects = grep(/l?i?b?LLVM.*\.[oa]$/,sort(@files));
foreach $lib (@objects) {
my $head = 0;
open SYMS,
"nm $Directory/$lib | grep '$Symbol' | sort --key=3 | uniq |";
while (<SYMS>) {
if (!$head) { print "$lib:\n"; $head = 1; }
chomp($_);
print " $_\n";
}
close SYMS;
}