core: kern.ld.S: move .scattered_array* into .data.rel.ro
Moves the symbols tagged with .scattered_array* from the .rodata output
section into a new output section: .data.rel.ro, which is also writeable
(hence the suppression of __SECTION_FLAGS_RODATA in scattered_array.h)
but placed in tee.elf to be mapped read-only after relocations are
applied. The new section is created only when core ASLR is enabled,
otherwise no relocation can occur and we can keep the previous code.
Signed-off-by: Jerome Forissier <jerome@forissier.org>
Acked-by: Sumit Garg <sumit.garg@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
diff --git a/scripts/gen_tee_bin.py b/scripts/gen_tee_bin.py
index 90688a3..32f347b 100755
--- a/scripts/gen_tee_bin.py
+++ b/scripts/gen_tee_bin.py
@@ -143,8 +143,8 @@
global tee_pager_bin
if tee_pager_bin is None:
pad_to = get_symbol(elffile, '__data_end')['st_value']
- dump_names = re.compile(
- r'^\.(text|nex_data|rodata|got|data|ARM\.exidx|ARM\.extab)$')
+ dump_names = re.compile(r'^\.(text|nex_data|rodata|got|data|'
+ r'data\.rel\.ro|ARM\.exidx|ARM\.extab)$')
tee_pager_bin = get_sections(elffile, pad_to, dump_names)
return tee_pager_bin