diff mbox series

RISC-V: Stop putting .sbss in .sdata

Message ID 20200218212501.85799-1-palmer@dabbelt.com (mailing list archive)
State New, archived
Headers show
Series RISC-V: Stop putting .sbss in .sdata | expand

Commit Message

Palmer Dabbelt Feb. 18, 2020, 9:25 p.m. UTC
From: Palmer Dabbelt <palmerdabbelt@google.com>

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.

Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
---
 arch/riscv/kernel/vmlinux.lds.S | 1 -
 1 file changed, 1 deletion(-)

Comments

Zong Li Feb. 19, 2020, 9:26 a.m. UTC | #1
On Wed, Feb 19, 2020 at 5:26 AM Palmer Dabbelt <palmer@dabbelt.com> wrote:
>
> From: Palmer Dabbelt <palmerdabbelt@google.com>
>
> 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.
>
> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
> ---
>  arch/riscv/kernel/vmlinux.lds.S | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S
> index 1e0193ded420..a8fb52a00295 100644
> --- a/arch/riscv/kernel/vmlinux.lds.S
> +++ b/arch/riscv/kernel/vmlinux.lds.S
> @@ -64,7 +64,6 @@ SECTIONS
>                 *(.sdata*)
>                 /* End of data section */
>                 _edata = .;
> -               *(.sbss*)
>         }
>
>         BSS_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 <zong.li@sifive.com>
Palmer Dabbelt Feb. 19, 2020, 6:32 p.m. UTC | #2
On Wed, 19 Feb 2020 01:26:09 PST (-0800), zong.li@sifive.com wrote:
> On Wed, Feb 19, 2020 at 5:26 AM Palmer Dabbelt <palmer@dabbelt.com> wrote:
>>
>> From: Palmer Dabbelt <palmerdabbelt@google.com>
>>
>> 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.
>>
>> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
>> ---
>>  arch/riscv/kernel/vmlinux.lds.S | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S
>> index 1e0193ded420..a8fb52a00295 100644
>> --- a/arch/riscv/kernel/vmlinux.lds.S
>> +++ b/arch/riscv/kernel/vmlinux.lds.S
>> @@ -64,7 +64,6 @@ SECTIONS
>>                 *(.sdata*)
>>                 /* End of data section */
>>                 _edata = .;
>> -               *(.sbss*)
>>         }
>>
>>         BSS_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 <zong.li@sifive.com>

Thanks!
diff mbox series

Patch

diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S
index 1e0193ded420..a8fb52a00295 100644
--- a/arch/riscv/kernel/vmlinux.lds.S
+++ b/arch/riscv/kernel/vmlinux.lds.S
@@ -64,7 +64,6 @@  SECTIONS
 		*(.sdata*)
 		/* End of data section */
 		_edata = .;
-		*(.sbss*)
 	}
 
 	BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0)