1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 00:59:48 +00:00

insane: Rationalise phdrs-based QA checks

Various different QA checks are based on essentially the same data from
the ELF program headers.  Calling objdump to extract it repeatedly is
inefficient, particularly if the shell is involved.  Instead, let's
cache the output from objdump inside the qa.elf object and allow it to
be reused by multiple tests.

Also, using objdump instead of scanelf to check for bad RPATHs (in the
same way that the useless-rpaths check was doing already) allows the
dependency on pax-utils-native to be dropped.

(From OE-Core rev: bf19eeb9f65e91bf2b5d89e7c0b099c55d7c15ff)

Signed-off-by: Phil Blundell <philb@gnu.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Phil Blundell
2012-10-01 18:29:23 +01:00
committed by Richard Purdie
parent 96b8d721e9
commit f8c90bce73
2 changed files with 35 additions and 23 deletions
+17
View File
@@ -28,6 +28,7 @@ class ELFFile:
def __init__(self, name, bits = 0):
self.name = name
self.bits = bits
self.objdump_output = {}
def open(self):
self.file = file(self.name, "r")
@@ -87,3 +88,19 @@ class ELFFile:
import struct
(a,) = struct.unpack(self.sex+"H", self.data[18:20])
return a
def run_objdump(self, cmd, d):
import bb.process
import sys
if self.objdump_output.has_key(cmd):
return self.objdump_output[cmd]
objdump = d.getVar('OBJDUMP', True)
staging_dir = d.getVar('STAGING_BINDIR_TOOLCHAIN', True)
env = os.environ
env["LC_ALL"] = "C"
self.objdump_output[cmd] = bb.process.run([ os.path.join(staging_dir, objdump), cmd, self.name ], env=env, shell=False)[0]
return self.objdump_output[cmd]