diff options
author | Youling Tang <tangyouling@loongson.cn> | 2023-02-25 15:52:56 +0800 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2023-02-25 22:12:16 +0800 |
commit | d8da19fbdedd5852592fbba18a7348e3f09500e6 (patch) | |
tree | a6a4a921da97d0b7379e9034532c8267a14b631e /arch/loongarch/Kconfig | |
parent | 396233c650084cb957eb6d87dd4abd3e56a7d499 (diff) |
LoongArch: Add support for kernel relocation
This config allows to compile kernel as PIE and to relocate it at any
virtual address at runtime: this paves the way to KASLR.
Runtime relocation is possible since relocation metadata are embedded
into the kernel.
Signed-off-by: Youling Tang <tangyouling@loongson.cn>
Signed-off-by: Xi Ruoyao <xry111@xry111.site> # Use arch_initcall
Signed-off-by: Jinyang He <hejinyang@loongson.cn> # Provide la_abs relocation code
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/Kconfig')
-rw-r--r-- | arch/loongarch/Kconfig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index 0c1c6063cc66..32ab90dd76e5 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -493,6 +493,14 @@ config PHYSICAL_START specified in the "crashkernel=YM@XM" command line boot parameter passed to the panic-ed kernel). +config RELOCATABLE + bool "Relocatable kernel" + help + This builds the kernel as a Position Independent Executable (PIE), + which retains all relocation metadata required, so as to relocate + the kernel binary at runtime to a different virtual address from + its link address. + config SECCOMP bool "Enable seccomp to safely compute untrusted bytecode" depends on PROC_FS |