drm/etnaviv: potential NULL dereference
[linux-2.6-microblaze.git] / scripts / recordmcount.pl
index f599031..68841d0 100755 (executable)
@@ -142,6 +142,11 @@ my %text_sections = (
      ".text.unlikely" => 1,
 );
 
+# Acceptable section-prefixes to record.
+my %text_section_prefixes = (
+     ".text." => 1,
+);
+
 # Note: we are nice to C-programmers here, thus we skip the '||='-idiom.
 $objdump = 'objdump' if (!$objdump);
 $objcopy = 'objcopy' if (!$objcopy);
@@ -519,6 +524,14 @@ while (<IN>) {
 
        # Only record text sections that we know are safe
        $read_function = defined($text_sections{$1});
+       if (!$read_function) {
+           foreach my $prefix (keys %text_section_prefixes) {
+               if (substr($1, 0, length $prefix) eq $prefix) {
+                   $read_function = 1;
+                   last;
+               }
+           }
+       }
        # print out any recorded offsets
        update_funcs();