Add powerpc support to libkvm probe function

PowerPC kernels are of DYN type, instead of EXEC.

Reviewed by:	jhibbits
Differential Revision:	https://reviews.freebsd.org/D21583
This commit is contained in:
Leandro Lupori 2019-09-10 18:46:32 +00:00
parent 4cdea4a853
commit 8024ba45db

View File

@ -131,7 +131,8 @@ _kvm_probe_elf_kernel(kvm_t *kd, int class, int machine)
{
return (kd->nlehdr.e_ident[EI_CLASS] == class &&
kd->nlehdr.e_type == ET_EXEC &&
((machine == EM_PPC || machine == EM_PPC64) ?
kd->nlehdr.e_type == ET_DYN : kd->nlehdr.e_type == ET_EXEC) &&
kd->nlehdr.e_machine == machine);
}