From: Ross Lagerwall Date: Tue, 20 Oct 2015 11:12:16 +0000 (+0100) Subject: Add space for reverting the each applied function X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=639c478f84c495292b071aab9391c20b62c20839;p=livepatch-build-tools.git Add space for reverting the each applied function Add an undo buffer to each xsplice_patch_func object to making reverting functions easy. --- diff --git a/create-diff-object.c b/create-diff-object.c index 5064881..fe185c1 100644 --- a/create-diff-object.c +++ b/create-diff-object.c @@ -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