Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kpatch-build failed (fc19) #86

Closed
lulinqing opened this issue Mar 26, 2014 · 4 comments
Closed

kpatch-build failed (fc19) #86

lulinqing opened this issue Mar 26, 2014 · 4 comments

Comments

@lulinqing
Copy link
Contributor

$ kpatch-build foo.patch
Using cache at /home/lilu/.kpatch/3.13.6-100.fc19.x86_64/src
Testing patch file
patching file fs/proc/meminfo.c
Building original kernel
Building patched kernel
Detecting changed objects
Rebuilding changed objects
Extracting new and modified ELF sections
changed function: meminfo_proc_show
Building patch module: kpatch-foo.ko
ERROR: kpatch build failed. Check /tmp/kpatch-build-1395733172.log for more details.

The last few lines from log file(110KB in total):
https://github.com/lulinqing/misc/blob/master/kpatch-build-1395733172.log

... ...
found patched function meminfo_proc_show
original function at address ffffffff81227a90 (length 1312)
patches_nr = 1
patches_size = 24
relas_size = 24
patches_offset = 71
relas_offset = 80
make -C /home/lilu/.kpatch/3.13.6-100.fc19.x86_64/src M=/tmp/tmp.wAw8XBHOYT/patch kpatch-foo.ko
make[1]: Entering directory `/home/lilu/.kpatch/3.13.6-100.fc19.x86_64/src'
  CC [M]  /tmp/tmp.wAw8XBHOYT/patch/kpatch-patch-hook.o
  LD [M]  /tmp/tmp.wAw8XBHOYT/patch/kpatch-foo.o
/tmp/tmp.wAw8XBHOYT/patch/output.o: file not recognized: File format not recognized
make[3]: *** [/tmp/tmp.wAw8XBHOYT/patch/kpatch-foo.o] Error 1
make[2]: *** [kpatch-foo.ko] Error 2
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/lilu/.kpatch/3.13.6-100.fc19.x86_64/src'
make: *** [kpatch-foo.ko] Error 2

Test patch I used:

Index: src/fs/proc/meminfo.c
===================================================================
--- src.orig/fs/proc/meminfo.c
+++ src/fs/proc/meminfo.c
@@ -95,7 +95,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
        "Committed_AS:   %8lu kB\n"
        "VmallocTotal:   %8lu kB\n"
        "VmallocUsed:    %8lu kB\n"
-       "VmallocChunk:   %8lu kB\n"
+       "VMALLOCCHUNK:   %8lu kB\n"
 #ifdef CONFIG_MEMORY_FAILURE
        "HardwareCorrupted: %5lu kB\n"
 #endif

Thanks!

@sjenning
Copy link
Contributor

What version of elfutils do you have installed? It needs to be 0.158 (or greater).

@ryanmiao
Copy link
Contributor

I agree with Seth.
And I tried this patch on fedora19 with elfutils-0.156-5.fc19.x86_64, ld failed to generate kpatch-meminfo.o.

@lulinqing
Copy link
Contributor Author

I have 0.156-5 installed, and it's the latest I can get from yum update.

$ rpm -qa | grep elf
elfutils-0.156-5.fc19.x86_64
elfutils-libelf-0.156-5.fc19.x86_64
elfutils-libs-0.156-5.fc19.x86_64
elfutils-devel-0.156-5.fc19.x86_64
elfutils-libelf-devel-0.156-5.fc19.x86_64

I'll install 0.158+ manually and try again.
Thanks!

@lulinqing
Copy link
Contributor Author

Tested on fc20 and this issue was gone.
Hit another error and reported in issue #87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants