Skip to content

Commit 2aff5f9

Browse files
LGA1150palmer-dabbelt
authored andcommitted
riscv: do not select MODULE_SECTIONS by default
Since commit aad15bc ("riscv: Change code model of module to medany to improve data accessing"), kernel modules have not been built with -fPIC, so they wouldn't have R_RISCV_GOT_HI20 or R_RISCV_CALL_PLT relocations, and handling of those relocations is unnecessary. If RELOCATABLE=y, kernel modules will be built with -fPIE, which would reintroduce said relocations, so only select MODULE_SECTIONS when RELOCATABLE. Signed-off-by: Qingfang Deng <[email protected]> Reviewed-by: Charlie Jenkins <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 07501c4 commit 2aff5f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ config RISCV
176176
select LOCK_MM_AND_FIND_VMA
177177
select MMU_GATHER_RCU_TABLE_FREE if SMP && MMU
178178
select MODULES_USE_ELF_RELA if MODULES
179-
select MODULE_SECTIONS if MODULES
180179
select OF
181180
select OF_EARLY_FLATTREE
182181
select OF_IRQ
@@ -867,6 +866,7 @@ config PARAVIRT_TIME_ACCOUNTING
867866
config RELOCATABLE
868867
bool "Build a relocatable kernel"
869868
depends on MMU && 64BIT && !XIP_KERNEL
869+
select MODULE_SECTIONS if MODULES
870870
help
871871
This builds a kernel as a Position Independent Executable (PIE),
872872
which retains all relocation metadata required to relocate the

0 commit comments

Comments
 (0)