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.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/meta/lib/oe/qa.py b/meta/lib/oe/qa.py
index 2c301419b0..75e7df8546 100644
--- a/meta/lib/oe/qa.py
+++ b/meta/lib/oe/qa.py
@@ -50,41 +50,41 @@ class ELFFile:
50 if len(self.data) < ELFFile.EI_NIDENT + 4: 50 if len(self.data) < ELFFile.EI_NIDENT + 4:
51 raise NotELFFileError("%s is not an ELF" % self.name) 51 raise NotELFFileError("%s is not an ELF" % self.name)
52 52
53 self.my_assert(self.data[0], chr(0x7f) ) 53 self.my_assert(self.data[0], 0x7f)
54 self.my_assert(self.data[1], 'E') 54 self.my_assert(self.data[1], ord('E'))
55 self.my_assert(self.data[2], 'L') 55 self.my_assert(self.data[2], ord('L'))
56 self.my_assert(self.data[3], 'F') 56 self.my_assert(self.data[3], ord('F'))
57 if self.bits == 0: 57 if self.bits == 0:
58 if self.data[ELFFile.EI_CLASS] == chr(ELFFile.ELFCLASS32): 58 if self.data[ELFFile.EI_CLASS] == ELFFile.ELFCLASS32:
59 self.bits = 32 59 self.bits = 32
60 elif self.data[ELFFile.EI_CLASS] == chr(ELFFile.ELFCLASS64): 60 elif self.data[ELFFile.EI_CLASS] == ELFFile.ELFCLASS64:
61 self.bits = 64 61 self.bits = 64
62 else: 62 else:
63 # Not 32-bit or 64.. lets assert 63 # Not 32-bit or 64.. lets assert
64 raise NotELFFileError("ELF but not 32 or 64 bit.") 64 raise NotELFFileError("ELF but not 32 or 64 bit.")
65 elif self.bits == 32: 65 elif self.bits == 32:
66 self.my_assert(self.data[ELFFile.EI_CLASS], chr(ELFFile.ELFCLASS32)) 66 self.my_assert(self.data[ELFFile.EI_CLASS], ELFFile.ELFCLASS32)
67 elif self.bits == 64: 67 elif self.bits == 64:
68 self.my_assert(self.data[ELFFile.EI_CLASS], chr(ELFFile.ELFCLASS64)) 68 self.my_assert(self.data[ELFFile.EI_CLASS], ELFFile.ELFCLASS64)
69 else: 69 else:
70 raise NotELFFileError("Must specify unknown, 32 or 64 bit size.") 70 raise NotELFFileError("Must specify unknown, 32 or 64 bit size.")
71 self.my_assert(self.data[ELFFile.EI_VERSION], chr(ELFFile.EV_CURRENT) ) 71 self.my_assert(self.data[ELFFile.EI_VERSION], ELFFile.EV_CURRENT)
72 72
73 self.sex = self.data[ELFFile.EI_DATA] 73 self.sex = self.data[ELFFile.EI_DATA]
74 if self.sex == chr(ELFFile.ELFDATANONE): 74 if self.sex == ELFFile.ELFDATANONE:
75 raise NotELFFileError("self.sex == ELFDATANONE") 75 raise NotELFFileError("self.sex == ELFDATANONE")
76 elif self.sex == chr(ELFFile.ELFDATA2LSB): 76 elif self.sex == ELFFile.ELFDATA2LSB:
77 self.sex = "<" 77 self.sex = "<"
78 elif self.sex == chr(ELFFile.ELFDATA2MSB): 78 elif self.sex == ELFFile.ELFDATA2MSB:
79 self.sex = ">" 79 self.sex = ">"
80 else: 80 else:
81 raise NotELFFileError("Unknown self.sex") 81 raise NotELFFileError("Unknown self.sex")
82 82
83 def osAbi(self): 83 def osAbi(self):
84 return ord(self.data[ELFFile.EI_OSABI]) 84 return self.data[ELFFile.EI_OSABI]
85 85
86 def abiVersion(self): 86 def abiVersion(self):
87 return ord(self.data[ELFFile.EI_ABIVERSION]) 87 return self.data[ELFFile.EI_ABIVERSION]
88 88
89 def abiSize(self): 89 def abiSize(self):
90 return self.bits 90 return self.bits