[PATCH] tracing: recordmcount.pl Die if we use a weak function as reference

From: Li Hong
Date: Tue Oct 27 2009 - 01:25:39 EST


Signed-off-by: Li Hong <lihong.hi@xxxxxxxxx>
---
scripts/recordmcount.pl | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index ffb1123..0f733c9 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -348,15 +348,11 @@ sub update_funcs
{
return unless ($ref_func and @offsets);

- # A section only had a weak function, to represent it.
- # Unfortunately, a weak function may be overwritten by another
- # function of the same name, making all these offsets incorrect.
- # To be safe, we simply print a warning and bail.
+ # Sanity check on weak function. A weak function may be overwritten by
+ # another function of the same name, making all these offsets incorrect.
if (defined $weak{$ref_func}) {
- print STDERR
- "$inputfile: WARNING: referencing weak function" .
- " $ref_func for mcount\n";
- return;
+ die "$inputfile: ERROR: referencing weak function" .
+ " $ref_func for mcount\n";
}

# is this function static? If so, note this fact.
--
1.6.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/