summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2010-07-23 17:32:47 +0000
committeravg <avg@FreeBSD.org>2010-07-23 17:32:47 +0000
commit50e1a73d601b113e166d994bff65fb997f547c7e (patch)
tree84bb6df88456e37065778474ca6f68dd4589b2e1 /cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
parente702b156d5207a8b61360c3cc17e5805301f7b52 (diff)
downloadFreeBSD-src-50e1a73d601b113e166d994bff65fb997f547c7e.zip
FreeBSD-src-50e1a73d601b113e166d994bff65fb997f547c7e.tar.gz
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
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h')
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
index 6bcc5bc..a712d24 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
@@ -137,6 +137,7 @@ typedef struct dt_module {
dt_idhash_t *dm_extern; /* external symbol definitions */
#if !defined(sun)
caddr_t dm_reloc_offset; /* Symbol relocation offset. */
+ uintptr_t *dm_sec_offsets;
#endif
} dt_module_t;
OpenPOWER on IntegriCloud