Giter VIP home page Giter VIP logo

Comments (2)

jstancek avatar jstancek commented on June 21, 2024

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.

sjenning avatar sjenning commented on June 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.