X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=scripts%2Frecordmcount.pl;h=911ba7ffab842dd3017229e269851501f19c145f;hb=7dbdee2e9a2ac42ea5135801bcc9d1a8e3f672aa;hp=7109e2b5bc0acf61e39c24aff4b2074016e6078c;hpb=e03ab9d415c47e1ff485b646f95604d3e3a91708;p=~andy%2Flinux diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index 7109e2b5bc0..911ba7ffab8 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl @@ -393,7 +393,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; @@ -403,7 +403,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 @@ -412,10 +411,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/) { @@ -440,7 +444,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) {