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

Niels Thykier niels at thykier.net
Sat Jun 20 10:59:40 UTC 2015


Control: tags -1 moreinfo

On 2015-06-20 09:51, Helmut Grohne wrote:
> 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:
> 
> [...]
> 
> I am less sure about whether it also is harmless. Please consider this
> change.
> 
> Helmut
> 
> [...]

As discussed on #debian-devel, I am open to the change.  However, it
seems that (at least) OCaml is storing bytecode in the .comment section
of its binaries (presumably including static libraries).

I think we need a (cheap and "fairly") reliable indicator of whether
something is likely to be an OCaml (etc.) static lib, which is storing
bytecode or other "important" data in these sections.

Other languages that /might/ be doing something similar:

 * Haskell
 * Go
 * ... ?

Thanks,
~Niels




More information about the debhelper-devel mailing list