Subversion Repositories Spectranet

[/] [branches/] [gnubinutils/] [buildtools/] [map2sym] - Blame information for rev 384

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 383 winston
#!/usr/bin/perl
2
my $mapfile=shift;
3
my $outputfile=shift;
4
if(!$outputfile)
5
{
6
        print("Usage: map2sym <mapfile> <outputfile>\n");
7
        exit -1;
8
}
9
 
10
open FHND, "< $mapfile" or die("Unable to open $mapfile: $!");
11
open SYMHND, "> $outputfile" or die("Unable to write to $outputfile: $!");
12
while(my $line=<FHND>)
13
{
14
        chomp $line;
15 384 winston
        if($line =~ /^\s{1,}0x[a-zA-Z0-9]{1,}\s{1,}(F|J)_/)
16 383 winston
        {
17
                $line=~s/^\s{1,}//g;
18
                my ($addr, $symbol)=split(/\s{1,}/, $line, 2);
19
                print SYMHND "$symbol equ $addr\n";
20
        }
21
}
22
close(FHND);
23
close(SYMHND);
24