profile2linkerlist.pl 375 B

1234567891011121314151617181920
  1. #!/usr/bin/perl
  2. #
  3. # Takes a (sorted) output of readprofile and turns it into a list suitable for
  4. # linker scripts
  5. #
  6. # usage:
  7. # readprofile | sort -rn | perl profile2linkerlist.pl > functionlist
  8. #
  9. use strict;
  10. while (<>) {
  11. my $line = $_;
  12. $_ =~ /\W*[0-9]+\W*([a-zA-Z\_0-9]+)\W*[0-9]+/;
  13. print "*(.text.$1)\n"
  14. unless ($line =~ /unknown/) || ($line =~ /total/);
  15. }