create-diff-object: allow converstion of empty symbols

Empty (zero-length) symbols are possible, allow
kpatch_replace_sections_syms() to work on them.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
This commit is contained in:
Josh Poimboeuf 2022-05-11 16:33:07 -07:00
parent 8d5a628bde
commit 8508abd3b1
1 changed files with 6 additions and 0 deletions

View File

@ -1564,6 +1564,12 @@ static void kpatch_replace_sections_syms(struct kpatch_elf *kelf)
* &(var1+sizeof(var1)) will always
* be the same as &var2.
*/
} else if (target_off == start && target_off == end) {
/*
* Allow replacement for references to
* empty symbols.
*/
} else if (target_off < start || target_off >= end)
continue;