summaryrefslogtreecommitdiffstats
path: root/cddl
diff options
context:
space:
mode:
authormarkj <markj@FreeBSD.org>2014-12-26 22:50:34 +0000
committermarkj <markj@FreeBSD.org>2014-12-26 22:50:34 +0000
commit73aece47810786775493c0c6b54c84b4a13a0666 (patch)
treea9736082556d300a4b7870e1ec708ae862e374cf /cddl
parentfe75b90da9fd90d1dc3257c0ccffafc2b48066d0 (diff)
downloadFreeBSD-src-73aece47810786775493c0c6b54c84b4a13a0666.zip
FreeBSD-src-73aece47810786775493c0c6b54c84b4a13a0666.tar.gz
MFC r275011:
The module load address always needs to be included when setting the dm_*_va fields of dt_module_t. Previously, this was only done on architectures where kernel modules have type ET_REL; this change fixes that. As a result, symbol name resolution in the stack() action now works properly for kernel modules on i386.
Diffstat (limited to 'cddl')
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c
index e3905c1..9dd52b5 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c
@@ -1211,13 +1211,13 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat)
#if defined(__FreeBSD__)
if (sh.sh_size == 0)
continue;
- if (is_elf_obj && (sh.sh_type == SHT_PROGBITS ||
- sh.sh_type == SHT_NOBITS)) {
+ if (sh.sh_type == SHT_PROGBITS || sh.sh_type == SHT_NOBITS) {
alignmask = sh.sh_addralign - 1;
mapbase += alignmask;
mapbase &= ~alignmask;
sh.sh_addr = mapbase;
- dmp->dm_sec_offsets[elf_ndxscn(sp)] = sh.sh_addr;
+ if (is_elf_obj)
+ dmp->dm_sec_offsets[elf_ndxscn(sp)] = sh.sh_addr;
mapbase += sh.sh_size;
}
#endif
OpenPOWER on IntegriCloud