Can't find kernel text map area from kcore

kernel : 4.9.51
kexec-tools : 2.0.4

1.~ # ./kexec -p /boot/vmlinuz --initrd=/boot/initrd --command-line="`cat /proc/cmdline` irqpoll maxcpus=1 reset_devices"
Unhandled rela relocation: R_X86_64_31
原因:
    #x86_64
    export CFLAGS=-fPIC

2. # /sbin/kexec -p /boot/vmlinuz --initrd=/boot/initrd --command-line="`cat /proc/cmdline` irqpoll maxcpus=1 reset_devices"
    
Can't find kernel text map area from kcore
Cannot load /boot/vmlinuz

 kexec-tools fixes for 4.9+ kernels

Current fc25 kernel version is v4.10.

4.9+ kernel has phys_base virtual address in vmcoreinfo rather it's
symbol address. Therefore, backport makedumpfile patch "Adapt code to
get value of phys_base"

While doing that, also backport "kexec-tools/x86:
get_kernel_vaddr_and_size off-by-one fix" to fix following with kexec
-p:
 "Can't find kernel text map area from kcore"

v4.11 kernel will have another fix for kcore ( 464920104bf7 /proc/kcore:
update physical address for kcore ram and text)which allows only valid
physical address to pass in PT_LOAD.With that fix in kernel, kexec-tools
may not work always until we backport "build_mem_phdrs(): check if
p_paddr is invalid" from kexec-tools. Since there does not seem any side
effect of taking that kexec-tools commit even for v4.10 because
"phdr->p_paddr != (unsigned long long)-1" will always be TRUE for them,
therefore we take that kexec-tools patch as well.
https://github.com/pratyushanand/kexec-tools/commit/2c8ce09f420fb0f1c3b4d700dc00f3a4ffbf94f5


解法:升级到kexec-tools-2.0.15


原文地址:https://www.cnblogs.com/mull/p/7803798.html