diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/profile2linkerlist.pl | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/profile2linkerlist.pl b/scripts/profile2linkerlist.pl new file mode 100644 index 000000000000..cb4260ebdb91 --- /dev/null +++ b/scripts/profile2linkerlist.pl | |||
@@ -0,0 +1,21 @@ | |||
1 | #!/usr/bin/perl | ||
2 | |||
3 | # | ||
4 | # Takes a (sorted) output of readprofile and turns it into a list suitable for | ||
5 | # linker scripts | ||
6 | # | ||
7 | # usage: | ||
8 | # readprofile | sort -rn | perl profile2linkerlist.pl > functionlist | ||
9 | # | ||
10 | |||
11 | while (<>) { | ||
12 | my $line = $_; | ||
13 | |||
14 | $_ =~ /\W*[0-9]+\W*([a-zA-Z\_0-9]+)\W*[0-9]+/; | ||
15 | |||
16 | if ( ($line =~ /unknown/) || ($line =~ /total/)) { | ||
17 | |||
18 | } else { | ||
19 | print "*(.text.$1)\n"; | ||
20 | } | ||
21 | } | ||