]> xenbits.xensource.com Git - livepatch-build-tools.git/commitdiff
Ignore .discard sections
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Mon, 24 Apr 2017 11:52:43 +0000 (12:52 +0100)
committerRoss Lagerwall <ross.lagerwall@citrix.com>
Mon, 12 Jun 2017 07:26:49 +0000 (08:26 +0100)
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 <srn@prgmr.com>
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
create-diff-object.c

index 217e58f5aa3e905999a40d7c2b127666e2ad799f..ba19daf4fd9b20aaa3911ee7dbf7f27d9ce3343c 100644 (file)
@@ -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;