summaryrefslogtreecommitdiffstats
path: root/purgatory
diff options
context:
space:
mode:
authorMike Frysinger <vapier@chromium.org>2015-04-16 03:39:26 -0400
committerSimon Horman <horms@verge.net.au>2015-04-30 14:04:08 +0900
commit4a837c9a19f9d5f07778906c6fe64d429d7c1ed7 (patch)
treedc90e23efd99be61828098f5e8618b885c140026 /purgatory
parent458e81576530d47a1b0abd734645635e5691000d (diff)
downloadkexec-tools-4a837c9a19f9d5f07778906c6fe64d429d7c1ed7.tar.gz
purgatory: force PIC/PIE/SSP off
If the toolchain has these things turned on automatically, then the purgatory code might be miscompiled leading to runtime errors like: Unhandled rela relocation: R_X86_64_GOTPC64 It might look like the problem is with the kernel when in reality, kexec is complaining about the purgatory module. Force off harden features that don't make sense in kernel space. Signed-off-by: Mike Frysinger <vapier@chromium.org> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'purgatory')
-rw-r--r--purgatory/Makefile3
-rw-r--r--purgatory/arch/ppc64/Makefile2
-rw-r--r--purgatory/arch/s390/Makefile1
3 files changed, 3 insertions, 3 deletions
diff --git a/purgatory/Makefile b/purgatory/Makefile
index 2d6b2c02..2b5c061d 100644
--- a/purgatory/Makefile
+++ b/purgatory/Makefile
@@ -49,7 +49,8 @@ $(PURGATORY): CC=$(TARGET_CC)
$(PURGATORY): CFLAGS+=$(PURGATORY_EXTRA_CFLAGS) \
$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
-Os -fno-builtin -ffreestanding \
- -fno-zero-initialized-in-bss
+ -fno-zero-initialized-in-bss \
+ -fno-PIC -fno-PIE -fno-stack-protector
$(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
-I$(srcdir)/purgatory/include \
diff --git a/purgatory/arch/ppc64/Makefile b/purgatory/arch/ppc64/Makefile
index 6c58fa20..8ca2719f 100644
--- a/purgatory/arch/ppc64/Makefile
+++ b/purgatory/arch/ppc64/Makefile
@@ -9,7 +9,7 @@ ppc64_PURGATORY_SRCS += purgatory/arch/ppc64/console-ppc64.c
ppc64_PURGATORY_SRCS += purgatory/arch/ppc64/crashdump_backup.c
ppc64_PURGATORY_SRCS += purgatory/arch/ppc64/misc.S
-ppc64_PURGATORY_EXTRA_CFLAGS += -m64 -msoft-float -fno-stack-protector \
+ppc64_PURGATORY_EXTRA_CFLAGS += -m64 -msoft-float \
-fno-exceptions
ppc64_PURGATORY_EXTRA_ASFLAGS += -m64
ifeq ($(SUBARCH),BE)
diff --git a/purgatory/arch/s390/Makefile b/purgatory/arch/s390/Makefile
index 09749bd5..c94cc3ce 100644
--- a/purgatory/arch/s390/Makefile
+++ b/purgatory/arch/s390/Makefile
@@ -2,7 +2,6 @@
# Purgatory s390
#
-s390_PURGATORY_EXTRA_CFLAGS += -fno-stack-protector
s390_PURGATORY_SRCS += purgatory/arch/s390/console-s390.c
s390_PURGATORY_SRCS += purgatory/arch/s390/setup-s390.S
s390_PURGATORY_SRCS += purgatory/arch/s390/purgatory-s390.c