Message ID | 20200811173655.1162093-1-nivedita@alum.mit.edu |
---|---|
State | New |
Headers | show |
Series | x86/boot/compressed: Disable relocation relaxation for non-pie link | expand |
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index 3962f592633d..c5449bea58ec 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -62,6 +62,12 @@ KBUILD_LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \ endif LDFLAGS_vmlinux := -T +# Disable relocation relaxation if not linking as PIE +ifeq ($(filter -pie,$(KBUILD_LDFLAGS)),) +KBUILD_CFLAGS += $(call as-option, -Wa$(comma)-mrelax-relocations=no) +KBUILD_AFLAGS += $(call as-option, -Wa$(comma)-mrelax-relocations=no) +endif + hostprogs := mkpiggy HOST_EXTRACFLAGS += -I$(srctree)/tools/include