[dpkg] 147/200: Dpkg::Shlibs::Objdump: Encode the ELF ABI as a big-endian byte stream

Ximin Luo infinity0 at debian.org
Wed Apr 5 15:17:31 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository dpkg.

commit 8efe8ef48927c71df6809c0107db881a047e6c3f
Author: Guillem Jover <guillem at debian.org>
Date:   Sat Jan 28 00:03:18 2017 +0100

    Dpkg::Shlibs::Objdump: Encode the ELF ABI as a big-endian byte stream
    
    This way when unpacking for output, the result gives meaningful results.
---
 debian/changelog               | 2 ++
 scripts/Dpkg/Shlibs/Objdump.pm | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index df6141e..dc16aa6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,8 @@ dpkg (1.18.20) UNRELEASED; urgency=medium
       Dpkg::Shlibs::Objdump. These do not define the ABI, and make the
       objects not match when they should, when looking for shared libraries
       from dpkg-shlibdeps.
+    - Encode the ELF ABI as a big-endian byte stream, so that decoding for
+      output gives meaningful results.
 
   [ Updated scripts translations ]
   * German (Helge Kreutzmann).
diff --git a/scripts/Dpkg/Shlibs/Objdump.pm b/scripts/Dpkg/Shlibs/Objdump.pm
index 519916d..197769d 100644
--- a/scripts/Dpkg/Shlibs/Objdump.pm
+++ b/scripts/Dpkg/Shlibs/Objdump.pm
@@ -180,8 +180,9 @@ sub get_format {
     # Mask any processor flags that might not change the architecture ABI.
     $elf{flags} &= $elf_flags_mask{$elf{mach}} // 0;
 
-    # Repack for easy comparison.
-    $format{$file} = pack 'C2SL', @elf{qw(bits endian mach flags)};
+    # Repack for easy comparison, as a big-endian byte stream, so that
+    # unpacking for output gives meaningful results.
+    $format{$file} = pack 'C2(SL)>', @elf{qw(bits endian mach flags)};
 
     return $format{$file};
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list