mirror of
https://github.com/dynup/kpatch
synced 2025-02-25 22:40:41 +00:00
create-diff-object: allow new data to be included
Allow the inclusion of new global variables.
This commit is contained in:
parent
437245e374
commit
543ad11ccd
@ -1122,7 +1122,7 @@ void kpatch_verify_patchability(struct kpatch_elf *kelf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ensure we aren't including .data.* or .bss.* */
|
/* ensure we aren't including .data.* or .bss.* */
|
||||||
if (sec->include &&
|
if (sec->include && sec->status != NEW &&
|
||||||
(!strncmp(sec->name, ".data", 5) ||
|
(!strncmp(sec->name, ".data", 5) ||
|
||||||
!strncmp(sec->name, ".bss", 4))) {
|
!strncmp(sec->name, ".bss", 4))) {
|
||||||
log_normal("data section %s selected for inclusion\n",
|
log_normal("data section %s selected for inclusion\n",
|
||||||
|
3
test/integration/data-new-LOADED.test
Executable file
3
test/integration/data-new-LOADED.test
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
grep "kpatch: 5" /proc/meminfo
|
29
test/integration/data-new.patch
Normal file
29
test/integration/data-new.patch
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
Index: src/fs/proc/meminfo.c
|
||||||
|
===================================================================
|
||||||
|
--- src.orig/fs/proc/meminfo.c
|
||||||
|
+++ src/fs/proc/meminfo.c
|
||||||
|
@@ -20,6 +20,8 @@ void __attribute__((weak)) arch_report_m
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
+static int foo = 5;
|
||||||
|
+
|
||||||
|
static int meminfo_proc_show(struct seq_file *m, void *v)
|
||||||
|
{
|
||||||
|
struct sysinfo i;
|
||||||
|
@@ -138,6 +140,7 @@ static int meminfo_proc_show(struct seq_
|
||||||
|
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
|
||||||
|
"AnonHugePages: %8lu kB\n"
|
||||||
|
#endif
|
||||||
|
+ "kpatch: %d"
|
||||||
|
,
|
||||||
|
K(i.totalram),
|
||||||
|
K(i.freeram),
|
||||||
|
@@ -193,6 +196,7 @@ static int meminfo_proc_show(struct seq_
|
||||||
|
,K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
|
||||||
|
HPAGE_PMD_NR)
|
||||||
|
#endif
|
||||||
|
+ ,foo
|
||||||
|
);
|
||||||
|
|
||||||
|
hugetlb_report_meminfo(m);
|
Loading…
Reference in New Issue
Block a user