diff --git a/usr.sbin/pmcstat/pmcstat_log.c b/usr.sbin/pmcstat/pmcstat_log.c index 8190b2800aeb..fbc358d6129d 100644 --- a/usr.sbin/pmcstat/pmcstat_log.c +++ b/usr.sbin/pmcstat/pmcstat_log.c @@ -716,7 +716,8 @@ pmcstat_image_get_elf_params(struct pmcstat_image *image) ph.p_offset); break; case PT_LOAD: - if ((ph.p_offset & (-ph.p_align)) == 0) + if ((ph.p_flags & PF_X) != 0 && + (ph.p_offset & (-ph.p_align)) == 0) image->pi_vaddr = ph.p_vaddr & (-ph.p_align); break; }