Debian Codegraph @

symbols

raw
1 #!/usr/local/bin/perl -w
2
3 use Config;
4
5 $nm_opt = "";
6 $nm_opt = "-g" if ($Config{'osname'} eq 'sunos');
7 $nm_opt = "-px" if ($Config{'osname'} eq 'solaris');
8
9 chomp(@so_files = `find blib -name '*.so' -print`);
10
11 %sym = ();
12
13 foreach $module (@so_files)
14 {
15 my ($leaf) = ($module =~ m#/([^/]+)\.so$#);
16 foreach (`nm $nm_opt $module`)
17 {
18 if (/^(0x)?[0-9a-f]{8}\s+([A-Z])\s+_?(.*)$/)
19 {
20 my ($kind,$name) = ($2,$3);
21 if ($kind ne 'U')
22 {
23 $sym{$name} = [] unless (exists $sym{$name});
24 push(@{$sym{$name}},$leaf,$kind);
25 }
26 }
27 }
28 }
29
30 foreach $name (sort keys %sym)
31 {
32 my @def = @{$sym{$name}};
33 if (@def != 2)
34 {
35 print "$name defined ",join(',',@def),"\n";
36 }
37 }
38
39