From 8f0211dcf35998b02ea001d1256feeaab478a012 Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Wed, 2 Mar 2016 20:40:29 -0800 Subject: 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 --- scripts/sanitycheck | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3