From: Ross Lagerwall Date: Wed, 20 Jan 2016 14:11:36 +0000 (+0000) Subject: Update xsplice_patch_func layout X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=25d7b7d6c96c1ab44345cbfd62425f4672714a53;p=livepatch-build-tools.git Update xsplice_patch_func layout Update the structure layout to match the most recent hypervisor version. Signed-off-by: Ross Lagerwall Signed-off-by: Konrad Rzeszutek Wilk --- diff --git a/common.h b/common.h index a6eb924..c4adce9 100644 --- a/common.h +++ b/common.h @@ -117,12 +117,12 @@ struct kpatch_elf { #define PATCH_INSN_SIZE 5 struct xsplice_patch_func { + char *name; unsigned long new_addr; - unsigned long new_size; unsigned long old_addr; - unsigned long old_size; - char *name; - unsigned char undo[8]; + uint32_t new_size; + uint32_t old_size; + unsigned char pad[32]; }; struct special_section { diff --git a/create-diff-object.c b/create-diff-object.c index 92ad48a..37f3740 100644 --- a/create-diff-object.c +++ b/create-diff-object.c @@ -1669,6 +1669,7 @@ static void xsplice_create_patches_sections(struct kpatch_elf *kelf, ERROR("%s too small to patch", sym->name); /* add entry in text section */ + funcs[index].name = NULL; if (resolve) funcs[index].old_addr = result.value; else @@ -1677,7 +1678,7 @@ static void xsplice_create_patches_sections(struct kpatch_elf *kelf, funcs[index].old_size = result.size; funcs[index].new_addr = 0; funcs[index].new_size = sym->sym.st_size; - memset(funcs[index].undo, 0, sizeof funcs[index].undo); + memset(funcs[index].pad, 0, sizeof funcs[index].pad); /* * Add a relocation that will populate @@ -1689,6 +1690,8 @@ static void xsplice_create_patches_sections(struct kpatch_elf *kelf, rela->type = R_X86_64_64; rela->addend = 0; rela->offset = index * sizeof(*funcs); + rela->offset = index * sizeof(*funcs) + + offsetof(struct xsplice_patch_func, new_addr); /* * Add a relocation that will populate