Comments (2)
Here is simpler reproducer, with base kernel containing kernel/test3.c with content:
#include <linux/init.h>
#include <linux/export.h>
static int dummy;
void test_function30(void)
{
dummy = 1;
}
void test_function31(void)
{
dummy = 2;
}
EXPORT_SYMBOL(test_function30);
EXPORT_SYMBOL(test_function31);
and kpatch patch:
diff --git a/kernel/test3.c b/kernel/test3.c
index 50d3c86..91a43a1 100644
--- a/kernel/test3.c
+++ b/kernel/test3.c
@@ -5,7 +5,9 @@ static int dummy;
void test_function30(void)
{
- dummy = 1;
+ int i;
+ for (i = 0; i < 10; i++)
+ dummy += i;
}
void test_function31(void)
# /usr/local/libexec/kpatch/create-diff-object orig/kernel/test3.o patched/kernel/test3.o /root/vmlinux output/kernel/test3.o
=== section list (22) ===
ndx 01, type: 1, data (nil), size 0, name .text
ndx 02, type: 1, data 0x7fd4e9fff040, size 21, name .text.test_function30
ndx 03, type: 4, data 0x7fd4e9fffb88, size 48, name .rela.text.test_function30
ndx 04, type: 1, data 0x7fd4e9fff060, size 21, name .text.test_function31
ndx 05, type: 4, data 0x7fd4e9fffbb8, size 48, name .rela.text.test_function31
ndx 06, type: 1, data 0x7fd4e9fff080, size 16, name ___ksymtab+test_function31
ndx 07, type: 4, data 0x7fd4e9fffbe8, size 48, name .rela___ksymtab+test_function31
ndx 08, type: 1, data 0x7fd4e9fff090, size 32, name __ksymtab_strings
ndx 09, type: 1, data 0x7fd4e9fff0b0, size 8, name ___kcrctab+test_function31
ndx 10, type: 4, data 0x7fd4e9fffc18, size 24, name .rela___kcrctab+test_function31
ndx 11, type: 1, data 0x7fd4e9fff0c0, size 16, name ___ksymtab+test_function30
ndx 12, type: 4, data 0x7fd4e9fffc30, size 48, name .rela___ksymtab+test_function30
ndx 13, type: 1, data 0x7fd4e9fff0d0, size 8, name ___kcrctab+test_function30
ndx 14, type: 4, data 0x7fd4e9fffc60, size 24, name .rela___kcrctab+test_function30
ndx 15, type: 1, data (nil), size 0, name .data
ndx 16, type: 8, data (nil), size 0, name .bss
ndx 17, type: 8, data (nil), size 4, name .bss.dummy
ndx 18, type: 1, data 0x7fd4e9fff0d8, size 46, name .comment
ndx 19, type: 1, data (nil), size 0, name .note.GNU-stack
ndx 20, type: 3, data 0x7fd4e9fff106, size 280, name .shstrtab
ndx 21, type: 2, data 0x7fd4e9fff7e0, size 672, name .symtab
ndx 22, type: 3, data 0x7fd4e9fffa80, size 258, name .strtab
=== symbol list (28 entries) ===
sym 00, type 0, bind 0, ndx 00, name
sym 01, type 3, bind 0, ndx 08, name __ksymtab_strings -> __ksymtab_strings
sym 02, type 3, bind 0, ndx 17, name .bss.dummy -> .bss.dummy
sym 03, type 4, bind 0, ndx 65521, name test3.c
sym 04, type 1, bind 0, ndx 17, name dummy -> .bss.dummy
sym 05, type 1, bind 0, ndx 06, name __ksymtab_test_function31 -> ___ksymtab+test_function31
sym 06, type 1, bind 0, ndx 08, name __kstrtab_test_function31 -> __ksymtab_strings
sym 07, type 1, bind 0, ndx 09, name __kcrctab_test_function31 -> ___kcrctab+test_function31
sym 08, type 1, bind 0, ndx 11, name __ksymtab_test_function30 -> ___ksymtab+test_function30
sym 09, type 1, bind 0, ndx 08, name __kstrtab_test_function30 -> __ksymtab_strings
sym 10, type 1, bind 0, ndx 13, name __kcrctab_test_function30 -> ___kcrctab+test_function30
sym 11, type 4, bind 0, ndx 65521, name
sym 12, type 3, bind 0, ndx 01, name .text -> .text
sym 13, type 3, bind 0, ndx 02, name .text.test_function30 -> .text.test_function30
sym 14, type 3, bind 0, ndx 04, name .text.test_function31 -> .text.test_function31
sym 15, type 3, bind 0, ndx 06, name ___ksymtab+test_function31 -> ___ksymtab+test_function31
sym 16, type 3, bind 0, ndx 09, name ___kcrctab+test_function31 -> ___kcrctab+test_function31
sym 17, type 3, bind 0, ndx 11, name ___ksymtab+test_function30 -> ___ksymtab+test_function30
sym 18, type 3, bind 0, ndx 13, name ___kcrctab+test_function30 -> ___kcrctab+test_function30
sym 19, type 3, bind 0, ndx 15, name .data -> .data
sym 20, type 3, bind 0, ndx 16, name .bss -> .bss
sym 21, type 3, bind 0, ndx 18, name .comment -> .comment
sym 22, type 3, bind 0, ndx 19, name .note.GNU-stack -> .note.GNU-stack
sym 23, type 2, bind 1, ndx 04, name test_function31 -> .text.test_function31
sym 24, type 0, bind 1, ndx 65521, name __crc_test_function30
sym 25, type 0, bind 1, ndx 00, name __fentry__
sym 26, type 0, bind 1, ndx 65521, name __crc_test_function31
sym 27, type 2, bind 1, ndx 02, name test_function30 -> .text.test_function30
=== rela list for .text.test_function30 (2 entries) ===
offset 1, type 0, __fentry__ - 4
offset 8, type 2, .bss.dummy - 8
=== rela list for .text.test_function31 (2 entries) ===
offset 1, type 0, __fentry__ - 4
offset 8, type 2, .bss.dummy - 8
=== rela list for ___ksymtab+test_function31 (2 entries) ===
offset 0, type 1, test_function31 + 0
offset 8, type 1, __ksymtab_strings + 0
=== rela list for ___kcrctab+test_function31 (1 entries) ===
offset 0, type 1, __crc_test_function31 + 0
=== rela list for ___ksymtab+test_function30 (2 entries) ===
offset 0, type 1, test_function30 + 0
offset 8, type 1, __ksymtab_strings + 16
=== rela list for ___kcrctab+test_function30 (1 entries) ===
offset 0, type 1, __crc_test_function30 + 0
=== section list (22) ===
ndx 01, type: 1, data (nil), size 0, name .text
ndx 02, type: 1, data 0x7fd4e9ffd040, size 42, name .text.test_function30
ndx 03, type: 4, data 0x7fd4e9ffdb98, size 72, name .rela.text.test_function30
ndx 04, type: 1, data 0x7fd4e9ffd070, size 21, name .text.test_function31
ndx 05, type: 4, data 0x7fd4e9ffdbe0, size 48, name .rela.text.test_function31
ndx 06, type: 1, data 0x7fd4e9ffd090, size 16, name ___ksymtab+test_function31
ndx 07, type: 4, data 0x7fd4e9ffdc10, size 48, name .rela___ksymtab+test_function31
ndx 08, type: 1, data 0x7fd4e9ffd0a0, size 32, name __ksymtab_strings
ndx 09, type: 1, data 0x7fd4e9ffd0c0, size 8, name ___kcrctab+test_function31
ndx 10, type: 4, data 0x7fd4e9ffdc40, size 24, name .rela___kcrctab+test_function31
ndx 11, type: 1, data 0x7fd4e9ffd0d0, size 16, name ___ksymtab+test_function30
ndx 12, type: 4, data 0x7fd4e9ffdc58, size 48, name .rela___ksymtab+test_function30
ndx 13, type: 1, data 0x7fd4e9ffd0e0, size 8, name ___kcrctab+test_function30
ndx 14, type: 4, data 0x7fd4e9ffdc88, size 24, name .rela___kcrctab+test_function30
ndx 15, type: 1, data (nil), size 0, name .data
ndx 16, type: 8, data (nil), size 0, name .bss
ndx 17, type: 8, data (nil), size 4, name .bss.dummy
ndx 18, type: 1, data 0x7fd4e9ffd0e8, size 46, name .comment
ndx 19, type: 1, data (nil), size 0, name .note.GNU-stack
ndx 20, type: 3, data 0x7fd4e9ffd116, size 280, name .shstrtab
ndx 21, type: 2, data 0x7fd4e9ffd7f0, size 672, name .symtab
ndx 22, type: 3, data 0x7fd4e9ffda90, size 258, name .strtab
=== symbol list (28 entries) ===
sym 00, type 0, bind 0, ndx 00, name
sym 01, type 3, bind 0, ndx 08, name __ksymtab_strings -> __ksymtab_strings
sym 02, type 3, bind 0, ndx 17, name .bss.dummy -> .bss.dummy
sym 03, type 4, bind 0, ndx 65521, name test3.c
sym 04, type 1, bind 0, ndx 17, name dummy -> .bss.dummy
sym 05, type 1, bind 0, ndx 06, name __ksymtab_test_function31 -> ___ksymtab+test_function31
sym 06, type 1, bind 0, ndx 08, name __kstrtab_test_function31 -> __ksymtab_strings
sym 07, type 1, bind 0, ndx 09, name __kcrctab_test_function31 -> ___kcrctab+test_function31
sym 08, type 1, bind 0, ndx 11, name __ksymtab_test_function30 -> ___ksymtab+test_function30
sym 09, type 1, bind 0, ndx 08, name __kstrtab_test_function30 -> __ksymtab_strings
sym 10, type 1, bind 0, ndx 13, name __kcrctab_test_function30 -> ___kcrctab+test_function30
sym 11, type 4, bind 0, ndx 65521, name
sym 12, type 3, bind 0, ndx 01, name .text -> .text
sym 13, type 3, bind 0, ndx 02, name .text.test_function30 -> .text.test_function30
sym 14, type 3, bind 0, ndx 04, name .text.test_function31 -> .text.test_function31
sym 15, type 3, bind 0, ndx 06, name ___ksymtab+test_function31 -> ___ksymtab+test_function31
sym 16, type 3, bind 0, ndx 09, name ___kcrctab+test_function31 -> ___kcrctab+test_function31
sym 17, type 3, bind 0, ndx 11, name ___ksymtab+test_function30 -> ___ksymtab+test_function30
sym 18, type 3, bind 0, ndx 13, name ___kcrctab+test_function30 -> ___kcrctab+test_function30
sym 19, type 3, bind 0, ndx 15, name .data -> .data
sym 20, type 3, bind 0, ndx 16, name .bss -> .bss
sym 21, type 3, bind 0, ndx 18, name .comment -> .comment
sym 22, type 3, bind 0, ndx 19, name .note.GNU-stack -> .note.GNU-stack
sym 23, type 2, bind 1, ndx 04, name test_function31 -> .text.test_function31
sym 24, type 0, bind 1, ndx 65521, name __crc_test_function30
sym 25, type 0, bind 1, ndx 00, name __fentry__
sym 26, type 0, bind 1, ndx 65521, name __crc_test_function31
sym 27, type 2, bind 1, ndx 02, name test_function30 -> .text.test_function30
=== rela list for .text.test_function30 (3 entries) ===
offset 1, type 0, __fentry__ - 4
offset 7, type 2, .bss.dummy - 4
offset 36, type 2, .bss.dummy - 4
=== rela list for .text.test_function31 (2 entries) ===
offset 1, type 0, __fentry__ - 4
offset 8, type 2, .bss.dummy - 8
=== rela list for ___ksymtab+test_function31 (2 entries) ===
offset 0, type 1, test_function31 + 0
offset 8, type 1, __ksymtab_strings + 0
=== rela list for ___kcrctab+test_function31 (1 entries) ===
offset 0, type 1, __crc_test_function31 + 0
=== rela list for ___ksymtab+test_function30 (2 entries) ===
offset 0, type 1, test_function30 + 0
offset 8, type 1, __ksymtab_strings + 16
=== rela list for ___kcrctab+test_function30 (1 entries) ===
offset 0, type 1, __crc_test_function30 + 0
section .text.test_function30 has changed
section .rela.text.test_function30 has changed
section .symtab has changed
test3.o: symbol info mismatch:
/usr/local/libexec/kpatch/create-diff-object: unreconcilable difference
from kpatch.
I can't recreate the "symbol info mismatch" issue with the latest master 6aee215. I do get the:
signal.o: signal.o: changed section .rela__jump_table not selected for inclusion
signal.o: 1 unsupported section change(s)
which is being track in issue #157. Can you confirm?
from kpatch.
Related Issues (20)
- create-diff-object static local variable correlation and inlining HOT 5
- 1.0 release HOT 2
- Do we need more robust archeticture protection HOT 4
- kpatch-build: verify_patch_files might miss a parameter HOT 2
- ERROR in find_local_syms, couldn't find matching XXX local symbols in vmlinux symbol table HOT 14
- Can you add support for Rocky and Alma? HOT 1
- relocation with type R_X86_64_GOTPCREL is not supported HOT 5
- Arch Compile kpatch-git test failed HOT 4
- Regarding "statically allocated data" again HOT 2
- kpatch-build error when modifying an object file's only syscall
- nowhere to find the definition of klp_register_patch HOT 5
- x86 paravirt code uses alternatives v6.8+ HOT 1
- special-static.patch can fail to build on s390x / upstream v6.8 HOT 6
- CONFIG_FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY not supported on ppc64le HOT 6
- function __pfx_new_sync_read has no fentry/mcount call, unable to patch HOT 6
- Unchanged and unpatchable function moves from .text to .text.unlikely HOT 5
- Why did the kpatch-build script export the KPATCH-BUILD environment variable from the BUILD directory to the SOURCE directory? HOT 3
- CONFIG_WERROR=y and CONFIG_LD_ORPHAN_WARN_LEVEL="error" break kpatch-build HOT 2
- linux 6.9.0-rc6 can't find special struct paravirt_patch_site size HOT 6
- fair.o: changed section .data..read_mostly not selected for inclusion HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kpatch.