RISC-V: Stop putting .sbss in .sdata
Palmer Dabbelt
maintainerPATCH 1/1 RISC-V: Stop putting .sbss in .sdata
From: Palmer Dabbelt <[email protected]>
I don't know why we were doing this, as it's been there since the beginning. After d841f729e655 ("riscv: force hart_lottery to put in .sdata section") my guess would be that it made the kernel boot and we forgot to fix it more cleanly.
The default .bss segment already contains the .sbss section, so we don't need to do anything additional to ensure the symbols in .sbss continue to work.
--- arch/riscv/kernel/vmlinux.lds.S | 1 - 1 file changed, 1 deletion(-)
arch/riscv/kernel/vmlinux.lds.S +0 -1
@@ -64,7 +64,6 @@ SECTIONS *(.sdata*) /* End of data section */ _edata = .; - *(.sbss*) } BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0)
Signature · 1 line
2.25.0.265.gbab2e86ba0-goog
Quoted 29 lines · Palmer Dabbelt
From: Palmer Dabbelt <[email protected]>
I don't know why we were doing this, as it's been there since the beginning. After
d841f729e655("riscv: forcehart_lotteryto put in .sdata section") my guess would be that it made the kernel boot and we forgot to fix it more cleanly.The default .bss segment already contains the .sbss section, so we don't need to do anything additional to ensure the symbols in .sbss continue to work.
Signed-off-by Palmer Dabbelt <[email protected]>--- arch/riscv/kernel/vmlinux.lds.S | 1 - 1 file changed, 1 deletion(-)arch/riscv/kernel/vmlinux.lds.S +0
-2@@ -64,7 +64,6 @@ SECTIONS *(.sdata*) /* End of data section */ _edata = .; - *(.sbss*) } BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0) --
Quoted 2 lines
2.25.0.265.gbab2e86ba0-goog
I had given a quick test for that. It works on RV32 and RV64.
Palmer Dabbelt
maintainerQuoted 28 lines · On Wed, 19 Feb 2020 01:26:09 PST (-0800), [email protected] wrote:
Quoted 27 lines · Palmer Dabbelt
From: Palmer Dabbelt <[email protected]>
I don't know why we were doing this, as it's been there since the beginning. After
d841f729e655("riscv: forcehart_lotteryto put in .sdata section") my guess would be that it made the kernel boot and we forgot to fix it more cleanly.The default .bss segment already contains the .sbss section, so we don't need to do anything additional to ensure the symbols in .sbss continue to work.
Signed-off-by Palmer Dabbelt <[email protected]>--- arch/riscv/kernel/vmlinux.lds.S | 1 - 1 file changed, 1 deletion(-)arch/riscv/kernel/vmlinux.lds.S +0
-1@@ -64,7 +64,6 @@ SECTIONS *(.sdata*) /* End of data section */ _edata = .; - *(.sbss*) }
Quoted 8 lines
Quoted 4 lines
arch/riscv/kernel/vmlinux.lds.S +0
-1BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0) --2.25.0.265.gbab2e86ba0-goog
I had given a quick test for that. It works on RV32 and RV64.
Tested-by Zong Li <[email protected]>
Thanks!