[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.0.0-14-g6c73347



The following commit has been merged in the master branch:
commit 6c73347d83c75d83dd5c01f6308ecfccc4fa793b
Author: Adam D. Barratt <adam@adam-barratt.org.uk>
Date:   Mon Sep 29 18:42:53 2008 +0100

    Don't try to readelf-parse files for which objdump returns "invalid operation".
    
    Only use readelf to emulate objdump if objdump returned "file
    format not recognized".  In cases where the objdump output was "invalid
    operation", the output of etch's readelf is not particularly useful
    and it's easier to simply let the checks scripts handle the objdump
    output.

diff --git a/collection/objdump-info b/collection/objdump-info
index 3f4c335..6b77e4a 100755
--- a/collection/objdump-info
+++ b/collection/objdump-info
@@ -98,16 +98,44 @@ while (<FILES>) {
 
 	    last if $failed;
 	} else {
-	    # We're using etch's binutils so attempt to build an output file
-	    # in the expected format without using objdump; we lose some
-	    # data but none that our later checks actually use
 	    my @sections;
 	    my @symbol_versions;
 
-	    if (system("readelf -l $bin 2>&1 | grep -q 'Error: Not an ELF file'") == 0) {
+	    # If the error wasn't one of the two we special-case, abort
+	    $failed = 1;
+	    my $invalidop = 0;
+	    my $objdumpout = '';
+	    if (open(PIPE, '-|', "objdump --headers --private-headers -T $bin 2>&1")) {
+		while(<PIPE>) {
+		    $objdumpout .= $_;
+		    if (m/Invalid operation$/) {
+			$invalidop = 1;
+			$failed = 0;
+		    } elsif (m/File format not recognized$/) {
+			$failed = 0;
+		    }
+		}
+		close PIPE;
+	    }
+
+	    last if $failed;
+
+	    if ($invalidop) {
+		# If objdump returned "invalid operation" then the
+		# readelf code will tend to produce false positives
+		# so just return the objdump output and let the scripts
+		# handle it
+
+		print OUT $objdumpout;
+		next;
+	    } elsif (system("readelf -l $bin 2>&1 | grep -q 'Error: Not an ELF file'") == 0) {
 		print OUT "objdump: $bin: File format not recognized\n";
 		next;
 	    } elsif (open(PIPE, '-|', "readelf -W -l -t -d -V $bin")) {
+		# We're using etch's binutils so attempt to build an output file
+		# in the expected format without using objdump; we lose some
+		# data but none that our later checks actually use
+
 		my $section = '';
 		my %program_headers;
 
diff --git a/debian/changelog b/debian/changelog
index 60953fc..e834338 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,13 @@ lintian (2.1.0) unstable; urgency=low
   * check/scripts:
     + [FL] Use $known_shells_regex from common_data.
   
+  * collection/objdump-info:
+    + [ADB] Only use readelf to emulate objdump if objdump returned "file
+      format not recognized".  In cases where the objdump output was "invalid
+      operation", the output of etch's readelf is not particularly useful
+      and it's easier to simply let the checks scripts handle the objdump
+      output.
+
   * frontend/lintian:
     + [FL] Convert to use Lintian::Output.
   

-- 
Debian package checker


Reply to: