Merge pull request #1053 from julien-thierry/stricter-static-twin

kpatch-build: Make local static twining stricter
This commit is contained in:
Josh Poimboeuf 2020-02-17 15:15:52 -06:00 committed by GitHub
commit 648be4c380
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View File

@ -976,18 +976,26 @@ static struct symbol *kpatch_find_static_twin(struct section *sec,
/* find the patched object's corresponding variable */
list_for_each_entry(rela, &sec->twin->relas, list) {
struct symbol *patched_sym;
rela_toc = toc_rela(rela);
if (!rela_toc)
continue; /* skip toc constants */
if (rela_toc->sym->twin)
patched_sym = rela_toc->sym;
if (patched_sym->twin)
continue;
if (kpatch_mangled_strcmp(rela_toc->sym->name, sym->name))
if (sym->type != patched_sym->type ||
(sym->type == STT_OBJECT &&
sym->sym.st_size != patched_sym->sym.st_size))
continue;
return rela_toc->sym;
if (kpatch_mangled_strcmp(patched_sym->name, sym->name))
continue;
return patched_sym;
}
return NULL;

@ -1 +1 @@
Subproject commit b068a43723a3efcf20b096a37b4bb8543247c62a
Subproject commit 6bd3e931ef29967a0b5bb7f7b4e4dc999e38baea