From 8e4bff4cab0ddac6060645b0715210484d02ff40 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Wed, 30 Aug 2017 08:25:59 +0000 Subject: Initial file dump from open source release --- scripts/profile2linkerlist.pl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 scripts/profile2linkerlist.pl (limited to 'scripts/profile2linkerlist.pl') diff --git a/scripts/profile2linkerlist.pl b/scripts/profile2linkerlist.pl new file mode 100644 index 00000000..6943fa7c --- /dev/null +++ b/scripts/profile2linkerlist.pl @@ -0,0 +1,19 @@ +#!/usr/bin/perl + +# +# Takes a (sorted) output of readprofile and turns it into a list suitable for +# linker scripts +# +# usage: +# readprofile | sort -rn | perl profile2linkerlist.pl > functionlist +# +use strict; + +while (<>) { + my $line = $_; + + $_ =~ /\W*[0-9]+\W*([a-zA-Z\_0-9]+)\W*[0-9]+/; + + print "*(.text.$1)\n" + unless ($line =~ /unknown/) || ($line =~ /total/); +} -- cgit v1.3.1