From 275e6e1ee2bafde77e9390b27e876fa83f24cb60 Mon Sep 17 00:00:00 2001 From: Paolo 'Blaisorblade' Giarrusso Date: Mon, 1 May 2006 12:16:04 -0700 Subject: [PATCH] uml: fix compilation and execution with hardened GCC To make some half-assembly stubs compile, disable various "hardened" GCC features: *) we can't make it build PIC code as we need %ebx to do syscalls and GCC wants it free for PIC *) we can't leave stack protection as the stub is moved (not relocated!) in memory so the RIP-relative access to the canary tries reading from an unmapped address and causes a segfault, since we move the stub of various megabytes (the exact amount will be decided at runtime) away from the link-time address. Signed-off-by: Paolo 'Blaisorblade' Giarrusso Acked-by: Jeff Dike Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/um/sys-x86_64/Makefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/um/sys-x86_64') diff --git a/arch/um/sys-x86_64/Makefile b/arch/um/sys-x86_64/Makefile index f739bea3519..6d3b29c7453 100644 --- a/arch/um/sys-x86_64/Makefile +++ b/arch/um/sys-x86_64/Makefile @@ -21,6 +21,8 @@ USER_OBJS := ptrace_user.o sigcontext.o stub_segv.o USER_OBJS += user-offsets.s extra-y += user-offsets.s +CFLAGS_stub_segv.o := $(CFLAGS_NO_HARDENING) + extra-$(CONFIG_MODE_TT) += unmap.o include arch/um/scripts/Makefile.rules -- cgit v1.2.3