kpatch/test/integration/gcc-static-local-var-3.patch
Josh Poimboeuf 0537ff6a6f skip data sections when looking for users of static locals
It's possible for a static local variable's data section to have
a relocation which refers to the variable symbol itself.  Fix the logic
which searches for the user of a static local variable by only looking
in text sections (i.e. functions).

Fixes #411.
2014-09-09 14:43:42 -05:00

21 lines
404 B
Diff

Index: src/kernel/reboot.c
===================================================================
--- src.orig/kernel/reboot.c
+++ src/kernel/reboot.c
@@ -285,8 +285,15 @@ SYSCALL_DEFINE4(reboot, int, magic1, int
return ret;
}
+void kpatch_foo(void)
+{
+ if (!jiffies)
+ printk("kpatch_foo\n");
+}
+
static void deferred_cad(struct work_struct *dummy)
{
+ kpatch_foo();
kernel_restart(NULL);
}