[CRIU] [PATCHv3 23/23] compel/compat: fixup for head_start addr

Dmitry Safonov dsafonov at virtuozzo.com
Fri Dec 9 10:19:49 PST 2016


Resolves merge conflict with commit 71abfb84e158 ("compel: simplify
usage wrt ids").
Sets start ip for parasite blob according to app mode: native/compat.

Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
 compel/src/lib/handle-elf.c | 10 ++++++++--
 compel/test/infect/spy.c    |  1 -
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/compel/src/lib/handle-elf.c b/compel/src/lib/handle-elf.c
index 035cd0dda726..4b8b73dfacb4 100644
--- a/compel/src/lib/handle-elf.c
+++ b/compel/src/lib/handle-elf.c
@@ -593,8 +593,14 @@ int __handle_elf(void *mem, size_t size)
 	pr_out("\tpbd->hdr.bsize		= sizeof(%s_blob);\n",
 			opts.prefix);
 	pr_out("\tpbd->hdr.nr_gotpcrel	= %s_nr_gotpcrel;\n", opts.prefix);
-	pr_out("\tpbd->hdr.parasite_ip_off	= "
-			"%s_sym__export_parasite_head_start;\n", opts.prefix);
+	pr_out("\tif (compel_mode_native(ctl))\n");
+	pr_out("\t\tpbd->hdr.parasite_ip_off	= "
+		"%s_sym__export_parasite_head_start;\n", opts.prefix);
+	pr_out("#ifdef CONFIG_COMPAT\n");
+	pr_out("\telse\n");
+	pr_out("\t\tpbd->hdr.parasite_ip_off	= "
+		"%s_sym__export_parasite_head_start_compat;\n", opts.prefix);
+	pr_out("#endif /* CONFIG_COMPAT */\n");
 	pr_out("\tpbd->hdr.addr_cmd_off	= "
 			"%s_sym__export_parasite_cmd;\n", opts.prefix);
 	pr_out("\tpbd->hdr.addr_arg_off	= "
diff --git a/compel/test/infect/spy.c b/compel/test/infect/spy.c
index b56b2b71fcc9..c628a0f8602d 100644
--- a/compel/test/infect/spy.c
+++ b/compel/test/infect/spy.c
@@ -22,7 +22,6 @@ static int do_infection(int pid)
 	int state;
 	struct parasite_ctl *ctl;
 	struct infect_ctx *ictx;
-	struct parasite_blob_desc *pbd;
 	int *arg;
 
 	compel_log_init(print_vmsg, LOG_DEBUG);
-- 
2.10.2



More information about the CRIU mailing list