[1/1] RISC-V: Use __bss_start for the starting point of .bss.

Message ID 20210204073400.14458-1-eddiekuo@andestech.com
State New
Headers show
Series
  • [1/1] RISC-V: Use __bss_start for the starting point of .bss.
Related show

Commit Message

Yeting Kuo Feb. 4, 2021, 7:34 a.m.
From: Yeting Kuo <fakepaper56@gmail.com>


It's more flexible for the positions of .bss and .data.
---
 libgloss/riscv/crt0.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.17.0

Comments

Torbjorn SVENSSON via Newlib Feb. 4, 2021, 8:18 a.m. | #1
The patch is LGTM, good catch, thanks!

On Thu, Feb 4, 2021 at 3:58 PM Yeting Kuo <eddiekuo@andestech.com> wrote:
>

> From: Yeting Kuo <fakepaper56@gmail.com>

>

> It's more flexible for the positions of .bss and .data.

> ---

>  libgloss/riscv/crt0.S | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

>

> diff --git a/libgloss/riscv/crt0.S b/libgloss/riscv/crt0.S

> index 160c07853..7a4e4e32c 100644

> --- a/libgloss/riscv/crt0.S

> +++ b/libgloss/riscv/crt0.S

> @@ -27,7 +27,7 @@ _start:

>  .option pop

>

>    # Clear the bss segment

> -  la      a0, _edata

> +  la      a0, __bss_start

>    la      a2, _end

>    sub     a2, a2, a0

>    li      a1, 0

> --

> 2.17.0

>
Torbjorn SVENSSON via Newlib Feb. 5, 2021, 9:36 a.m. | #2
On Feb  4 15:34, Yeting Kuo wrote:
> From: Yeting Kuo <fakepaper56@gmail.com>

> 

> It's more flexible for the positions of .bss and .data.

> ---

>  libgloss/riscv/crt0.S | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/libgloss/riscv/crt0.S b/libgloss/riscv/crt0.S

> index 160c07853..7a4e4e32c 100644

> --- a/libgloss/riscv/crt0.S

> +++ b/libgloss/riscv/crt0.S

> @@ -27,7 +27,7 @@ _start:

>  .option pop

>  

>    # Clear the bss segment

> -  la      a0, _edata

> +  la      a0, __bss_start

>    la      a2, _end

>    sub     a2, a2, a0

>    li      a1, 0

> -- 

> 2.17.0


Pushed.


Thanks,
Corinna

Patch

diff --git a/libgloss/riscv/crt0.S b/libgloss/riscv/crt0.S
index 160c07853..7a4e4e32c 100644
--- a/libgloss/riscv/crt0.S
+++ b/libgloss/riscv/crt0.S
@@ -27,7 +27,7 @@  _start:
 .option pop
 
   # Clear the bss segment
-  la      a0, _edata
+  la      a0, __bss_start
   la      a2, _end
   sub     a2, a2, a0
   li      a1, 0