kpatch-elf: ensure SHN_LIVEPATCH syms don't get set to SHN_UNDEF when reindexing elements

This commit is contained in:
Jessica Yu 2017-01-23 12:42:52 -08:00
parent 2c3c44fec2
commit 91909e9273

View File

@ -686,7 +686,8 @@ void kpatch_reindex_elements(struct kpatch_elf *kelf)
sym->index = index++;
if (sym->sec)
sym->sym.st_shndx = sym->sec->index;
else if (sym->sym.st_shndx != SHN_ABS)
else if (sym->sym.st_shndx != SHN_ABS &&
sym->sym.st_shndx != SHN_LIVEPATCH)
sym->sym.st_shndx = SHN_UNDEF;
}
}