X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=scripts%2Frecordmcount.pl;h=090d300d7394d1d890057633826ff5f6b5f03eaa;hb=89034bc2c7b839702c00a704e79d112737f98be0;hp=db4ebe1b9960183b0c56bcd66ea2b483df8f6ea8;hpb=fb82ad719831db58e9baa4c67015aae3fe27e7e3;p=deliverable%2Flinux.git diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index db4ebe1b9960..090d300d7394 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl @@ -392,7 +392,7 @@ while () { $read_function = 0; } # print out any recorded offsets - update_funcs() if ($text_found); + update_funcs() if (defined($ref_func)); # reset all markers and arrays $text_found = 0; @@ -402,7 +402,6 @@ while () { # section found, now is this a start of a function? } elsif ($read_function && /$function_regex/) { $text_found = 1; - $offset = hex $1; $text = $2; # if this is either a local function or a weak function @@ -411,10 +410,15 @@ while () { if (!defined($locals{$text}) && !defined($weak{$text})) { $ref_func = $text; $read_function = 0; + $offset = hex $1; } else { # if we already have a function, and this is weak, skip it - if (!defined($ref_func) || !defined($weak{$text})) { + if (!defined($ref_func) && !defined($weak{$text}) && + # PPC64 can have symbols that start with .L and + # gcc considers these special. Don't use them! + $text !~ /^\.L/) { $ref_func = $text; + $offset = hex $1; } } } elsif ($read_headers && /$mcount_section/) { @@ -439,7 +443,7 @@ while () { } # dump out anymore offsets that may have been found -update_funcs() if ($text_found); +update_funcs() if (defined($ref_func)); # If we did not find any mcount callers, we are done (do nothing). if (!$opened) {