]> git.baikalelectronics.ru Git - uboot.git/commitdiff
sandbox: Bring back setting mon_len in global_data
authorSimon Glass <sjg@chromium.org>
Sun, 15 Jan 2023 21:15:40 +0000 (14:15 -0700)
committerTom Rini <trini@konsulko.com>
Sat, 11 Feb 2023 17:22:34 +0000 (12:22 -0500)
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: 685b9ec26e6 ("sandbox: don't refer to symbol _init")
Signed-off-by: Simon Glass <sjg@chromium.org>
common/board_f.c

index 2b4edf30c930f2dfa368169b6893e1e1e825ecb2..f3c1ab53b1c681f919c865c38ce7665a5e6fd994 100644 (file)
@@ -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;