summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-01-15 14:15:40 -0700
committerTom Rini <trini@konsulko.com>2023-02-11 12:22:34 -0500
commit2c88d5e110517ba7565b33eb8bfabb0ae0885eab (patch)
tree9ca3702ccedd72e59f6cb1a744ab0455c6b05fdf /common
parent41cd6fab03af8f1d3fae6ee04937583ab7884efa (diff)
sandbox: Bring back setting mon_len in global_data
This change was made for the benefit of RISC-V but broke other architectures also. In particular, tracing cannot work without this value. Add it back for architectures which support it. Fixes: 3c9fc23c443 ("sandbox: don't refer to symbol _init") Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/board_f.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/board_f.c b/common/board_f.c
index 2b4edf30c9..f3c1ab53b1 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -290,7 +290,10 @@ static int setup_mon_len(void)
{
#if defined(__ARM__) || defined(__MICROBLAZE__)
gd->mon_len = (ulong)&__bss_end - (ulong)_start;
+#elif defined(CONFIG_SANDBOX) && !defined(__riscv)
+ gd->mon_len = (ulong)&_end - (ulong)_init;
#elif defined(CONFIG_SANDBOX)
+ /* gcc does not provide _init in crti.o on RISC-V */
gd->mon_len = 0;
#elif defined(CONFIG_EFI_APP)
gd->mon_len = (ulong)&_end - (ulong)_init;