]> xenbits.xensource.com Git - livepatch-build-tools.git/commitdiff
create-diff-object: Handle optional apply|revert hooks
authorPawel Wieczorkiewicz <wipawel@amazon.de>
Tue, 26 Nov 2019 12:25:07 +0000 (12:25 +0000)
committerRoss Lagerwall <ross.lagerwall@citrix.com>
Thu, 6 Feb 2020 16:26:05 +0000 (16:26 +0000)
Include new sections containing optional apply and revert action
hooks.

The following new section names are supported:
  - .livepatch.hooks.apply
  - .livepatch.hooks.revert

Signed-off-by: Pawel Wieczorkiewicz <wipawel@amazon.de>
Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
create-diff-object.c

index b53cd5cee947e884bcd50f5f681e9b7b98c041ed..bebfc46550f7fba13e5f40f1152825703ae9e706 100644 (file)
@@ -1131,6 +1131,14 @@ static struct special_section special_sections[] = {
                .name           = ".livepatch.hooks.postrevert",
                .group_size     = livepatch_hooks_group_size,
        },
+       {
+               .name           = ".livepatch.hooks.apply",
+               .group_size     = livepatch_hooks_group_size,
+       },
+       {
+               .name           = ".livepatch.hooks.revert",
+               .group_size     = livepatch_hooks_group_size,
+       },
        {},
 };
 
@@ -1501,6 +1509,7 @@ static void kpatch_include_debug_sections(struct kpatch_elf *kelf)
 
 #define IS_ACTION_HOOK_SECTION(section, action) ({ \
         IS_HOOK_SECTION(section, "pre" action) || \
+        IS_HOOK_SECTION(section, action) || \
         IS_HOOK_SECTION(section, "post" action); \
 })
 
@@ -1510,6 +1519,7 @@ static void kpatch_include_debug_sections(struct kpatch_elf *kelf)
 
 #define IS_ACTION_HOOK_SYM_NAME(symbol, action) ({ \
         IS_HOOK_SYM_NAME(symbol, "pre" action) || \
+        IS_HOOK_SYM_NAME(symbol, action) || \
         IS_HOOK_SYM_NAME(symbol, "post" action); \
 })