diff options
Diffstat (limited to 'scripts/recordmcount.pl')
-rwxr-xr-x | scripts/recordmcount.pl | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index 7109e2b5bc0a..911ba7ffab84 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl | |||
@@ -393,7 +393,7 @@ while (<IN>) { | |||
393 | $read_function = 0; | 393 | $read_function = 0; |
394 | } | 394 | } |
395 | # print out any recorded offsets | 395 | # print out any recorded offsets |
396 | update_funcs() if ($text_found); | 396 | update_funcs() if (defined($ref_func)); |
397 | 397 | ||
398 | # reset all markers and arrays | 398 | # reset all markers and arrays |
399 | $text_found = 0; | 399 | $text_found = 0; |
@@ -403,7 +403,6 @@ while (<IN>) { | |||
403 | # section found, now is this a start of a function? | 403 | # section found, now is this a start of a function? |
404 | } elsif ($read_function && /$function_regex/) { | 404 | } elsif ($read_function && /$function_regex/) { |
405 | $text_found = 1; | 405 | $text_found = 1; |
406 | $offset = hex $1; | ||
407 | $text = $2; | 406 | $text = $2; |
408 | 407 | ||
409 | # if this is either a local function or a weak function | 408 | # if this is either a local function or a weak function |
@@ -412,10 +411,15 @@ while (<IN>) { | |||
412 | if (!defined($locals{$text}) && !defined($weak{$text})) { | 411 | if (!defined($locals{$text}) && !defined($weak{$text})) { |
413 | $ref_func = $text; | 412 | $ref_func = $text; |
414 | $read_function = 0; | 413 | $read_function = 0; |
414 | $offset = hex $1; | ||
415 | } else { | 415 | } else { |
416 | # if we already have a function, and this is weak, skip it | 416 | # if we already have a function, and this is weak, skip it |
417 | if (!defined($ref_func) || !defined($weak{$text})) { | 417 | if (!defined($ref_func) && !defined($weak{$text}) && |
418 | # PPC64 can have symbols that start with .L and | ||
419 | # gcc considers these special. Don't use them! | ||
420 | $text !~ /^\.L/) { | ||
418 | $ref_func = $text; | 421 | $ref_func = $text; |
422 | $offset = hex $1; | ||
419 | } | 423 | } |
420 | } | 424 | } |
421 | } elsif ($read_headers && /$mcount_section/) { | 425 | } elsif ($read_headers && /$mcount_section/) { |
@@ -440,7 +444,7 @@ while (<IN>) { | |||
440 | } | 444 | } |
441 | 445 | ||
442 | # dump out anymore offsets that may have been found | 446 | # dump out anymore offsets that may have been found |
443 | update_funcs() if ($text_found); | 447 | update_funcs() if (defined($ref_func)); |
444 | 448 | ||
445 | # If we did not find any mcount callers, we are done (do nothing). | 449 | # If we did not find any mcount callers, we are done (do nothing). |
446 | if (!$opened) { | 450 | if (!$opened) { |