Commit 4db9e253 authored by Alexandre Ghiti's avatar Alexandre Ghiti Committed by Palmer Dabbelt

riscv: Move .rela.dyn to the init sections

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: 559d1e45 ("riscv: Use --emit-relocs in order to move .rela.dyn in init")
Signed-off-by: default avatarAlexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20230428120932.22735-1-alexghiti@rivosinc.com
Cc: stable@vger.kernel.org
Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent 41ebfc91
...@@ -104,6 +104,12 @@ SECTIONS ...@@ -104,6 +104,12 @@ SECTIONS
*(.rel.dyn*) *(.rel.dyn*)
} }
.rela.dyn : ALIGN(8) {
__rela_dyn_start = .;
*(.rela .rela*)
__rela_dyn_end = .;
}
__init_data_end = .; __init_data_end = .;
. = ALIGN(8); . = ALIGN(8);
...@@ -130,12 +136,6 @@ SECTIONS ...@@ -130,12 +136,6 @@ SECTIONS
*(.sdata*) *(.sdata*)
} }
.rela.dyn : ALIGN(8) {
__rela_dyn_start = .;
*(.rela .rela*)
__rela_dyn_end = .;
}
.got : { *(.got*) } .got : { *(.got*) }
#ifdef CONFIG_RELOCATABLE #ifdef CONFIG_RELOCATABLE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment