summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/qa.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe/qa.py')
-rw-r--r--meta/lib/oe/qa.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/meta/lib/oe/qa.py b/meta/lib/oe/qa.py
index 75e7df8546..fbe719d8ec 100644
--- a/meta/lib/oe/qa.py
+++ b/meta/lib/oe/qa.py
@@ -144,6 +144,26 @@ class ELFFile:
144 bb.note("%s %s %s failed: %s" % (objdump, cmd, self.name, e)) 144 bb.note("%s %s %s failed: %s" % (objdump, cmd, self.name, e))
145 return "" 145 return ""
146 146
147def elf_machine_to_string(machine):
148 """
149 Return the name of a given ELF e_machine field or the hex value as a string
150 if it isn't recognised.
151 """
152 try:
153 return {
154 0x02: "SPARC",
155 0x03: "x86",
156 0x08: "MIPS",
157 0x14: "PowerPC",
158 0x28: "ARM",
159 0x2A: "SuperH",
160 0x32: "IA-64",
161 0x3E: "x86-64",
162 0xB7: "AArch64"
163 }[machine]
164 except:
165 return "Unknown (%s)" % repr(machine)
166
147if __name__ == "__main__": 167if __name__ == "__main__":
148 import sys 168 import sys
149 elf = ELFFile(sys.argv[1]) 169 elf = ELFFile(sys.argv[1])