[PATCH v2 19/29] ARM: kernel: make vmlinux buildable as a PIE executable
From: Ard Biesheuvel <hidden>
Date: 2017-09-04 19:10:00
On 4 September 2017 at 19:11, Nicolas Pitre [off-list ref] wrote:
On Sun, 3 Sep 2017, Ard Biesheuvel wrote:quoted
Update the build flags and linker script to allow vmlinux to be built as a PIE binary, which retains relocation information about absolute symbol references so that they can be fixed up at runtime. This will be used for implementing KASLR, Cc: Russell King <linux@armlinux.org.uk> Signed-off-by: Ard Biesheuvel <redacted> --- arch/arm/Kconfig | 4 ++++ arch/arm/Makefile | 5 +++++ arch/arm/include/asm/assembler.h | 2 +- arch/arm/kernel/vmlinux.lds.S | 9 +++++++++ include/linux/hidden.h | 20 ++++++++++++++++++++ scripts/module-common.lds | 1 + 6 files changed, 40 insertions(+), 1 deletion(-)diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 61a0cb15067e..300add3b8023 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig@@ -2085,6 +2085,10 @@ config DMI firmware need to be enabled. This would require the DMI subsystem to be enabled much earlier than we do on ARM, which is non-trivial. +config RELOCATABLE + bool + select HAVE_ARCH_PREL32_RELOCATIONS +You should probably make it depend on !XIP_KERNEL.
Indeed.
Other than that Acked-by: Nicolas Pitre <redacted>
Thanks.