create-diff-object: fix symbol section indexes

For a local non-included function or object which is needed by an
included function, its symbol table entry will still refer to a local
section index.  Instead it should be changed to SHN_UNDEF.
This commit is contained in:
Josh Poimboeuf 2014-05-26 22:51:58 -05:00
parent 0ebbed244e
commit b1131bfeb6

View File

@ -982,6 +982,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)
sym->sym.st_shndx = SHN_UNDEF;
}
}