From 8d5a628bde7298991a64b27f4ee5bd25b663e52f Mon Sep 17 00:00:00 2001 From: Josh Poimboeuf Date: Wed, 11 May 2022 16:28:41 -0700 Subject: [PATCH] create-diff-object: add extra check for symbol conversion edge case This issue was only seen in in a text section. Explicitly check for that. Signed-off-by: Josh Poimboeuf --- kpatch-build/create-diff-object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c index 3ad446c..c51f010 100644 --- a/kpatch-build/create-diff-object.c +++ b/kpatch-build/create-diff-object.c @@ -1527,7 +1527,8 @@ static void kpatch_replace_sections_syms(struct kpatch_elf *kelf) start = sym->sym.st_value; end = sym->sym.st_value + sym->sym.st_size; - if (!is_text_section(sym->sec) && + if (is_text_section(relasec->base) && + !is_text_section(sym->sec) && rela->type == R_X86_64_32S && rela->addend == (long)sym->sec->sh.sh_size && end == (long)sym->sec->sh.sh_size) {