kpatch-build: rela section could disappear after patched

After patched, rela information for some sections could
disappear. For example, a function like the following:

"
notrace noinline static int version_proc_show(struct seq_file *m,
    void *v)
{
    return 0;
}
"

Apart from common rela entries, trace and return thunk mechanism
will generate rela information. Use `notrace` to remove the
effect of trace. Make CONFIG_RETHUNK=n can remove the effect of
return thunk.

Discovered-by: Zongwu Li <lizongwu@huawei.com>
Signed-off-by: Longjun Luo <luolongjuna@gmail.com>
This commit is contained in:
Longjun Luo 2022-09-15 17:13:48 +08:00
parent b10d0e2212
commit 9fac261ed0
1 changed files with 1 additions and 1 deletions

View File

@ -974,7 +974,7 @@ static void kpatch_correlate_section(struct section *sec_orig,
__kpatch_correlate_section(sec_orig->base, sec_patched->base);
sec_orig = sec_orig->base;
sec_patched = sec_patched->base;
} else if (sec_orig->rela) {
} else if (sec_orig->rela && sec_patched->rela) {
__kpatch_correlate_section(sec_orig->rela, sec_patched->rela);
}