Debian Codegraph @

dupsyms

raw
1 #!/usr/local/bin/perl -w
2 use File::Find;
3 use Cwd;
4 my $root = getcwd();
5
6 find(sub {
7 if (/\.so$/)
8 {
9 do_syms($File::Find::name);
10 }
11 },'.');
12
13
14 sub do_syms
15 {
16 my $path = shift;
17 open(NM,"nm -DPp $root/$path|") || die "Cannot open pipe:$!";
18 while (<NM>)
19 {
20 my ($sym,$kind) = /^(\w+)\s+(\S)/;
21 next if ($kind =~ /^[UBAw]$/ || $sym =~ /^_(init|fini)$/);
22 $def{$sym}{$path} = $kind;
23 }
24 }
25
26 foreach my $sym (sort keys %def)
27 {
28 my @where = keys %{$def{$sym}};
29 if (@where > 1)
30 {
31 print "$sym :\n";
32 foreach my $path (sort @where)
33 {
34 print " $def{$sym}{$path} $path\n";
35 }
36 print "\n";
37 }
38 }