Back to home page

LXR

 
 

    


0001 #!/usr/bin/perl
0002 
0003 #
0004 # Takes a (sorted) output of readprofile and turns it into a list suitable for
0005 # linker scripts
0006 #
0007 # usage:
0008 #    readprofile | sort -rn | perl profile2linkerlist.pl > functionlist
0009 #
0010 use strict;
0011 
0012 while (<>) {
0013   my $line = $_;
0014 
0015   $_ =~ /\W*[0-9]+\W*([a-zA-Z\_0-9]+)\W*[0-9]+/;
0016 
0017   print "*(.text.$1)\n"
0018       unless ($line =~ /unknown/) || ($line =~ /total/);
0019 }