From owner-cvs-src-old@FreeBSD.ORG Fri Jul 23 17:33:08 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6FE01065676 for ; Fri, 23 Jul 2010 17:33:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id A4E2B8FC1A for ; Fri, 23 Jul 2010 17:33:08 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o6NHX8bV095127 for ; Fri, 23 Jul 2010 17:33:08 GMT (envelope-from avg@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o6NHX814095126 for cvs-src-old@freebsd.org; Fri, 23 Jul 2010 17:33:08 GMT (envelope-from avg@repoman.freebsd.org) Message-Id: <201007231733.o6NHX814095126@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to avg@repoman.freebsd.org using -f From: Andriy Gapon Date: Fri, 23 Jul 2010 17:32:47 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/cddl/contrib/opensolaris/lib/libdtrace/common dt_impl.h dt_module.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2010 17:33:08 -0000 avg 2010-07-23 17:32:47 UTC FreeBSD src repository Modified files: cddl/contrib/opensolaris/lib/libdtrace/common dt_impl.h dt_module.c Log: SVN rev 210425 on 2010-07-23 17:32:47Z by avg dtrace: correctly map sections to addresses in elf object modules (amd64) Unlike for modules with dso type, in elf object modules all the sections have virtual address of zero. So, it is insufficient to add module base address to section virtual address (as recorded in section header) to get section address in kernel memory. Instead, we should apply the same calculations that are performed by kernel loaders (in boot code and in kernel) when they lay out sections in memory. Also, unlike OpenSolaris, the sections are not collapsed into just .text, .data and .bss by module loaders, so we need to take additional care about other sections. Note that in-kernel symbol-to-address mapping worked just fine, e.g. fbt provider could correctly find the functions, etc. It's only in userland that the mapping in both direction worked incorrectly, e.g. in stack() output addresses of functions in kernel modules were not translated to their names. Reviewed by: rpaulo MFC after: 3 weeks Revision Changes Path 1.3 +1 -0 src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h 1.3 +69 -6 src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c