Date: Fri, 26 Dec 2014 18:53:30 +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: r276250 - head/cddl/contrib/opensolaris/lib/libdtrace/common Message-ID: <201412261853.sBQIrU6S062693@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Fri Dec 26 18:53:29 2014 New Revision: 276250 URL: https://svnweb.freebsd.org/changeset/base/276250 Log: DOF tables are aligned according to the DOF section's alignment constraint, so take this into account when iterating over DOF tables. PR: 195555 Submitted by: Fedor Indutny <fedor@indutny.com> (original version) MFC after: 1 week Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Fri Dec 26 17:45:49 2014 (r276249) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Fri Dec 26 18:53:29 2014 (r276250) @@ -127,6 +127,7 @@ dtrace_dof_init(void) int efd; char *s; size_t shstridx; + uint64_t aligned_filesz; #endif if (getenv("DTRACE_DOF_INIT_DISABLE") != NULL) @@ -183,7 +184,9 @@ dtrace_dof_init(void) } while ((char *) dof < (char *) dofdata->d_buf + dofdata->d_size) { - dof_next = (void *) ((char *) dof + dof->dofh_filesz); + aligned_filesz = (shdr.sh_addralign == 0 ? dof->dofh_filesz : + roundup2(dof->dofh_filesz, shdr.sh_addralign)); + dof_next = (void *) ((char *) dof + aligned_filesz); #endif if (dof->dofh_ident[DOF_ID_MAG0] != DOF_MAG_MAG0 ||
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412261853.sBQIrU6S062693>