core: fix generation of tee.bin
Prior to this patch generation of tee.bin (CFG_WITH_PAGER=n) fails with:
GEN out/core/tee.bin
Cannot find symbol __init_end
core/arch/arm/kernel/link.mk:183: recipe for target 'out/core/tee.bin' failed
Introduce a special __get_tee_init_end to fix this and also avoid
confusion with __init_end used in the code for the pager case.
Fixes: 5dd1570ac5b0 ("core: add embedded data region")
Acked-by: Jerome Forissier <jerome@forissier.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
diff --git a/core/arch/arm/kernel/kern.ld.S b/core/arch/arm/kernel/kern.ld.S
index 1890418..6a87326 100644
--- a/core/arch/arm/kernel/kern.ld.S
+++ b/core/arch/arm/kernel/kern.ld.S
@@ -334,6 +334,7 @@
__rodata_init_end = .;
__init_end = ROUNDUP(__rodata_init_end, SMALL_PAGE_SIZE);
+ __get_tee_init_end = __init_end;
__init_size = __init_end - __init_start;
/* vcore flat map stops here. No need to page align, rodata follows. */
@@ -406,6 +407,7 @@
#ifndef CFG_WITH_PAGER
__flatmap_unpg_rw_size = _end_of_ram - __flatmap_unpg_rw_start;
+ __get_tee_init_end = .;
#endif
/*
diff --git a/scripts/gen_tee_bin.py b/scripts/gen_tee_bin.py
index af7e948..5d1d2ac 100755
--- a/scripts/gen_tee_bin.py
+++ b/scripts/gen_tee_bin.py
@@ -270,7 +270,7 @@
pager_bin_size = len(pager_bin)
paged_area_size = len(pageable_bin)
- init_mem_usage = (get_symbol(elffile, '__init_end')['st_value'] -
+ init_mem_usage = (get_symbol(elffile, '__get_tee_init_end')['st_value'] -
get_symbol(elffile, '__text_start')['st_value'] +
len(embdata_bin))