diff mbox series

[v2,3/7] create-diff-object: Handle optional apply|revert hooks

Message ID 20190916113056.16592-4-wipawel@amazon.de (mailing list archive)
State New, archived
Headers show
Series livepatch-build-tools: new features and fixes | expand

Commit Message

Wieczorkiewicz, Pawel Sept. 16, 2019, 11:30 a.m. UTC
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>
---
 create-diff-object.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Ross Lagerwall Nov. 25, 2019, 2:16 p.m. UTC | #1
On 9/16/19 12:30 PM, Pawel Wieczorkiewicz wrote:
> 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>
diff mbox series

Patch

diff --git a/create-diff-object.c b/create-diff-object.c
index 44f4e6b..9918b6e 100644
--- a/create-diff-object.c
+++ b/create-diff-object.c
@@ -1118,6 +1118,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,
+	},
 	{},
 };
 
@@ -1488,6 +1496,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); \
 })
 
@@ -1497,6 +1506,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); \
 })