From owner-svn-src-all@FreeBSD.ORG Thu Mar 22 17:44:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3B4ED106566B; Thu, 22 Mar 2012 17:44:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2672E8FC15; Thu, 22 Mar 2012 17:44:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MHibF6034666; Thu, 22 Mar 2012 17:44:37 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MHia1i034664; Thu, 22 Mar 2012 17:44:36 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203221744.q2MHia1i034664@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 22 Mar 2012 17:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233317 - head/usr.sbin/pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 17:44:37 -0000 Author: gonzo Date: Thu Mar 22 17:44:36 2012 New Revision: 233317 URL: http://svn.freebsd.org/changeset/base/233317 Log: Fix base vaddr detection for ELF binaries. PT_LOAD with offset 0 is not mandatory for ELF binaries so we'll use the segment with offset less then alignment and align it appropriately (which covers pt_offset == 0 case) Modified: head/usr.sbin/pmcstat/pmcstat_log.c Modified: head/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat_log.c Thu Mar 22 17:36:53 2012 (r233316) +++ head/usr.sbin/pmcstat/pmcstat_log.c Thu Mar 22 17:44:36 2012 (r233317) @@ -697,8 +697,8 @@ pmcstat_image_get_elf_params(struct pmcs ph.p_offset); break; case PT_LOAD: - if (ph.p_offset == 0) - image->pi_vaddr = ph.p_vaddr; + if ((ph.p_offset & (-ph.p_align)) == 0) + image->pi_vaddr = ph.p_vaddr & (-ph.p_align); break; } }