From de921f39a30c42bbeaf962f0ea12b83ad991eeb8 Mon Sep 17 00:00:00 2001 From: markj Date: Fri, 26 Dec 2014 22:49:27 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.freebsd.org/base/stable/9@276264 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c | 6 +++--- 1 file 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 497faa995..b7438c4bf 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c @@ -970,13 +970,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 -- 2.45.0