]> xenbits.xensource.com Git - livepatch-build-tools.git/commitdiff
create-diff-object: do not strip STN_UNDEF symbols from *.fixup
authorPawel Wieczorkiewicz <wipawel@amazon.de>
Tue, 5 Nov 2019 15:37:44 +0000 (15:37 +0000)
committerRoss Lagerwall <ross.lagerwall@citrix.com>
Tue, 26 Nov 2019 10:53:24 +0000 (10:53 +0000)
The rela groups in the *.fixup sections vary in size. That makes it
more complex to handle in the livepatch_strip_undefined_elements().
It is also unnecessary as the .fixup sections are unlikely to have
any STN_UNDEF symbols anyway.

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 f01f1da7a83d23227b5f8a835d4e88cf192291cc..95e1cf40bffb7f94c1dc55d7419d8050691a6d34 100644 (file)
@@ -2028,6 +2028,13 @@ static void livepatch_strip_undefined_elements(struct kpatch_elf *kelf)
                if (!is_rela_section(sec))
                        continue;
 
+               /* The rela groups in the .fixup sections vary in size.
+                * Ignore them as they are unlikely to have any STN_UNDEF
+                * symbols anyway.
+                */
+               if (strstr(sec->name, ".fixup"))
+                       continue;
+
                /* only known, fixed-size entries can be stripped */
                entry_size = get_section_entry_size(sec->base, kelf);
                if (entry_size == 0)