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 <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2017-06-19 12:47:55 -07:00 committed by Anas Nashif
commit d9c48563a1

View file

@ -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)