All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/1] sandbox: don't refer to symbol _init
@ 2021-05-19 10:02 Heinrich Schuchardt
       [not found] ` <752D002CFF5D0F4FA35C0100F1D73F3FE5EA3D5C@ATCPCS12.andestech.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Heinrich Schuchardt @ 2021-05-19 10:02 UTC (permalink / raw)
  To: u-boot

GCC provides a symbol _init in crti.o on x86_64 and aarch64 but not on
RISC-V. The following lines leads to a build error for sandbox_defconfig on
RISC-V due to the missing symbol:

    common/board_f.c:269:
    #elif defined(CONFIG_SANDBOX) || defined(CONFIG_EFI_APP)
            gd->mon_len = (ulong)&_end - (ulong)_init;

The sandbox code is not copied into the memory allocated using mmap().
Hence we can safely use gd->mon_len = 0 to avoid the reference to _init.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---
v2:
	fix typo in commit message
---
 common/board_f.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/common/board_f.c b/common/board_f.c
index 203e965799..c1b8e63e56 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -265,7 +265,9 @@ static int setup_mon_len(void)
 {
 #if defined(__ARM__) || defined(__MICROBLAZE__)
 	gd->mon_len = (ulong)&__bss_end - (ulong)_start;
-#elif defined(CONFIG_SANDBOX) || defined(CONFIG_EFI_APP)
+#elif defined(CONFIG_SANDBOX)
+	gd->mon_len = 0;
+#elif defined(CONFIG_EFI_APP)
 	gd->mon_len = (ulong)&_end - (ulong)_init;
 #elif defined(CONFIG_NIOS2) || defined(CONFIG_XTENSA)
 	gd->mon_len = CONFIG_SYS_MONITOR_LEN;
--
2.31.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2 1/1] sandbox: don't refer to symbol _init
       [not found] ` <752D002CFF5D0F4FA35C0100F1D73F3FE5EA3D5C@ATCPCS12.andestech.com>
@ 2021-05-20  3:21   ` Rick Chen
  2021-07-04 20:15   ` Simon Glass
  1 sibling, 0 replies; 3+ messages in thread
From: Rick Chen @ 2021-05-20  3:21 UTC (permalink / raw)
  To: u-boot

> From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Heinrich Schuchardt
> Sent: Wednesday, May 19, 2021 6:03 PM
> To: Simon Glass <sjg@chromium.org>
> Cc: Ovidiu Panait <ovidiu.panait@windriver.com>; Bin Meng <bmeng.cn@gmail.com>; Stefan Roese <sr@denx.de>; Masahiro Yamada <masahiroy@kernel.org>; u-boot at lists.denx.de; Heinrich Schuchardt <xypron.glpk@gmx.de>
> Subject: [PATCH v2 1/1] sandbox: don't refer to symbol _init
>
> GCC provides a symbol _init in crti.o on x86_64 and aarch64 but not on RISC-V. The following lines leads to a build error for sandbox_defconfig on RISC-V due to the missing symbol:
>
>     common/board_f.c:269:
>     #elif defined(CONFIG_SANDBOX) || defined(CONFIG_EFI_APP)
>             gd->mon_len = (ulong)&_end - (ulong)_init;
>
> The sandbox code is not copied into the memory allocated using mmap().
> Hence we can safely use gd->mon_len = 0 to avoid the reference to _init.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> ---
> v2:
>         fix typo in commit message
> ---
>  common/board_f.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Rick Chen <rick@andestech.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 1/1] sandbox: don't refer to symbol _init
       [not found] ` <752D002CFF5D0F4FA35C0100F1D73F3FE5EA3D5C@ATCPCS12.andestech.com>
  2021-05-20  3:21   ` Rick Chen
@ 2021-07-04 20:15   ` Simon Glass
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2021-07-04 20:15 UTC (permalink / raw)
  To: Rick Chen
  Cc: U-Boot Mailing List, ovidiu.panait, Stefan Roese,
	Masahiro Yamada, Heinrich Schuchardt, rick, Bin Meng,
	Simon Glass

> From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Heinrich Schuchardt
> Sent: Wednesday, May 19, 2021 6:03 PM
> To: Simon Glass <sjg@chromium.org>
> Cc: Ovidiu Panait <ovidiu.panait@windriver.com>; Bin Meng <bmeng.cn@gmail.com>; Stefan Roese <sr@denx.de>; Masahiro Yamada <masahiroy@kernel.org>; u-boot@lists.denx.de; Heinrich Schuchardt <xypron.glpk@gmx.de>
> Subject: [PATCH v2 1/1] sandbox: don't refer to symbol _init
>
> GCC provides a symbol _init in crti.o on x86_64 and aarch64 but not on RISC-V. The following lines leads to a build error for sandbox_defconfig on RISC-V due to the missing symbol:
>
>     common/board_f.c:269:
>     #elif defined(CONFIG_SANDBOX) || defined(CONFIG_EFI_APP)
>             gd->mon_len = (ulong)&_end - (ulong)_init;
>
> The sandbox code is not copied into the memory allocated using mmap().
> Hence we can safely use gd->mon_len = 0 to avoid the reference to _init.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> ---
> v2:
>         fix typo in commit message
> ---
>  common/board_f.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Rick Chen <rick@andestech.com>

Applied to u-boot-dm/next, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-04 20:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 10:02 [PATCH v2 1/1] sandbox: don't refer to symbol _init Heinrich Schuchardt
     [not found] ` <752D002CFF5D0F4FA35C0100F1D73F3FE5EA3D5C@ATCPCS12.andestech.com>
2021-05-20  3:21   ` Rick Chen
2021-07-04 20:15   ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.