aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/qa.py
AgeCommit message (Collapse)Author
2016-02-16lib/qa.py: raise ValueError if file isn't an ELFRoss Burton
Instead of raising a generic Exception that can't be handled specifically, raise a ValueError. Also update the callers so any unexpected exceptions are not ignored. Also, rename isBigEngian() to isBigEndian(). Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-16lib/oe/qa: ELFFile: check that a path is a file before opening itRoss Burton
When opening an ELF file check that a filename points to a normal file before attempting to open it, as if the file turns out to be something more exotic like a FIFO it could hang forever. (From OE-Core rev: 4b3576bc30d8f8cdcde25189def8b059fc92b27c) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09image/kernel-module-split/eglibc-ld.inc: Remove has_key() usageRichard Purdie
The has_key() attribute has been removed in python 3 since there is better syntax available. Use the improved syntax. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09classes/recipes/lib: Fix various python whitespace issuesRichard Purdie
There are some left over tab characters in the python functions. This removes them and resolves python 3 errors. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09clases/lib: Use modern exception syntaxRichard Purdie
Update older code to use modern exception handling syntax which is the form accepted by python 3. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-06qa.py: Toolchain path should not be hardcoded to execute objdumpMuhammad Shakeel
Currently objdump command is invoked from the STAGING_BINDIR_TOOLCHAIN directory. In case of external toolchain if this directory doesn't exist then objdump fails to execute. Instead of hardcoding the path it should search PATH to find it. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-12-04qa.py: Modify the env for the child process onlyMuhammad Shakeel
Modified environment is only required for new subprocess to execute objdump command and not for the current process. We should only modify the copy of env to pass it on to the child. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-18lib/oe/qa: Trap exceptions when running objdumpPhil Blundell
This avoids propagating a failure if we encounter an ELF file that objdump can't parse for any reason. Some versions and/or configurations of objdump will refuse to read files for "the wrong" architecture. Signed-off-by: Phil Blundell <pb@pbcl.net> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-18insane: Rationalise phdrs-based QA checksPhil Blundell
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. Signed-off-by: Phil Blundell <philb@gnu.org> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2011-03-03qa.py: Fix a typo when evaluating bitsizeMark Hatle
This should be setting a variable, not performing a comparison. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2011-03-02insane.bbclass: Fix ELF bitsize comparisonMark Hatle
Fix the way the ELF size is compared to ensure that incorrectly sized ELF binaries are captured during the file scan. lib/oe/qa.py is changed to accept a bitsize as a parameter. Instead of previously defining true/false, it now takes "0" undefined, "32" 32-bit, and "64" 64-bit as the size argument. This allows us to preserve existing behavior of only loading one ELF type, while allowing the function to be able to discover the size on it's own. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-05-06lib/oe: Import oe lib from OE.devJoshua Lock
This library moves the common Python methods into modules of an 'oe' Python package. Signed-off-by: Joshua Lock <josh@linux.intel.com>