Skip to content

Commit 3b90b09

Browse files
Alexandre Ghitipalmer-dabbelt
authored andcommitted
riscv: Fix orphan section warnings caused by kernel/pi
kernel/pi gives rise to a lot of new sections that end up orphans: the first attempt to fix that tried to enumerate them all in the linker script, but kernel test robot with a random config keeps finding more of them. So prefix all those sections with .init.pi instead of only .init in order to be able to easily catch them all in the linker script. Reported-by: kernel test robot <lkp@intel.com> Link: https://lore.kernel.org/oe-kbuild-all/202304301606.Cgp113Ha-lkp@intel.com/ Fixes: 26e7aac ("riscv: Allow to downgrade paging mode from the command line") Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com> Link: https://lore.kernel.org/r/20230504120759.18730-1-alexghiti@rivosinc.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent ac9a786 commit 3b90b09

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

arch/riscv/kernel/pi/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ KCOV_INSTRUMENT := n
2222

2323
$(obj)/%.pi.o: OBJCOPYFLAGS := --prefix-symbols=__pi_ \
2424
--remove-section=.note.gnu.property \
25-
--prefix-alloc-sections=.init
25+
--prefix-alloc-sections=.init.pi
2626
$(obj)/%.pi.o: $(obj)/%.o FORCE
2727
$(call if_changed,objcopy)
2828

arch/riscv/kernel/vmlinux.lds.S

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,8 @@ SECTIONS
8484
__init_data_begin = .;
8585
INIT_DATA_SECTION(16)
8686

87-
/* Those sections result from the compilation of kernel/pi/string.c */
88-
.init.pidata : {
89-
*(.init.srodata.cst8*)
90-
*(.init__bug_table*)
91-
*(.init.sdata*)
87+
.init.pi : {
88+
*(.init.pi*)
9289
}
9390

9491
.init.bss : {

0 commit comments

Comments
 (0)