diff options
author | Li Hong <lihong.hi@gmail.com> | 2009-10-28 08:07:43 +0300 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-10-29 22:11:57 +0300 |
commit | c4b8ac2c1aee1398b9378b8730bac56294b3410b (patch) | |
tree | 10a8cb1fa3510da16aa5be4a895b300cf778ed12 /scripts | |
parent | 6092858c60f168c1950f8ad73880d54271696ec5 (diff) | |
download | linux-c4b8ac2c1aee1398b9378b8730bac56294b3410b.tar.xz |
tracing: Exit with error if a weak function is used in recordmcount.pl
If a weak function is used as a relocation reference for mcount callers
and that function is overridden, it will cause ftrace to fail at run time.
The current code should prevent a weak function from being used, but if
one is, the code should exit with an error to fail at compile time.
Signed-off-by: Li Hong <lihong.hi@gmail.com>
LKML-Reference: <20091028050743.GH30758@uhli>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/recordmcount.pl | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index 884776a6e01a..a4e2435d4821 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl @@ -350,15 +350,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" . + die "$inputfile: ERROR: referencing weak function" . " $ref_func for mcount\n"; - return; } # is this function static? If so, note this fact. |