From ad79fdabd57f9b74828816920dd3765ed10d804f Mon Sep 17 00:00:00 2001 From: Pawel Wieczorkiewicz Date: Tue, 5 Nov 2019 15:37:44 +0000 Subject: [PATCH] create-diff-object: do not strip STN_UNDEF symbols from *.fixup 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 Reviewed-by: Ross Lagerwall Signed-off-by: Ross Lagerwall --- create-diff-object.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/create-diff-object.c b/create-diff-object.c index f01f1da..95e1cf4 100644 --- a/create-diff-object.c +++ b/create-diff-object.c @@ -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) -- 2.39.5