Explorar el Código

Dpkg::Shlibs::Objdump: Encode the ELF ABI as a big-endian byte stream

This way when unpacking for output, the result gives meaningful results.
Guillem Jover hace 9 años
padre
commit
8efe8ef489
Se han modificado 2 ficheros con 5 adiciones y 2 borrados
  1. 2 0
      debian/changelog
  2. 3 2
      scripts/Dpkg/Shlibs/Objdump.pm

+ 2 - 0
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
       Dpkg::Shlibs::Objdump. These do not define the ABI, and make the
       objects not match when they should, when looking for shared libraries
       objects not match when they should, when looking for shared libraries
       from dpkg-shlibdeps.
       from dpkg-shlibdeps.
+    - Encode the ELF ABI as a big-endian byte stream, so that decoding for
+      output gives meaningful results.
 
 
   [ Updated scripts translations ]
   [ Updated scripts translations ]
   * German (Helge Kreutzmann).
   * German (Helge Kreutzmann).

+ 3 - 2
scripts/Dpkg/Shlibs/Objdump.pm

@@ -180,8 +180,9 @@ sub get_format {
     # Mask any processor flags that might not change the architecture ABI.
     # Mask any processor flags that might not change the architecture ABI.
     $elf{flags} &= $elf_flags_mask{$elf{mach}} // 0;
     $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};
     return $format{$file};
 }
 }