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

[SCM] Debian package checker branch, master, updated. 2.2.5-18-gf8064af



The following commit has been merged in the master branch:
commit 07bb167b6d49bfaa11bbacc30236abc26acb4ad1
Author: Raphael Geissert <atomo64@gmail.com>
Date:   Wed Feb 11 12:19:12 2009 -0600

    Store a local objdump_info reference in checks/shared-libs
    
    Avoid tons of calls to objdump_info by locally storing a reference to the
    hash.

diff --git a/checks/shared-libs b/checks/shared-libs
index b710a62..17f34f6 100644
--- a/checks/shared-libs
+++ b/checks/shared-libs
@@ -65,10 +65,12 @@ my $pkg = shift;
 my $type = shift;
 my $info = shift;
 
+my $objdump = $info->objdump_info;
+
 # 1st step: get info about shared libraries installed by this package
-foreach my $file (sort keys %{$info->objdump_info}) {
-    my $objdump = $info->objdump_info->{$file};
-    $SONAME{$file} = $objdump->{SONAME}[0] if defined $objdump->{SONAME};
+foreach my $file (sort keys %{$objdump}) {
+    $SONAME{$file} = $objdump->{$file}->{SONAME}[0]
+	if defined $objdump->{$file}->{SONAME};
 }
 
 foreach my $file (sort keys %{$info->file_info}) {
@@ -99,11 +101,11 @@ for my $cur_file (sort keys %{$info->index}) {
 
 	# Now that we're sure this is really a shared library, report on
 	# non-PIC problems.
-        if ($cur_file eq $real_file and $info->objdump_info->{$cur_file}->{TEXTREL}) {
+        if ($cur_file eq $real_file and $objdump->{$cur_file}->{TEXTREL}) {
             tag "shlib-with-non-pic-code", "$cur_file";
         }
 
-	my @symbol_names = map { @{$_}[2] } @{$info->objdump_info->{$cur_file}->{SYMBOLS}};
+	my @symbol_names = map { @{$_}[2] } @{$objdump->{$cur_file}->{SYMBOLS}};
 	if (grep /^_?exit$/, @symbol_names and !grep /^fork$/, @symbol_names) {
 	    tag "shlib-calls-exit", "$cur_file";
 	}
@@ -116,7 +118,7 @@ for my $cur_file (sort keys %{$info->index}) {
                 # yes.  But if the library has an INTERP section, it's designed
                 # to do something useful when executed, so don't report an error.
                 tag "shlib-with-executable-bit", $cur_file, sprintf("%04o", $real_perm)
-                    unless $info->objdump_info->{$real_file}->{INTERP};
+                    unless $objdump->{$real_file}->{INTERP};
             } elsif ($real_perm != 0644) {
                 # bad permissions
                 tag "shlib-with-bad-permissions", $cur_file, sprintf("%04o", $real_perm);
@@ -140,18 +142,18 @@ for my $cur_file (sort keys %{$info->index}) {
 	# executable stack.  We can only warn about a missing section on some
 	# architectures.  Only warn if there's an Architecture field; if
 	# that's missing, we'll already be complaining elsewhere.
-	if (exists $info->objdump_info->{$cur_file}->{OTHER_DATA}) {
-	    if (not defined $info->objdump_info->{$cur_file}->{STACK}) {
+	if (exists $objdump->{$cur_file}->{OTHER_DATA}) {
+	    if (not defined $objdump->{$cur_file}->{STACK}) {
 		if (defined $info->field('architecture')) {
 		    my $arch = $info->field('architecture');
 		    tag "shlib-without-PT_GNU_STACK-section", $cur_file
 			if $stack_arches{$arch};
 		}
-	    } elsif ($info->objdump_info->{$cur_file}->{STACK} ne "rw-") {
+	    } elsif ($objdump->{$cur_file}->{STACK} ne "rw-") {
 		tag "shlib-with-executable-stack", $cur_file;
 	    }
 	}
-    } elsif (exists $info->objdump_info->{$cur_file}->{OTHER_DATA}
+    } elsif (exists $objdump->{$cur_file}->{OTHER_DATA}
 	     && $ldconfig_dirs->known(dirname($cur_file))
 	     && exists $sharedobject{$cur_file}) {
 	tag "sharedobject-in-library-directory-missing-soname", "$cur_file";

-- 
Debian package checker


Reply to: