diff options
author | Andrew Boie <andrew.p.boie@intel.com> | 2016-03-02 20:40:29 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@zephyrproject.org> | 2016-03-03 10:24:06 +0000 |
commit | 8f0211dcf35998b02ea001d1256feeaab478a012 (patch) | |
tree | 62aff691f4317a6d0ce5c431e83d14a6e2b4d5f4 | |
parent | 80edd833dcd0efcc30f43bfc67133a080f583e12 (diff) |
sanitycheck: fail on footprint analysis of stripped ELFs
These don't have necessary symbol information to determine if the
kernel is XIP or not. Fail instead of giving bogus data.
Change-Id: I87f6eeb5983f5275929e5b8d448a054b83e23d8f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
-rwxr-xr-x | scripts/sanitycheck | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/sanitycheck b/scripts/sanitycheck index 09c6b3350..4c169e0e0 100755 --- a/scripts/sanitycheck +++ b/scripts/sanitycheck @@ -343,7 +343,10 @@ class SizeCalculator: # Search for CONFIG_XIP in the ELF's list of symbols using NM and AWK. # GREP can not be used as it returns an error if the symbol is not found. is_xip_command = "nm " + filename + " | awk '/CONFIG_XIP/ { print $3 }'" - is_xip_output = subprocess.check_output(is_xip_command, shell=True).decode("utf-8") + is_xip_output = subprocess.check_output(is_xip_command, shell=True, + stderr=subprocess.STDOUT).decode("utf-8").strip() + if is_xip_output.endswith("no symbols"): + raise SanityRuntimeError("%s has no symbol information" % filename) self.is_xip = (len(is_xip_output) != 0) self.filename = filename |