Bug#673451: lintian: improve use of readelf
Package: lintian
Version: 2.5.7
Severity: normal
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu quantal ubuntu-patch
*** /tmp/tmpiekV9j/bug_body
In Ubuntu, the attached patch was applied to achieve the following:
* collection/objdump-info: objdump-info switched from objdump to readelf,
but readelf in Ubuntu doesn't seem to work properly when used with the
-D option, possibly due to differences in default hardening. Work
around issue by using different flags and adjusting parsing. This also
restores version parsing.
Thanks for considering the patch.
-- System Information:
Debian Release: wheezy/sid
APT prefers precise-updates
APT policy: (500, 'precise-updates'), (500, 'precise-security'), (500, 'precise-proposed'), (500, 'precise')
Architecture: amd64 (x86_64)
Kernel: Linux 3.2.0-24-generic (SMP w/4 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru lintian-2.5.7/collection/objdump-info lintian-2.5.7ubuntu1/collection/objdump-info
--- lintian-2.5.7/collection/objdump-info 2012-05-13 15:20:39.000000000 -0400
+++ lintian-2.5.7ubuntu1/collection/objdump-info 2012-05-18 11:32:30.000000000 -0400
@@ -142,16 +142,16 @@
close PIPE;
}
- if (open(PIPE, '-|', "readelf -W -s -D \Q$bin\E 2>&1")) {
+ if (open(PIPE, '-|', "readelf -W -s \Q$bin\E 2>&1")) {
print {$opts{pipe_in}} "DYNAMIC SYMBOL TABLE:\n";
while(<PIPE>) {
last if m/^Symbol table of/;
- if (m/^\s*(\d+)\s+\d+:\s*[0-9a-f]+\s+\d+\s+(?:(?:\S+\s+){3})(\S+)\s+(.*)\Z/) {
+ if (m/^\s*(\d+):\s*[0-9a-f]+\s+\d+\s+(?:(?:\S+\s+){3})(\S+)\s+(.*)\Z/) {
my ($symnum, $seg, $sym, $ver) = ($1, $2, $3, '');
- if ($sym =~ m/^(.*)@(.*)$/) {
+ if ($sym =~ m/^(.*)@(.*) \(.*\)$/) {
$sym = $1;
$ver = $2;
} elsif (@symbol_versions == 0) {
Reply to: