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

lintian: r791 - in trunk: checks debian testset testset/libbaz testset/libbaz/debian



Author: rra
Date: 2006-11-21 03:17:18 +0100 (Tue, 21 Nov 2006)
New Revision: 791

Modified:
   trunk/checks/shared-libs
   trunk/debian/changelog
   trunk/testset/libbaz/Makefile
   trunk/testset/libbaz/debian/lib.shlibs
   trunk/testset/libbaz/debian/rules
   trunk/testset/tags.libbaz
Log:
* checks/shared-libs:
  + [RA] Don't report shlib-with-non-pic-code unless we're sure that
    we're looking at a shared library.  Otherwise, we get many false
    positives on some platforms where text relocations are normal for
    binaries.  Reported by Bill Allombert.  (Closes: #399525)

Modified: trunk/checks/shared-libs
===================================================================
--- trunk/checks/shared-libs	2006-11-20 04:28:06 UTC (rev 790)
+++ trunk/checks/shared-libs	2006-11-21 02:17:18 UTC (rev 791)
@@ -70,6 +70,7 @@
 my %SONAME;
 my %INTERP;
 my %STACK;
+my %TEXTREL;
 my %objsomething;
 my %sharedobject;
 my %index_info;
@@ -96,7 +97,7 @@
     } elsif (m/^\s*SONAME\s+(\S+)/o) {
 	$SONAME{$file} = $1;
     } elsif (m/^\s*TEXTREL\s/o) {
-	tag "shlib-with-non-pic-code", "$file";
+        $TEXTREL{$file} = 1;
     } elsif (m/^\s*INTERP\s/) {
 	$INTERP{$file} = 1;
     } elsif (m/^\s*STACK\s/) {
@@ -152,7 +153,7 @@
     if (exists $SONAME{$cur_file} or 
 	($link_info{$cur_file} and exists $SONAME{abs_path(dirname($cur_file)."/".$link_info{$cur_file})})) {
 	# yes!!
-	
+
 	my ($real_file, $real_perm);
 	if ($SONAME{$cur_file}) {
 	    $real_file = $cur_file;
@@ -162,6 +163,12 @@
 	    $real_perm = $files{$real_file} || $perm;
 	}
 
+	# Now that we're sure this is really a shared library, report on
+	# non-PIC problems.
+        if ($cur_file eq $real_file and $TEXTREL{$cur_file}) {
+            tag "shlib-with-non-pic-code", "$file";
+        }
+
         # don't apply the permission checks to links
         # since this only results in doubled messages
         if ($cur_file eq $real_file) { 

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2006-11-20 04:28:06 UTC (rev 790)
+++ trunk/debian/changelog	2006-11-21 02:17:18 UTC (rev 791)
@@ -5,6 +5,11 @@
       than failing with a note that binutils-multiarch is required.  Some
       packages have had ELF binaries recognized by file but unreadable.
       Reported by Bill Allombert.  (Closes: #399456)
+  * checks/shared-libs:
+    + [RA] Don't report shlib-with-non-pic-code unless we're sure that
+      we're looking at a shared library.  Otherwise, we get many false
+      positives on some platforms where text relocations are normal for
+      binaries.  Reported by Bill Allombert.  (Closes: #399525)
 
   * collection/file-info:
     + [RA] Unescape non-ASCII characters escaped by tar before running
@@ -16,7 +21,7 @@
       rather than aborting; some packages contain apparently corrupt ELF
       binaries.
 
- -- Russ Allbery <rra@debian.org>  Sun, 19 Nov 2006 20:27:49 -0800
+ -- Russ Allbery <rra@debian.org>  Mon, 20 Nov 2006 17:53:25 -0800
 
 lintian (1.23.26) unstable; urgency=low
 

Modified: trunk/testset/libbaz/Makefile
===================================================================
--- trunk/testset/libbaz/Makefile	2006-11-20 04:28:06 UTC (rev 790)
+++ trunk/testset/libbaz/Makefile	2006-11-21 02:17:18 UTC (rev 791)
@@ -5,7 +5,7 @@
 
 OBJS=baz.o extra.o
 
-all: libbaz1.a libbaz2.a libbaz1.so.1.0.3b libbaz2.so
+all: libbaz1.a libbaz2.a libbaz1.so.1.0.3b libbaz2.so libbaz3.so.1.0.3b
 
 libbaz2.so: libbaz2.so.1.0
 	ln -sf $^ $@
@@ -19,6 +19,10 @@
 libbaz2.so.1.0.3b: $(OBJS:%.o=%.sho)
 	$(CC) -o $@ -shared -Wl,-soname,libbaz2.so.1.0 $^ -lc
 
+# Non-PIC.
+libbaz3.so.1.0.3b: $(OBJS)
+	$(CC) -o $@ -shared -Wl,-soname,libbaz3.so.1 $^ -lc
+
 #%.o-noreentrant: %.c
 #	$(CC) $(CFLAGS) -o $@ -c $<
 

Modified: trunk/testset/libbaz/debian/lib.shlibs
===================================================================
--- trunk/testset/libbaz/debian/lib.shlibs	2006-11-20 04:28:06 UTC (rev 790)
+++ trunk/testset/libbaz/debian/lib.shlibs	2006-11-21 02:17:18 UTC (rev 791)
@@ -1,5 +1,6 @@
 libdoesntexist2 1.0 libbaz2
 libdoesntexist2 1.0 libbaz2
 libbaz2 1.1 libbaz2
+libbaz3 1 libbaz2
 udeb: libdoesntexist2 1.0 libbaz2
 udeb: libdoesntexist2 1.0 libbaz2

Modified: trunk/testset/libbaz/debian/rules
===================================================================
--- trunk/testset/libbaz/debian/rules	2006-11-20 04:28:06 UTC (rev 790)
+++ trunk/testset/libbaz/debian/rules	2006-11-21 02:17:18 UTC (rev 791)
@@ -52,9 +52,10 @@
 binary-arch: build binary-correct
 	# first, the lib package
 	install -d $(lib_tmp)/usr/lib
-	# resp. no soname (check) &no-pic (check) and wrong soname (check)
+	# resp. no soname (check), wrong soname (check), and no-pic (check)
 	cp -a libbaz1.so.1.0* $(lib_tmp)/usr/lib
 	cp -a libbaz2.so.1.0.3b $(lib_tmp)/usr/lib/libfoo2.so.1.0.3b
+	install -m644 libbaz3.so.1.0.3b $(lib_tmp)/usr/lib/libbaz3.so.1.0.3b
 	# let's include the .a in the non-dev too (TODO)
 	# Also, libbaz1.a hasn't a symbol table (TODO)
 	cp -a *.a $(lib_tmp)/usr/lib

Modified: trunk/testset/tags.libbaz
===================================================================
--- trunk/testset/tags.libbaz	2006-11-20 04:28:06 UTC (rev 790)
+++ trunk/testset/tags.libbaz	2006-11-21 02:17:18 UTC (rev 791)
@@ -5,13 +5,15 @@
 E: libbaz1: duplicate-entry-in-shlibs-control-file udeb: libdoesntexist2 1.0
 E: libbaz1: file-directly-in-usr-share-doc usr/share/doc/README.Debian
 E: libbaz1: ldconfig-symlink-missing-for-shlib usr/lib/libbaz2.so.1.0 usr/lib/libfoo2.so.1.0.3b libbaz2.so.1.0
+E: libbaz1: ldconfig-symlink-missing-for-shlib usr/lib/libbaz3.so.1 usr/lib/libbaz3.so.1.0.3b libbaz3.so.1
 E: libbaz1: maintainer-shell-script-fails-syntax-check postinst
 E: libbaz1: postinst-must-call-ldconfig usr/lib/libfoo2.so.1.0.3b
 E: libbaz1: sharedobject-in-library-directory-not-actually-a-shlib usr/lib/libbaz1.so.1.0.3b
 E: libbaz1: shlib-missing-in-control-file libbaz2 1.0 for usr/lib/libfoo2.so.1.0.3b
 E: libbaz1: shlib-with-executable-bit usr/lib/libfoo2.so.1.0.3b 0755
-E: libbaz1: shlib-with-non-pic-code usr/lib/libbaz1.so.1.0.3b
+E: libbaz1: shlib-with-non-pic-code usr/lib/libbaz3.so.1.0.3b
 E: libbaz1: unstripped-binary-or-object ./usr/lib/libbaz1.so.1.0.3b
+E: libbaz1: unstripped-binary-or-object ./usr/lib/libbaz3.so.1.0.3b
 E: libbaz1: unstripped-binary-or-object ./usr/lib/libfoo2.so.1.0.3b
 E: libbaz2: postinst-must-call-ldconfig usr/lib/libbaz2.so.1.0.3b
 E: libbaz2: symlink-should-be-relative usr/share/doc/libbaz2/changelog.gz /usr/share/doc/lintian/changelog.gz
@@ -19,6 +21,7 @@
 I: libbaz1: no-md5sums-control-file
 I: libbaz1: possible-non-posix-code-in-maintainer-script postinst:6 '[ -d /usr/doc -a ! -e /usr/doc/$PKG -a '
 I: libbaz1: possible-non-posix-code-in-maintainer-script prerm:5 '[ \( "$1" = "upgrade" -o "$1" = "remove" \) -a '
+I: libbaz1: several-sonames-in-same-package libbaz3.so.1 libbaz2.so.1.0
 I: libbaz2-dev: no-md5sums-control-file
 I: libbaz2: no-md5sums-control-file
 W: libbaz source: ancient-standards-version 3.2.1 (current is 3.7.2)
@@ -26,7 +29,7 @@
 W: libbaz source: package-uses-deprecated-debhelper-compat-version 1
 W: libbaz source: source-nmu-has-incorrect-version-number 1
 W: libbaz1: missing-depends-line
-W: libbaz1: package-name-doesnt-match-sonames libbaz2-1.0
+W: libbaz1: package-name-doesnt-match-sonames libbaz3-1 libbaz2-1.0
 W: libbaz1: postinst-should-not-set-usr-doc-link
 W: libbaz1: unused-shlib-entry-in-control-file libbaz2 1.1
 W: libbaz1: unused-shlib-entry-in-control-file libdoesntexist2 1.0



Reply to: