mirror of
https://github.com/dynup/kpatch
synced 2024-12-28 00:02:02 +00:00
Merge pull request #1053 from julien-thierry/stricter-static-twin
kpatch-build: Make local static twining stricter
This commit is contained in:
commit
648be4c380
@ -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
|
Loading…
Reference in New Issue
Block a user