3 # we make up an array of
4 # $file{function_name}=filename;
5 # $unres{filename}="func1 func2 ...."
7 #$nm_func="parse_linux";
8 $nm_func="parse_solaris";
15 foreach $file (sort keys %unres)
17 @a=split(/\s+/,$unres{$file});
22 $ff{$f}=1 if $f ne "";
26 { $we_need{$file}.="$a "; }
29 foreach $file (sort keys %we_need)
31 # print " $file $we_need{$file}\n";
32 foreach $bit (split(/\s+/,$we_need{$file}))
33 { push(@final,&walk($bit)); }
35 foreach (@final) { $fin{$_}=1; }
37 foreach (sort keys %fin)
40 print "$file: @final\n";
46 local(@a,%seen,@ret,$r);
51 return "" if ($f =~ "^\s*$");
53 return(split(/\s/,$done{$f})) if defined ($done{$f});
55 return if $in{$f} > 0;
58 foreach $r (split(/\s+/,$we_need{$f}))
63 $done{$f}=join(" ",@ret);
71 open(IN,"nm $name|") || die "unable to run 'nn $name':$!\n";
79 $file="$1.c" if /\[(.*).o\]/;
80 print STDERR "$file\n";
87 next unless $a[4] eq "GLOB";
90 $unres{$file}.=$a[7]." ";
94 if ($file{$a[7]} ne "")
96 print STDERR "duplicate definition of $a[7],\n$file{$a[7]} and $file \n";
111 open(IN,"nm $name|") || die "unable to run 'nn $name':$!\n";
119 #$file="$1.c" if $file =~ /^(.*).o$/;
120 print STDERR "$file\n";
124 @a=split(/\s*\|\s*/);
125 next unless $#a == 7;
126 next unless $a[4] eq "GLOB";
127 if ($a[6] eq "UNDEF")
129 $unres{$file}.=$a[7]." ";
130 print STDERR "$file needs $a[7]\n" if $debug;
134 if ($file{$a[7]} ne "")
136 print STDERR "duplicate definition of $a[7],\n$file{$a[7]} and $file \n";
141 print STDERR "$file has $a[7]\n" if $debug;