diff mbox series

[-fixes] riscv: Move .rela.dyn to the init sections

Message ID 20230428120932.22735-1-alexghiti@rivosinc.com (mailing list archive)
State Accepted
Commit 4db9e253e7016e6588620ad02d4ed326107506db
Headers show
Series [-fixes] riscv: Move .rela.dyn to the init sections | expand

Checks

Context Check Description
conchuod/cover_letter success Single patches do not need cover letters
conchuod/tree_selection success Guessed tree name to be for-next at HEAD 3ec1aafb0ff9
conchuod/fixes_present success Fixes tag not required for -next series
conchuod/maintainers_pattern success MAINTAINERS pattern errors before the patch: 1 and now 1
conchuod/verify_signedoff success Signed-off-by tag matches author and committer
conchuod/kdoc success Errors and warnings before: 0 this patch: 0
conchuod/build_rv64_clang_allmodconfig success Errors and warnings before: 18 this patch: 18
conchuod/module_param success Was 0 now: 0
conchuod/build_rv64_gcc_allmodconfig success Errors and warnings before: 18 this patch: 18
conchuod/build_rv32_defconfig success Build OK
conchuod/dtb_warn_rv64 success Errors and warnings before: 3 this patch: 3
conchuod/header_inline success No static functions without inline keyword in header files
conchuod/checkpatch success total: 0 errors, 0 warnings, 0 checks, 24 lines checked
conchuod/source_inline success Was 0 now: 0
conchuod/build_rv64_nommu_k210_defconfig success Build OK
conchuod/verify_fixes success Fixes tag looks correct
conchuod/build_rv64_nommu_virt_defconfig success Build OK

Commit Message

Alexandre Ghiti April 28, 2023, 12:09 p.m. UTC
The recent introduction of relocatable kernels prepared the move of
.rela.dyn to the init section, but actually forgot to do so, so do it
here.

Before this patch: "Freeing unused kernel image (initmem) memory: 2592K"
After this patch:  "Freeing unused kernel image (initmem) memory: 6288K"

The difference corresponds to the size of the .rela.dyn section:
"[42] .rela.dyn         RELA             ffffffff8197e798  0127f798
       000000000039c660  0000000000000018   A      47     0     8"

Fixes: 559d1e45a16d ("riscv: Use --emit-relocs in order to move .rela.dyn in init")
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
---
 arch/riscv/kernel/vmlinux.lds.S | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Palmer Dabbelt May 2, 2023, 12:19 a.m. UTC | #1
On Fri, 28 Apr 2023 14:09:32 +0200, Alexandre Ghiti wrote:
> The recent introduction of relocatable kernels prepared the move of
> .rela.dyn to the init section, but actually forgot to do so, so do it
> here.
> 
> Before this patch: "Freeing unused kernel image (initmem) memory: 2592K"
> After this patch:  "Freeing unused kernel image (initmem) memory: 6288K"
> 
> [...]

Applied, thanks!

[1/1] riscv: Move .rela.dyn to the init sections
      https://git.kernel.org/palmer/c/4db9e253e701

Best regards,
patchwork-bot+linux-riscv@kernel.org May 8, 2023, 2:41 p.m. UTC | #2
Hello:

This patch was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <palmer@rivosinc.com>:

On Fri, 28 Apr 2023 14:09:32 +0200 you wrote:
> The recent introduction of relocatable kernels prepared the move of
> .rela.dyn to the init section, but actually forgot to do so, so do it
> here.
> 
> Before this patch: "Freeing unused kernel image (initmem) memory: 2592K"
> After this patch:  "Freeing unused kernel image (initmem) memory: 6288K"
> 
> [...]

Here is the summary with links:
  - [-fixes] riscv: Move .rela.dyn to the init sections
    https://git.kernel.org/riscv/c/4db9e253e701

You are awesome, thank you!
diff mbox series

Patch

diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S
index 305877d85e96..f03b5697f8e0 100644
--- a/arch/riscv/kernel/vmlinux.lds.S
+++ b/arch/riscv/kernel/vmlinux.lds.S
@@ -104,6 +104,12 @@  SECTIONS
 		*(.rel.dyn*)
 	}
 
+	.rela.dyn : ALIGN(8) {
+		__rela_dyn_start = .;
+		*(.rela .rela*)
+		__rela_dyn_end = .;
+	}
+
 	__init_data_end = .;
 
 	. = ALIGN(8);
@@ -130,12 +136,6 @@  SECTIONS
 		*(.sdata*)
 	}
 
-	.rela.dyn : ALIGN(8) {
-		__rela_dyn_start = .;
-		*(.rela .rela*)
-		__rela_dyn_end = .;
-	}
-
 	.got : { *(.got*) }
 
 #ifdef CONFIG_RELOCATABLE