Skip to content

Commit 44ad2ba

Browse files
committed
Merge pull request #298 from jpoimboe/no-fentry-dynrela
create-diff-object: don't create __fentry__ dynrelas
2 parents 322b9b9 + e847026 commit 44ad2ba

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

kpatch-build/create-diff-object.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,8 +1816,22 @@ void kpatch_create_dynamic_rela_sections(struct kpatch_elf *kelf,
18161816
} else {
18171817
/*
18181818
* We have a patch to a module which references
1819-
* a global symbol. First try to find it in
1820-
* the module being patched.
1819+
* a global symbol.
1820+
*/
1821+
1822+
/*
1823+
* __fentry__ relas can't be converted to
1824+
* dynrelas because the ftrace module init code
1825+
* runs before the dynrela code can initialize
1826+
* them. __fentry__ is exported by the kernel,
1827+
* so leave it as a normal rela.
1828+
*/
1829+
if (!strcmp(rela->sym->name, "__fentry__"))
1830+
continue;
1831+
1832+
/*
1833+
* Try to find the symbol in the module being
1834+
* patched.
18211835
*/
18221836
if (lookup_global_symbol(table, rela->sym->name,
18231837
&result))

0 commit comments

Comments
 (0)