[PATCH] riscv: replace select with dependency for visible RELOCATABLE

Julian Braha julianbraha at gmail.com
Sat May 2 21:03:31 PDT 2026


RANDOMIZE_BASE currently selects RELOCATABLE even though RELOCATABLE
is visible to users. Some other architectures, like x86, use 'depends on'
for RELOCATABLE in their definition of RANDOMIZE_BASE, so let's do the same
here.

This select-visible Kconfig misusage was detected by Kconfirm, a static
analysis tool for Kconfig.

Signed-off-by: Julian Braha <julianbraha at gmail.com>
---
 arch/riscv/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index d32309846fa3..da26559a0893 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -1143,7 +1143,7 @@ config RELOCATABLE
 
 config RANDOMIZE_BASE
         bool "Randomize the address of the kernel image"
-        select RELOCATABLE
+        depends on RELOCATABLE
         depends on MMU && 64BIT
         help
           Randomizes the virtual address at which the kernel image is
-- 
2.53.0




More information about the linux-riscv mailing list