summaryrefslogtreecommitdiff
path: root/arch/s390/Makefile
diff options
context:
space:
mode:
authorGerald Schaefer <gerald.schaefer@de.ibm.com>2019-02-03 23:35:45 +0300
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2019-04-29 11:47:10 +0300
commit805bc0bc238f7209fca5e39c152b0d3c12046ac9 (patch)
tree97edfcee4981bc71c2e6a9dc853353010ac4fa94 /arch/s390/Makefile
parent833b441ec0f6f3c57cc2106ef628bb19d8fb0ee2 (diff)
downloadlinux-805bc0bc238f7209fca5e39c152b0d3c12046ac9.tar.xz
s390/kernel: build a relocatable kernel
This patch adds support for building a relocatable kernel with -fPIE. The kernel will be relocated to 0 early in the boot process. Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Reviewed-by: Philipp Rudo <prudo@linux.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/Makefile')
-rw-r--r--arch/s390/Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/s390/Makefile b/arch/s390/Makefile
index 9c079a506325..54b8a12d64e8 100644
--- a/arch/s390/Makefile
+++ b/arch/s390/Makefile
@@ -16,6 +16,10 @@ KBUILD_AFLAGS_MODULE += -fPIC
KBUILD_CFLAGS_MODULE += -fPIC
KBUILD_AFLAGS += -m64
KBUILD_CFLAGS += -m64
+ifeq ($(CONFIG_RELOCATABLE),y)
+KBUILD_CFLAGS += -fPIE
+LDFLAGS_vmlinux := -pie
+endif
aflags_dwarf := -Wa,-gdwarf-2
KBUILD_AFLAGS_DECOMPRESSOR := -m64 -D__ASSEMBLY__
KBUILD_AFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),$(aflags_dwarf))