diff mbox series

[3/7] create-diff-object: propagate child symbol changes

Message ID 20250116175214.83742-4-roger.pau@citrix.com (mailing list archive)
State New
Headers show
Series livepatch-build-tools: fixes for handling .cold and .hot sections | expand

Commit Message

Roger Pau Monné Jan. 16, 2025, 5:52 p.m. UTC
From: Artem Savkov <asavkov@redhat.com>

Propagate child symbol changes to it's parent.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 create-diff-object.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/create-diff-object.c b/create-diff-object.c
index b041d94d9723..dd5466bff6ce 100644
--- a/create-diff-object.c
+++ b/create-diff-object.c
@@ -821,8 +821,14 @@  static void kpatch_compare_sections(struct list_head *seclist)
 			if (sec->base->sym && sec->base->sym->status != CHANGED)
 				sec->base->sym->status = sec->status;
 		} else {
-			if (sec->sym && sec->sym->status != CHANGED)
-				sec->sym->status = sec->status;
+			struct symbol *sym = sec->sym;
+
+			if (sym && sym->status != CHANGED)
+				sym->status = sec->status;
+
+			if (sym && sym->child && sym->status == SAME &&
+			    sym->child->sec->status == CHANGED)
+				sym->status = CHANGED;
 		}
 	}
 }