diff options
author | Dino Li <Dino.Li@ite.com.tw> | 2021-08-03 14:27:35 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-08-06 05:30:25 +0000 |
commit | 541b1e14b731bc50b796fcc6ce9a1381070a253c (patch) | |
tree | 3e8737c13cbb9d91d81c2ccf63fe91cfbc61dfe5 /zephyr/linker | |
parent | 455838473dd92e2ca09ae720e2b76bb33ad5eff6 (diff) | |
download | chrome-ec-541b1e14b731bc50b796fcc6ce9a1381070a253c.tar.gz |
zephyr: linker: riscv: provide __image_size symbol
This makes riscv core providing __image_size symbol for
calculating hash.
BRANCH=none
BUG=b:194794622
TEST=__image_size is equal to ro/rw binarys' size.
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Change-Id: I7ffd8da6d0bb94362cb137458bf9962a5cf69c62
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3066837
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/linker')
-rw-r--r-- | zephyr/linker/image_size.ld | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/zephyr/linker/image_size.ld b/zephyr/linker/image_size.ld index ab6935718a..fad555e499 100644 --- a/zephyr/linker/image_size.ld +++ b/zephyr/linker/image_size.ld @@ -6,6 +6,9 @@ #if defined(CONFIG_CPU_CORTEX_M) || defined(CONFIG_CPU_CORTEX_R) || \ defined(CONFIG_CPU_CORTEX_A) __image_size = _flash_used; +#elif defined(CONFIG_RISCV) +/* Firmware binary size is text + rodata + data in rom. */ +__image_size = _image_rom_size + (__data_ram_end - __data_ram_start); #else /* * Intentionally set to 0. Some components, such as EFS2, need this value. |