Skip to content

Commit 4db9e25

Browse files
Alexandre Ghitipalmer-dabbelt
authored andcommitted
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: 559d1e4 ("riscv: Use --emit-relocs in order to move .rela.dyn in init") Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com> Link: https://lore.kernel.org/r/20230428120932.22735-1-alexghiti@rivosinc.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 41ebfc9 commit 4db9e25

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

arch/riscv/kernel/vmlinux.lds.S

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ SECTIONS
104104
*(.rel.dyn*)
105105
}
106106

107+
.rela.dyn : ALIGN(8) {
108+
__rela_dyn_start = .;
109+
*(.rela .rela*)
110+
__rela_dyn_end = .;
111+
}
112+
107113
__init_data_end = .;
108114

109115
. = ALIGN(8);
@@ -130,12 +136,6 @@ SECTIONS
130136
*(.sdata*)
131137
}
132138

133-
.rela.dyn : ALIGN(8) {
134-
__rela_dyn_start = .;
135-
*(.rela .rela*)
136-
__rela_dyn_end = .;
137-
}
138-
139139
.got : { *(.got*) }
140140

141141
#ifdef CONFIG_RELOCATABLE

0 commit comments

Comments
 (0)