diff options
author | markj <markj@FreeBSD.org> | 2014-12-26 18:53:29 +0000 |
---|---|---|
committer | markj <markj@FreeBSD.org> | 2014-12-26 18:53:29 +0000 |
commit | 45396b269dde32f19275cc716ef40b86044225fb (patch) | |
tree | 011abbe7940d2c9605ef3e08681081cd1e1b9d0a /cddl/contrib/opensolaris/lib/libdtrace/common | |
parent | 542808d08d962cc01431dd7b0f910f7ada1a5a0a (diff) | |
download | FreeBSD-src-45396b269dde32f19275cc716ef40b86044225fb.zip FreeBSD-src-45396b269dde32f19275cc716ef40b86044225fb.tar.gz |
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
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libdtrace/common')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libdtrace/common/drti.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c b/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c index d7b3490..6f3c9c7 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c @@ -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 || |