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 <jpoimboe@redhat.com>
This commit is contained in:
Josh Poimboeuf 2022-05-11 16:28:41 -07:00
parent 01427d50a1
commit 8d5a628bde
1 changed files with 2 additions and 1 deletions

View File

@ -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) {