[CRIU] [PATCH 05/16] pie: x86-32 -- Build parasite code without PIC

Cyrill Gorcunov gorcunov at openvz.org
Thu Jun 4 14:04:06 PDT 2015


There is no rip addressing in 32bit code but PIE code
require GOT tables and friend which we better escape
for performance sake. So lets use pc relocations it
should do the trick.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 pie/Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pie/Makefile b/pie/Makefile
index 17027b82f217..6ecf253060f1 100644
--- a/pie/Makefile
+++ b/pie/Makefile
@@ -36,7 +36,12 @@ restorer-libs-e		+= $(SYSCALL-LIB)
 #
 CFLAGS			:= $(filter-out -pg,$(CFLAGS))
 
-cflags-y		+= -DCR_NOGLIBC -fpie  -Wa,--noexecstack -fno-stack-protector
+ifneq ($(filter-out i386 ia32, $(ARCH)),)
+cflags-y		+= -DCR_NOGLIBC -fpie -Wa,--noexecstack -fno-stack-protector
+else
+cflags-y		+= -DCR_NOGLIBC -fno-pic -Wa,--noexecstack -fno-stack-protector
+endif
+
 ifeq ($(SRCARCH), arm)
 	cflags-y	+= -marm
 endif
-- 
2.4.2



More information about the CRIU mailing list