Date: Tue, 25 Nov 2014 06:43:18 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275011 - head/cddl/contrib/opensolaris/lib/libdtrace/common Message-ID: <201411250643.sAP6hIl6069270@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Tue Nov 25 06:43:17 2014 New Revision: 275011 URL: https://svnweb.freebsd.org/changeset/base/275011 Log: 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. Reported by: Shrikanth Kamath <shrikanth07@gmail.com> Tested by: Shrikanth Kamath Discussed with: avg MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c Tue Nov 25 06:15:00 2014 (r275010) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c Tue Nov 25 06:43:17 2014 (r275011) @@ -1211,13 +1211,13 @@ dt_module_update(dtrace_hdl_t *dtp, stru #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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411250643.sAP6hIl6069270>