lkml.org 
[lkml]   [2009]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH v3 8/8] tracing: recordmcount.pl Die if we use a weak function as reference
    From fef57ba56001830adaeea6aef479c623e3bce6c6 Mon Sep 17 00:00:00 2001
    From: Li Hong <lihong.hi@gmail.com>
    Date: Tue, 27 Oct 2009 13:25:39 +0800
    Subject: [PATCH] tracing: recordmcount.pl Die if we use a weak function as reference

    Signed-off-by: Li Hong <lihong.hi@gmail.com>
    ---
    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


    \
     
     \ /
      Last update: 2009-10-28 06:11    [W:0.021 / U:0.296 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site