Commit 3b90b09a authored by Alexandre Ghiti's avatar Alexandre Ghiti Committed by Palmer Dabbelt

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: default avatarkernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202304301606.Cgp113Ha-lkp@intel.com/
Fixes: 26e7aacb ("riscv: Allow to downgrade paging mode from the command line")
Signed-off-by: default avatarAlexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20230504120759.18730-1-alexghiti@rivosinc.com
Cc: stable@vger.kernel.org
Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent ac9a7868
...@@ -22,7 +22,7 @@ KCOV_INSTRUMENT := n ...@@ -22,7 +22,7 @@ KCOV_INSTRUMENT := n
$(obj)/%.pi.o: OBJCOPYFLAGS := --prefix-symbols=__pi_ \ $(obj)/%.pi.o: OBJCOPYFLAGS := --prefix-symbols=__pi_ \
--remove-section=.note.gnu.property \ --remove-section=.note.gnu.property \
--prefix-alloc-sections=.init --prefix-alloc-sections=.init.pi
$(obj)/%.pi.o: $(obj)/%.o FORCE $(obj)/%.pi.o: $(obj)/%.o FORCE
$(call if_changed,objcopy) $(call if_changed,objcopy)
......
...@@ -84,11 +84,8 @@ SECTIONS ...@@ -84,11 +84,8 @@ SECTIONS
__init_data_begin = .; __init_data_begin = .;
INIT_DATA_SECTION(16) INIT_DATA_SECTION(16)
/* Those sections result from the compilation of kernel/pi/string.c */ .init.pi : {
.init.pidata : { *(.init.pi*)
*(.init.srodata.cst8*)
*(.init__bug_table*)
*(.init.sdata*)
} }
.init.bss : { .init.bss : {
......
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