From 639c478f84c495292b071aab9391c20b62c20839 Mon Sep 17 00:00:00 2001 From: Ross Lagerwall Date: Tue, 20 Oct 2015 12:12:16 +0100 Subject: [PATCH] Add space for reverting the each applied function Add an undo buffer to each xsplice_patch_func object to making reverting functions easy. --- create-diff-object.c | 2 ++ 1 file changed, 2 insertions(+) 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 -- 2.39.5