]> xenbits.xensource.com Git - freebsd.git/commitdiff
Add powerpc support to libkvm probe function
authorluporl <luporl@FreeBSD.org>
Tue, 10 Sep 2019 18:46:32 +0000 (18:46 +0000)
committerluporl <luporl@FreeBSD.org>
Tue, 10 Sep 2019 18:46:32 +0000 (18:46 +0000)
PowerPC kernels are of DYN type, instead of EXEC.

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D21583

lib/libkvm/kvm_private.c

index 467ac036c84f221b7760219063a7920c1c288709..e52cee5b35a2b9940b03ced6511d26009077bdcf 100644 (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);
 }