add support for aarch64 to dwarfdump (#445)
authorNick Desaulniers <nickdesaulniers@users.noreply.github.com>
Sat, 15 Oct 2022 17:42:10 +0000 (10:42 -0700)
committerGitHub <noreply@github.com>
Sat, 15 Oct 2022 17:42:10 +0000 (10:42 -0700)
llvm-dwarfdump prints
elf64-littleaarch64

We probably need more logic to differentiate between big endian (less
common) vs little endian (more common), but at least this allows us to
use ./scripts/dwarfdump on aarch64 targets now.

I probably should have added this to #318 / #317.

scripts/dwarfdump.py

index 162af88c76c256bf7e377b6da1d9c3e79b3895b6..4050fe5409fca28b4d0b510126960f7da57675bd 100644 (file)
@@ -342,7 +342,7 @@ class ReadElf(object):
         self.elffile = ELFFile(file)
         self.output = output
         self._dwarfinfo = self.elffile.get_dwarf_info()
-        arches = {"EM_386": "i386", "EM_X86_64": "x86-64"}
+        arches = {"EM_386": "i386", "EM_X86_64": "x86-64", "EM_AARCH64": "littleaarch64"}
         arch = arches[self.elffile['e_machine']]
         bits = self.elffile.elfclass
         self._emitline("%s:    file format elf%d-%s" % (filename, bits, arch))