mem_usage.py: consider all allocatable sections
All allocatable sections end up using memory when the TEE binary is
loaded. Therefore the 'A' (allocatable) flag in the readelf output is
all that matters when gathering memory usage data using mem_usage.py.
The combinations that are currently hardcoded in the script ('AX',
'WA', 'A', 'AL') are fragile and need to be replaced. For example, with
COMPILER=clang many sections have the 'W' flag set.
Signed-off-by: Jerome Forissier <jerome@forissier.org>
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
diff --git a/scripts/mem_usage.py b/scripts/mem_usage.py
index fbf96a4..e4c4c97 100755
--- a/scripts/mem_usage.py
+++ b/scripts/mem_usage.py
@@ -118,8 +118,7 @@
flags) = words[:8]
except BaseException:
continue
- if (flags == 'AX' or flags == 'WA' or flags == 'A' or
- flags == 'AL'):
+ if ('A' in flags):
sects.append({'name': name, 'addr': addr,
'offs': offs, 'size': size})
first_addr = None