diff mbox series

[1/4] riscv: lds: define RUNTIME_DISCARD_EXIT

Message ID 20230116154800.2396-2-jszhang@kernel.org (mailing list archive)
State Superseded
Delegated to: Palmer Dabbelt
Headers show
Series riscv: improve link and support ARCH_WANT_LD_ORPHAN_WARN | expand

Checks

Context Check Description
conchuod/patch_count success Link
conchuod/cover_letter success Series has a cover letter
conchuod/tree_selection success Guessed tree name to be for-next
conchuod/fixes_present success Fixes tag not required for -next series
conchuod/maintainers_pattern success MAINTAINERS pattern errors before the patch: 13 and now 13
conchuod/verify_signedoff success Signed-off-by tag matches author and committer
conchuod/kdoc success Errors and warnings before: 0 this patch: 0
conchuod/module_param success Was 0 now: 0
conchuod/build_rv64_gcc_allmodconfig success Errors and warnings before: 0 this patch: 0
conchuod/alphanumeric_selects success Out of order selects before the patch: 57 and now 57
conchuod/build_rv32_defconfig success Build OK
conchuod/dtb_warn_rv64 success Errors and warnings before: 4 this patch: 4
conchuod/header_inline success No static functions without inline keyword in header files
conchuod/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
conchuod/source_inline success Was 0 now: 0
conchuod/build_rv64_nommu_k210_defconfig success Build OK
conchuod/verify_fixes success No Fixes tag
conchuod/build_rv64_nommu_virt_defconfig success Build OK

Commit Message

Jisheng Zhang Jan. 16, 2023, 3:47 p.m. UTC
riscv discards .exit.* sections at run-time but doesn't define
RUNTIME_DISCARD_EXIT. However, the .exit.* sections are still allocated
and kept even if the generic DISCARDS would discard the sections due
to missing RUNTIME_DISCARD_EXIT, because the DISCARD sits at the end of
the linker script. Add the missing RUNTIME_DISCARD_EXIT define so that
it still works if we move DISCARD up or even at the beginning of the
linker script.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Suggested-by: Masahiro Yamada <masahiroy@kernel.org>
---
 arch/riscv/kernel/vmlinux.lds.S | 1 +
 1 file changed, 1 insertion(+)

Comments

Conor Dooley Jan. 16, 2023, 4:43 p.m. UTC | #1
On Mon, Jan 16, 2023 at 11:47:57PM +0800, Jisheng Zhang wrote:
> riscv discards .exit.* sections at run-time but doesn't define
> RUNTIME_DISCARD_EXIT. However, the .exit.* sections are still allocated
> and kept even if the generic DISCARDS would discard the sections due
> to missing RUNTIME_DISCARD_EXIT, because the DISCARD sits at the end of
> the linker script. Add the missing RUNTIME_DISCARD_EXIT define so that
> it still works if we move DISCARD up or even at the beginning of the
> linker script.
> 
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> Suggested-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
>  arch/riscv/kernel/vmlinux.lds.S | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S
> index 4e6c88aa4d87..07c19f2a288c 100644
> --- a/arch/riscv/kernel/vmlinux.lds.S
> +++ b/arch/riscv/kernel/vmlinux.lds.S
> @@ -5,6 +5,7 @@
>   */
>  
>  #define RO_EXCEPTION_TABLE_ALIGN	4
> +#define RUNTIME_DISCARD_EXIT
>  
>  #ifdef CONFIG_XIP_KERNEL
>  #include "vmlinux-xip.lds.S"

Since the diff is identical to:
https://patchwork.kernel.org/project/linux-riscv/patch/20230102124936.1363533-1-conor@kernel.org/
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Your commit message is better anyways.

