]> xenbits.xensource.com Git - livepatch-build-tools.git/commitdiff
Update xsplice_patch_func layout
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Wed, 20 Jan 2016 14:11:36 +0000 (14:11 +0000)
committerRoss Lagerwall <ross.lagerwall@citrix.com>
Wed, 20 Jan 2016 14:13:00 +0000 (14:13 +0000)
Update the structure layout to match the most recent hypervisor version.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
common.h
create-diff-object.c

index a6eb92413104d2d52af21b2fd3838f514300b628..c4adce9a97dd227139da9af4a719167f61712751 100644 (file)
--- 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 {
index 92ad48ad68ffd0f2bc58eff5e4028d06d43910ef..37f3740b20ec91de45c38f34347f82fba3448ca4 100644 (file)
@@ -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