From 81d769f562f920e514c7ceb16c38151c22477692 Mon Sep 17 00:00:00 2001 From: markj Date: Tue, 6 Jan 2015 02:13:48 +0000 Subject: [PATCH] MFC r276250: DOF tables are aligned according to the DOF section's alignment constraint, so take this into account when iterating over DOF tables. PR: 195555 git-svn-id: svn://svn.freebsd.org/base/stable/9@276731 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- cddl/contrib/opensolaris/lib/libdtrace/common/drti.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c b/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c index bb02d8cf4..b2854d2bb 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c @@ -163,6 +163,7 @@ dtrace_dof_init(void) size_t shstridx, symtabidx = 0, dynsymidx = 0; unsigned char *buf; int fixedprobes; + uint64_t aligned_filesz; #endif if (getenv("DTRACE_DOF_INIT_DISABLE") != NULL) @@ -226,7 +227,9 @@ dtrace_dof_init(void) while ((char *) dof < (char *) dofdata->d_buf + dofdata->d_size) { fixedprobes = 0; - 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 || -- 2.45.0