Commit ac187856 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

pie: x86 -- Do a real call for applying relocations

At moment both parasite and restorer do not have
any relocs because we support x86-64 only, but
this will be changed soon so do a call and apply
relocations.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 5258d95e
...@@ -2392,6 +2392,10 @@ static int remap_restorer_blob(void *addr) ...@@ -2392,6 +2392,10 @@ static int remap_restorer_blob(void *addr)
return -1; return -1;
} }
#if defined(CONFIG_X86_64) || defined(CONFIG_X86_32)
elf_apply_relocs(addr, addr, sizeof(restorer_blob),
elf_relocs, ARRAY_SIZE(elf_relocs));
#endif
return 0; return 0;
} }
......
...@@ -1223,6 +1223,11 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, struct pstree_item *item, ...@@ -1223,6 +1223,11 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, struct pstree_item *item,
pr_info("Putting parasite blob into %p->%p\n", ctl->local_map, ctl->remote_map); pr_info("Putting parasite blob into %p->%p\n", ctl->local_map, ctl->remote_map);
memcpy(ctl->local_map, parasite_blob, sizeof(parasite_blob)); memcpy(ctl->local_map, parasite_blob, sizeof(parasite_blob));
#if defined(CONFIG_X86_64) || defined(CONFIG_X86_32)
elf_apply_relocs(ctl->local_map, ctl->remote_map, sizeof(parasite_blob),
elf_relocs, ARRAY_SIZE(elf_relocs));
#endif
/* Setup the rest of a control block */ /* Setup the rest of a control block */
ctl->parasite_ip = (unsigned long)parasite_sym(ctl->remote_map, __export_parasite_head_start); ctl->parasite_ip = (unsigned long)parasite_sym(ctl->remote_map, __export_parasite_head_start);
ctl->addr_cmd = parasite_sym(ctl->local_map, __export_parasite_cmd); ctl->addr_cmd = parasite_sym(ctl->local_map, __export_parasite_cmd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment