From 4ad66219495b0345af1f073dee4900096b6bae4f Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Tue, 5 Jan 2010 19:27:51 +0100 Subject: [PATCH] --- yaml --- r: 182291 b: refs/heads/master c: dc4f8845ee2ca39fe054a2d911729ffd269b4b66 h: refs/heads/master i: 182289: f11478abb8921054cb1758dc934684c3f6d4f13e 182287: 622f4cb71a4fd2c26edbe09ded74b59f4f429c6e v: v3 --- [refs] | 2 +- trunk/scripts/recordmcount.pl | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index fe349702f42a..43c709550004 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7e53bd42d14c75192b99674c40fcc359392da59d +refs/heads/master: dc4f8845ee2ca39fe054a2d911729ffd269b4b66 diff --git a/trunk/scripts/recordmcount.pl b/trunk/scripts/recordmcount.pl index 92f09fe9639e..5de12c7b366f 100755 --- a/trunk/scripts/recordmcount.pl +++ b/trunk/scripts/recordmcount.pl @@ -432,14 +432,14 @@ sub update_funcs # Loop through all the mcount caller offsets and print a reference # to the caller based from the ref_func. - for (my $i=0; $i <= $#offsets; $i++) { - if (!$opened) { - open(FILE, ">$mcount_s") || die "can't create $mcount_s\n"; - $opened = 1; - print FILE "\t.section $mcount_section,\"a\",$section_type\n"; - print FILE "\t.align $alignment\n" if (defined($alignment)); - } - printf FILE "\t%s %s + %d\n", $type, $ref_func, $offsets[$i] - $offset; + if (!$opened) { + open(FILE, ">$mcount_s") || die "can't create $mcount_s\n"; + $opened = 1; + print FILE "\t.section $mcount_section,\"a\",$section_type\n"; + print FILE "\t.align $alignment\n" if (defined($alignment)); + } + foreach my $cur_offset (@offsets) { + printf FILE "\t%s %s + %d\n", $type, $ref_func, $cur_offset - $offset; } } @@ -514,7 +514,7 @@ sub update_funcs } # is this a call site to mcount? If so, record it to print later if ($text_found && /$mcount_regex/) { - $offsets[$#offsets + 1] = hex $1; + push(@offsets, hex $1); } }