[PATCH 1/1] RISC-V: Add sbss section in linker script

76 views
Skip to first unread message

Tan En De

unread,
Dec 18, 2023, 10:56:53 AM12/18/23
to xvisor...@googlegroups.com, Tan En De
Besides bss section, sbss section also needs to be zeroed out during startup.

Signed-off-by: Tan En De <ende...@starfivetech.com>
---
arch/riscv/cpu/generic/linker.ld | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/riscv/cpu/generic/linker.ld b/arch/riscv/cpu/generic/linker.ld
index 47a493f4..6652a6ae 100755
--- a/arch/riscv/cpu/generic/linker.ld
+++ b/arch/riscv/cpu/generic/linker.ld
@@ -156,6 +156,8 @@ SECTIONS
PROVIDE(_bss_start = .);
*(.bss)
*(.bss.*)
+ *(.sbss)
+ *(.sbss.*)
. = ALIGN(8);
PROVIDE(_bss_end = .);
}
--
2.34.1

Anup Patel

unread,
Jan 5, 2024, 6:35:26 AM1/5/24
to xvisor...@googlegroups.com, Tan En De
On Mon, Dec 18, 2023 at 9:26 PM Tan En De <ende...@gmail.com> wrote:
>
> Besides bss section, sbss section also needs to be zeroed out during startup.
>
> Signed-off-by: Tan En De <ende...@starfivetech.com>

LGTM.

Reviewed-by: Anup Patel <an...@brainfault.org>

Applied this patch to the xvisor-next tree.

Thanks,
Anup

> ---
> arch/riscv/cpu/generic/linker.ld | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/riscv/cpu/generic/linker.ld b/arch/riscv/cpu/generic/linker.ld
> index 47a493f4..6652a6ae 100755
> --- a/arch/riscv/cpu/generic/linker.ld
> +++ b/arch/riscv/cpu/generic/linker.ld
> @@ -156,6 +156,8 @@ SECTIONS
> PROVIDE(_bss_start = .);
> *(.bss)
> *(.bss.*)
> + *(.sbss)
> + *(.sbss.*)
> . = ALIGN(8);
> PROVIDE(_bss_end = .);
> }
> --
> 2.34.1
>
> --
> You received this message because you are subscribed to the Google Groups "Xvisor Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to xvisor-devel...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/xvisor-devel/20231218155549.198-1-ende.tan%40starfivetech.com.
Reply all
Reply to author
Forward
0 new messages