Browse Source

Dpkg::Shlibs::Objdump: Do not special case EM_SPARC32PLUS for NetBSD

The affected code in NetBSD was bogus, and has been removed now. So
there is no point in trying to special case the EM_SPARC32PLUS ELF
machine ID depending on the ELF class, for something that should never
happen.

Ref: https//gnats.netbsd.org/51925
Guillem Jover 7 years ago
parent
commit
27bb073c1f
2 changed files with 4 additions and 10 deletions
  1. 3 0
      debian/changelog
  2. 1 10
      scripts/Dpkg/Shlibs/Objdump.pm

+ 3 - 0
debian/changelog

@@ -3,6 +3,9 @@ dpkg (1.18.23) UNRELEASED; urgency=medium
   * Handle unmatched arch-qualified virtual packages in dpkg-genbuildinfo,
     instead of letting perl die. Closes: #849944
   * Declare .buildinfo format as stable with version 1.0.
+  * Perl modules:
+    - Do not special case EM_SPARC32PLUS for NetBSD in Dpkg::Shlibs::Objdump,
+      the code has been fixed in NetBSD as that situation could not happen.
   * Documentation:
     - Clarify the requirements for deb-conffile(5) pathnames. Closes: #854417
       Proposed by Dieter Adriaenssens <dieter.adriaenssens@gmail.com>.

+ 1 - 10
scripts/Dpkg/Shlibs/Objdump.pm

@@ -156,6 +156,7 @@ my %elf_mach_map = (
     ELF_MACH_MN10300_CYGNUS()   => ELF_MACH_MN10300,
     ELF_MACH_OR1K_OLD()         => ELF_MACH_OR1K,
     ELF_MACH_S390_OLD()         => ELF_MACH_S390,
+    ELF_MACH_SPARC32PLUS()      => ELF_MACH_SPARC,
     ELF_MACH_SPARC64_OLD()      => ELF_MACH_SPARC64,
     ELF_MACH_XTENSA_OLD()       => ELF_MACH_XTENSA,
 );
@@ -210,16 +211,6 @@ sub get_format {
     my $tmpl = "x16(S2Lx[${elf_word}3]L)${elf_endian}";
     @elf{qw(type mach version flags)} = unpack $tmpl, $header;
 
-    # XXX: We need to special case ELF_MACH_SPARC32PLUS, because NetBSD
-    # treats it differently depending on the ELF bits.
-    if ($elf{mach} == ELF_MACH_SPARC32PLUS) {
-        if ($elf{bits} == ELF_BITS_32) {
-            $elf{mach} = ELF_MACH_SPARC;
-        } else {
-            $elf{mach} = ELF_MACH_SPARC64;
-        }
-    }
-
     # Canonicalize the machine ID.
     $elf{mach} = $elf_mach_map{$elf{mach}} // $elf{mach};