[debhelper-devel] Bug#789351: please strip .comment sections from static libraries

Helmut Grohne helmut at subdivi.de
Sat Jun 20 07:51:31 UTC 2015


Package: debhelper
Version: 9.20150507
Severity: wishlist
Tags: patch
File: /usr/bin/dh_strip

dh_strip passes --remove-section=.comment and --remove-section=.note to
strip for shared libraries and executables, but does not do so for
static libraries. The .comment sections usually contain the full gcc
version. When comparing two -dev packages built with different gcc
versions using debbindiff, the difference in .comment sections of static
libraries makes up for the bulk of output.

Is there a reason for why static libraries keep .comment and .note
sections? I could not find one. Removing them there as well, would
improve the debbindiff output and make packages a little bit smaller.
The gcc version is not recorded at all for packages without static
libraries and it will be recorded for all packages once .buildinfo files
are available to the archive.

The implementation of this change is easy:

--- a/dh_strip
+++ b/dh_strip
@@ -238,7 +238,8 @@
 
 	if (@static_libs) {
 		my $strip_help = qx{$strip 2>&1};
-		my @opts = ('--strip-debug');
+		my @opts = ('--strip-debug', '--remove-section=.comment',
+			'--remove-section=.note');
 		if (index($strip_help, '--enable-deterministic-archives') > -1) {
 			# NB: The short variant (-D) is broken in Jessie
 			# (binutils/2.25-3)

I am less sure about whether it also is harmless. Please consider this
change.

Helmut




More information about the debhelper-devel mailing list