From d9c48563a1d4895ced6442f01973f112f4b428c3 Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Mon, 19 Jun 2017 12:47:55 -0700 Subject: [PATCH] check_link_map: fix check for app memory This script was assuming that all XIP data copied sections were contiguous. However with application memory partitioning enabled, this is not the case; in between the kernel data sections and the app data sections will be the kernel's BSS and noinit. As a quick fix, reset the last section compared if we encounter the kernel's BSS section. Signed-off-by: Andrew Boie --- scripts/check_link_map.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/check_link_map.py b/scripts/check_link_map.py index dcc45ce1d63..897afa055d1 100755 --- a/scripts/check_link_map.py +++ b/scripts/check_link_map.py @@ -25,7 +25,7 @@ import sys section_re = re.compile('(?x)' # (allow whitespace) '^([a-zA-Z0-9_\.]+) \s+' # name ' (0x[0-9a-f]+) \s+' # addr - ' (0x[0-9a-f]+) \s+') # size + ' (0x[0-9a-f]+)\s*') # size load_addr_re = re.compile('load address (0x[0-9a-f]+)') @@ -45,6 +45,13 @@ for line in fileinput.input(): vma = int(match.group(2), 16) size = int(match.group(3), 16) + if (sec == "bss"): + # Make sure we don't compare the last section of kernel data + # with the first section of application data, the kernel's bss + # and noinit are in between. + last_sec = None + continue + lmatch = load_addr_re.search(line.rstrip()) if lmatch: lma = int(lmatch.group(1), 16)