[CRIU] [PATCHv2 05/17] x86/pie: split parasite-head.S on {-32, -64} parts

Dmitry Safonov dsafonov at virtuozzo.com
Tue Apr 12 09:10:43 PDT 2016


Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 criu/arch/x86/parasite-head-32.S | 24 ++++++++++++++++++++++++
 criu/arch/x86/parasite-head-64.S | 22 ++++++++++++++++++++++
 criu/arch/x86/parasite-head.S    | 40 ----------------------------------------
 criu/pie/Makefile                |  3 ++-
 4 files changed, 48 insertions(+), 41 deletions(-)
 create mode 100644 criu/arch/x86/parasite-head-32.S
 create mode 100644 criu/arch/x86/parasite-head-64.S
 delete mode 100644 criu/arch/x86/parasite-head.S

diff --git a/criu/arch/x86/parasite-head-32.S b/criu/arch/x86/parasite-head-32.S
new file mode 100644
index 000000000000..cafbe8115bf1
--- /dev/null
+++ b/criu/arch/x86/parasite-head-32.S
@@ -0,0 +1,24 @@
+#include "asm/linkage.h"
+#include "parasite.h"
+
+	.section .head.text, "ax"
+
+#ifndef CONFIG_X86_32
+# error 32-bit parasite should compile with CONFIG_X86_32
+#endif
+
+ENTRY(__export_parasite_head_start)
+	subl	$16, %esp
+	andl	$~15, %esp
+	pushl	$0
+	movl	%esp, %ebp
+	call	1f
+1:	popl	%ecx
+2:	leal	(__export_parasite_cmd-2b)(%ecx), %eax
+	leal	(__export_parasite_args-2b)(%ecx), %edx
+	call	parasite_service
+	int	$0x03
+	.align 8
+GLOBAL(__export_parasite_cmd)
+	.long 0
+END(__export_parasite_head_start)
diff --git a/criu/arch/x86/parasite-head-64.S b/criu/arch/x86/parasite-head-64.S
new file mode 100644
index 000000000000..4cc4d920a2d3
--- /dev/null
+++ b/criu/arch/x86/parasite-head-64.S
@@ -0,0 +1,22 @@
+#include "asm/linkage.h"
+#include "parasite.h"
+
+	.section .head.text, "ax"
+
+#ifndef CONFIG_X86_64
+# error 64-bit parasite should compile with CONFIG_X86_64
+#endif
+
+ENTRY(__export_parasite_head_start)
+	subq	$16, %rsp
+	andq	$~15, %rsp
+	pushq	$0
+	movq	%rsp, %rbp
+	movl	__export_parasite_cmd(%rip), %edi
+	leaq	__export_parasite_args(%rip), %rsi
+	call	parasite_service
+	int	$0x03
+	.align 8
+__export_parasite_cmd:
+	.long 0
+END(__export_parasite_head_start)
diff --git a/criu/arch/x86/parasite-head.S b/criu/arch/x86/parasite-head.S
deleted file mode 100644
index 5fb00a5c87c1..000000000000
--- a/criu/arch/x86/parasite-head.S
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "asm/linkage.h"
-#include "parasite.h"
-
-	.section .head.text, "ax"
-
-#ifdef CONFIG_X86_64
-
-ENTRY(__export_parasite_head_start)
-	subq	$16, %rsp
-	andq	$~15, %rsp
-	pushq	$0
-	movq	%rsp, %rbp
-	movl	__export_parasite_cmd(%rip), %edi
-	leaq	__export_parasite_args(%rip), %rsi
-	call	parasite_service
-	int	$0x03
-	.align 8
-__export_parasite_cmd:
-	.long 0
-END(__export_parasite_head_start)
-
-#else /* CONFIG_X86_64 */
-
-ENTRY(__export_parasite_head_start)
-	subl	$16, %esp
-	andl	$~15, %esp
-	pushl	$0
-	movl	%esp, %ebp
-	call	1f
-1:	popl	%ecx
-2:	leal	(__export_parasite_cmd-2b)(%ecx), %eax
-	leal	(__export_parasite_args-2b)(%ecx), %edx
-	call	parasite_service
-	int	$0x03
-	.align 8
-GLOBAL(__export_parasite_cmd)
-	.long 0
-END(__export_parasite_head_start)
-
-#endif /* CONFIG_X86_64 */
diff --git a/criu/pie/Makefile b/criu/pie/Makefile
index 69a34842ec9c..41997e276690 100644
--- a/criu/pie/Makefile
+++ b/criu/pie/Makefile
@@ -2,16 +2,17 @@ target			+= parasite
 target			+= restorer
 
 parasite-obj-y		+= parasite.o
-parasite-obj-y		+= ./$(ARCH_DIR)/parasite-head.o
 
 restorer-obj-y		+= restorer.o
 restorer-obj-y		+= ./$(ARCH_DIR)/restorer.o
 
 ifeq ($(ARCH),x86)
 # FIXME: depend on 32/64 pie type
+parasite-obj-y		+= ./$(ARCH_DIR)/parasite-head-64.o
 parasite-obj-e		+= ./$(ARCH_DIR)/syscalls-64.built-in.o
 restorer-obj-e		+= ./$(ARCH_DIR)/syscalls-64.built-in.o
 else
+parasite-obj-y		+= ./$(ARCH_DIR)/parasite-head.o
 parasite-obj-e		+= ./$(ARCH_DIR)/syscalls.built-in.o
 restorer-obj-e		+= ./$(ARCH_DIR)/syscalls.built-in.o
 endif
-- 
2.8.0



More information about the CRIU mailing list