From b30d34ce8581d86f16528c765c2ecd068380f0f0 Mon Sep 17 00:00:00 2001 From: Ross Lagerwall Date: Mon, 24 Apr 2017 12:52:43 +0100 Subject: [PATCH] Ignore .discard sections Ignore differences in discard sections. They are not included in the final xen binary so there is no need to include them in the live patch. This was discovered when building a live patch for XSA-213. Before this commit, it failed with 'changed section .discard not selected for inclusion'. Reported-by: Sarah Newman Signed-off-by: Ross Lagerwall Reviewed-by: Andrew Cooper Reviewed-by: Konrad Rzeszutek Wilk --- create-diff-object.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/create-diff-object.c b/create-diff-object.c index 217e58f..ba19daf 100644 --- a/create-diff-object.c +++ b/create-diff-object.c @@ -888,6 +888,14 @@ static void kpatch_mark_ignored_sections(struct kpatch_elf *kelf) struct rela *rela; char *name; + /* Always ignore .discard sections */ + sec = find_section_by_name(&kelf->sections, ".discard"); + if (sec) { + sec->ignore = 1; + if (sec->twin) + sec->twin->ignore = 1; + } + sec = find_section_by_name(&kelf->sections, ".livepatch.ignore.sections"); if (!sec) return; -- 2.39.5