Thanks,
Conor.
Jisheng Zhang Jan. 17, 2023, 12:06 a.m. UTC | #2
On Mon, Jan 16, 2023 at 04:43:05PM +0000, Conor Dooley wrote:
> On Mon, Jan 16, 2023 at 11:47:57PM +0800, Jisheng Zhang wrote:
> > riscv discards .exit.* sections at run-time but doesn't define
> > RUNTIME_DISCARD_EXIT. However, the .exit.* sections are still allocated
> > and kept even if the generic DISCARDS would discard the sections due
> > to missing RUNTIME_DISCARD_EXIT, because the DISCARD sits at the end of
> > the linker script. Add the missing RUNTIME_DISCARD_EXIT define so that
> > it still works if we move DISCARD up or even at the beginning of the
> > linker script.
> > 
> > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> > Suggested-by: Masahiro Yamada <masahiroy@kernel.org>
> > ---
> >  arch/riscv/kernel/vmlinux.lds.S | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S
> > index 4e6c88aa4d87..07c19f2a288c 100644
> > --- a/arch/riscv/kernel/vmlinux.lds.S
> > +++ b/arch/riscv/kernel/vmlinux.lds.S
> > @@ -5,6 +5,7 @@
> >   */
> >  
> >  #define RO_EXCEPTION_TABLE_ALIGN	4
> > +#define RUNTIME_DISCARD_EXIT
> >  
> >  #ifdef CONFIG_XIP_KERNEL
> >  #include "vmlinux-xip.lds.S"
> 
> Since the diff is identical to:
> https://patchwork.kernel.org/project/linux-riscv/patch/20230102124936.1363533-1-conor@kernel.org/

OOPS, I didn't notice you submitted the patch which did similar
about RUNTIME_DISCARD_EXIT, then I'd like to recall patch1. I
expected some review comments for remainning patch2\3\4, I will
send v2 which will both address possible review comments and
remove patch1

> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
> Your commit message is better anyways.

If you like it, you can take it into your v2 patch;)

Thanks
Conor Dooley Jan. 17, 2023, 6:27 a.m. UTC | #3
On 17 January 2023 00:06:06 GMT, Jisheng Zhang <jszhang@kernel.org> wrote:
>On Mon, Jan 16, 2023 at 04:43:05PM +0000, Conor Dooley wrote:
>> On Mon, Jan 16, 2023 at 11:47:57PM +0800, Jisheng Zhang wrote:
>> > riscv discards .exit.* sections at run-time but doesn't define
>> > RUNTIME_DISCARD_EXIT. However, the .exit.* sections are still allocated
>> > and kept even if the generic DISCARDS would discard the sections due
>> > to missing RUNTIME_DISCARD_EXIT, because the DISCARD sits at the end of
>> > the linker script. Add the missing RUNTIME_DISCARD_EXIT define so that
>> > it still works if we move DISCARD up or even at the beginning of the
>> > linker script.
>> > 
>> > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
>> > Suggested-by: Masahiro Yamada <masahiroy@kernel.org>
>> > ---
>> >  arch/riscv/kernel/vmlinux.lds.S | 1 +
>> >  1 file changed, 1 insertion(+)
>> > 
>> > diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S
>> > index 4e6c88aa4d87..07c19f2a288c 100644
>> > --- a/arch/riscv/kernel/vmlinux.lds.S
>> > +++ b/arch/riscv/kernel/vmlinux.lds.S
>> > @@ -5,6 +5,7 @@
>> >   */
>> >  
>> >  #define RO_EXCEPTION_TABLE_ALIGN	4
>> > +#define RUNTIME_DISCARD_EXIT
>> >  
>> >  #ifdef CONFIG_XIP_KERNEL
>> >  #include "vmlinux-xip.lds.S"
>> 
>> Since the diff is identical to:
>> https://patchwork.kernel.org/project/linux-riscv/patch/20230102124936.1363533-1-conor@kernel.org/
>
>OOPS, I didn't notice you submitted the patch which did similar
>about RUNTIME_DISCARD_EXIT, then I'd like to recall patch1. I
>expected some review comments for remainning patch2\3\4, I will
>send v2 which will both address possible review comments and
>remove patch1

Nah, keep your patch in the series.
I'll mark mine as superseded in patchwork.
diff mbox series

Patch

diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S
index 4e6c88aa4d87..07c19f2a288c 100644
--- a/arch/riscv/kernel/vmlinux.lds.S
+++ b/arch/riscv/kernel/vmlinux.lds.S
@@ -5,6 +5,7 @@ 
  */
 
 #define RO_EXCEPTION_TABLE_ALIGN	4
+#define RUNTIME_DISCARD_EXIT
 
 #ifdef CONFIG_XIP_KERNEL
 #include "vmlinux-xip.lds.S"