[diffoscope] 01/09: Further split readelf output when examining ELF files

Jérémy Bobbio lunar at moszumanska.debian.org
Tue Jan 19 18:22:30 CET 2016


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

lunar pushed a commit to branch master
in repository diffoscope.

commit 3658803564a92d8818cf667833fc1247e896fe1b
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Tue Jan 19 12:51:00 2016 +0100

    Further split readelf output when examining ELF files
---
 diffoscope/comparators/elf.py | 41 ++++++++++++++++++++++++++++++++++++++---
 1 file changed, 38 insertions(+), 3 deletions(-)

diff --git a/diffoscope/comparators/elf.py b/diffoscope/comparators/elf.py
index 2d4912c..5484e31 100644
--- a/diffoscope/comparators/elf.py
+++ b/diffoscope/comparators/elf.py
@@ -49,9 +49,37 @@ class Readelf(Command):
         except UnicodeDecodeError:
             return line
 
-class ReadelfAll(Readelf):
+class ReadelfFileHeader(Readelf):
     def readelf_options(self):
-        return ['--all']
+        return ['--file-header']
+
+class ReadelfProgramHeader(Readelf):
+    def readelf_options(self):
+        return ['--program-header']
+
+class ReadelfSections(Readelf):
+    def readelf_options(self):
+        return ['--sections']
+
+class ReadelfSymbols(Readelf):
+    def readelf_options(self):
+        return ['--symbols']
+
+class ReadelfRelocs(Readelf):
+    def readelf_options(self):
+        return ['--relocs']
+
+class ReadelfDynamic(Readelf):
+    def readelf_options(self):
+        return ['--dynamic']
+
+class ReadelfNotes(Readelf):
+    def readelf_options(self):
+        return ['--notes']
+
+class RedaelfVersionInfo(Readelf):
+    def readelf_options(self):
+        return ['--version-info']
 
 class ReadelfDebugDump(Readelf):
     def readelf_options(self):
@@ -107,7 +135,14 @@ class ObjdumpDisassembleSection(ObjdumpSection):
         return ['--line-numbers', '--disassemble']
 
 def _compare_elf_data(path1, path2):
-    return [Difference.from_command(ReadelfAll, path1, path2),
+    return [Difference.from_command(ReadelfFileHeader, path1, path2),
+            Difference.from_command(ReadelfProgramHeader, path1, path2),
+            Difference.from_command(ReadelfSections, path1, path2),
+            Difference.from_command(ReadelfSymbols, path1, path2),
+            Difference.from_command(ReadelfRelocs, path1, path2),
+            Difference.from_command(ReadelfDynamic, path1, path2),
+            Difference.from_command(ReadelfNotes, path1, path2),
+            Difference.from_command(RedaelfVersionInfo, path1, path2),
             Difference.from_command(ReadelfDebugDump, path1, path2)]
 
 class ElfSection(File):

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


More information about the diffoscope mailing list