]> xenbits.xensource.com Git - people/wipawel/livepatch-build-tools/commitdiff
Add space for reverting the each applied function
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Tue, 20 Oct 2015 11:12:16 +0000 (12:12 +0100)
committerRoss Lagerwall <ross.lagerwall@citrix.com>
Tue, 20 Oct 2015 11:12:16 +0000 (12:12 +0100)
Add an undo buffer to each xsplice_patch_func object to making reverting
functions easy.

create-diff-object.c

index 50648819f0bc3d861e3d9c58c5b647238ed23f21..fe185c1c91a818121ca128983b985dd6e59fdf8e 100644 (file)
@@ -160,6 +160,7 @@ struct xsplice_patch_func {
        unsigned long old_addr;
        unsigned long old_size;
        char *name;
+       unsigned char undo[8];
 };
 
 struct special_section {
@@ -2000,6 +2001,7 @@ void xsplice_create_patches_sections(struct xsplice_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);
 
                        /*
                         * Add a relocation that will populate