create-diff-object: skip conversion for sections which never have symbols

These sections don't have symbols.  Don't even try to replace references
to them with symbols.

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

View File

@ -1490,6 +1490,17 @@ static void kpatch_replace_sections_syms(struct kpatch_elf *kelf)
if (rela->sym->type != STT_SECTION || !rela->sym->sec)
continue;
/*
* These sections don't have symbols associated with
* them:
*/
if (!strcmp(rela->sym->name, ".toc") ||
!strcmp(rela->sym->name, ".fixup") ||
!strcmp(rela->sym->name, ".altinstr_replacement") ||
!strcmp(rela->sym->name, ".altinstr_aux") ||
!strcmp(rela->sym->name, ".text..refcount"))
continue;
/*
* Replace references to bundled sections with their
* symbols.